Skip to contentSkip to conversation

igb: link up/down messages must follow a specific format

PATCH Applied Jeff Kirsher 3 participants 12 messages Nov 27, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/5 igb: link up/down messages must follow a specific format

From: Alexander Duyck <[email protected]>

The system log messages created on a link status change need to follow a specific format to work with tools some customers use.

---

 drivers/net/igb/igb_main.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
drivers/net/igb/igb_main.c +6 -3
index ab37ab0..0919a2f 100644
@@ -2328,9 +2328,10 @@ static void igb_watchdog_task(struct work_struct *work)
 						   &adapter->link_duplex);
 
 			ctrl = rd32(E1000_CTRL);
-			dev_info(&adapter->pdev->dev,
-				 "NIC Link is Up %d Mbps %s, "
+			/* Links status message must follow this format */
+			printk(KERN_INFO "igb: %s NIC Link is Up %d Mbps %s, "
 				 "Flow Control: %s\n",
+			         netdev->name,
 				 adapter->link_speed,
 				 adapter->link_duplex == FULL_DUPLEX ?
 				 "Full Duplex" : "Half Duplex",
@@ -2365,7 +2366,9 @@ static void igb_watchdog_task(struct work_struct *work)
 		if (netif_carrier_ok(netdev)) {
 			adapter->link_speed = 0;
 			adapter->link_duplex = 0;
-			dev_info(&adapter->pdev->dev, "NIC Link is Down\n");
+			/* Links status message must follow this format */
+			printk(KERN_INFO "igb: %s NIC Link is Down\n",
+			       netdev->name);
 			netif_carrier_off(netdev);
 			netif_tx_stop_all_queues(netdev);
 			if (!test_bit(__IGB_DOWN, &adapter->state))
#1 lore raw

PATCH 2/5 ixgbe: cleanup link up/down messages

The system log messages created on a link status change need to follow a specific format to work with tools some customers use. This also makes the messages consistant with other Intel driver link messages.

---

 drivers/net/ixgbe/ixgbe_main.c |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)
drivers/net/ixgbe/ixgbe_main.c +12 -10
index 15d511c..fbe19ee 100644
@@ -3456,15 +3456,16 @@ static void ixgbe_watchdog_task(struct work_struct *work)
 			u32 rmcs = IXGBE_READ_REG(hw, IXGBE_RMCS);
 #define FLOW_RX (frctl & IXGBE_FCTRL_RFCE)
 #define FLOW_TX (rmcs & IXGBE_RMCS_TFCE_802_3X)
-			DPRINTK(LINK, INFO, "NIC Link is Up %s, "
-			        "Flow Control: %s\n",
-			        (link_speed == IXGBE_LINK_SPEED_10GB_FULL ?
-			         "10 Gbps" :
-			         (link_speed == IXGBE_LINK_SPEED_1GB_FULL ?
-			          "1 Gbps" : "unknown speed")),
-			        ((FLOW_RX && FLOW_TX) ? "RX/TX" :
-			         (FLOW_RX ? "RX" :
-			         (FLOW_TX ? "TX" : "None"))));
+			printk(KERN_INFO "ixgbe: %s NIC Link is Up %s, "
+			       "Flow Control: %s\n",
+			       netdev->name,
+			       (link_speed == IXGBE_LINK_SPEED_10GB_FULL ?
+			        "10 Gbps" :
+			        (link_speed == IXGBE_LINK_SPEED_1GB_FULL ?
+			         "1 Gbps" : "unknown speed")),
+			       ((FLOW_RX && FLOW_TX) ? "RX/TX" :
+			        (FLOW_RX ? "RX" :
+			        (FLOW_TX ? "TX" : "None"))));
 
 			netif_carrier_on(netdev);
 			netif_tx_wake_all_queues(netdev);
@@ -3476,7 +3477,8 @@ static void ixgbe_watchdog_task(struct work_struct *work)
 		adapter->link_up = false;
 		adapter->link_speed = 0;
 		if (netif_carrier_ok(netdev)) {
-			DPRINTK(LINK, INFO, "NIC Link is Down\n");
+			printk(KERN_INFO "ixgbe: %s NIC Link is Down\n",
+			       netdev->name);
 			netif_carrier_off(netdev);
 			netif_tx_stop_all_queues(netdev);
 		}
maintainer Applied
#2 lore raw

Re: [NET-NEXT PATCH 2/5] ixgbe: cleanup link up/down messages

From: Jeff Kirsher <[email protected]>
Date: Wed, 26 Nov 2008 16:02:22 -0800

Quoted 5 lines

The system log messages created on a link status change need to follow a specific format to work with tools some customers use. This also makes the messages consistant with other Intel driver link messages.

Applied.

#3 lore raw

PATCH 3/5 e1000: cleanup link up/down messages

In reply to Jeff Kirsher

The system log messages created on a link status change need to follow a specific format to work with tools some customers use. This also makes the messages consistant with other Intel driver link messages.

---

 drivers/net/e1000/e1000_main.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
drivers/net/e1000/e1000_main.c +7 -5
index 5c098c9..6494d24 100644
@@ -2524,10 +2524,11 @@ static void e1000_watchdog(unsigned long data)
 			                           &adapter->link_duplex);
 
 			ctrl = er32(CTRL);
-			DPRINTK(LINK, INFO, "NIC Link is Up %d Mbps %s, "
-			        "Flow Control: %s\n",
-			        adapter->link_speed,
-			        adapter->link_duplex == FULL_DUPLEX ?
+			printk(KERN_INFO "e1000: %s NIC Link is Up %d Mbps %s, "
+			       "Flow Control: %s\n",
+			       netdev->name,
+			       adapter->link_speed,
+			       adapter->link_duplex == FULL_DUPLEX ?
 			        "Full Duplex" : "Half Duplex",
 			        ((ctrl & E1000_CTRL_TFCE) && (ctrl &
 			        E1000_CTRL_RFCE)) ? "RX/TX" : ((ctrl &
@@ -2603,7 +2604,8 @@ static void e1000_watchdog(unsigned long data)
 		if (netif_carrier_ok(netdev)) {
 			adapter->link_speed = 0;
 			adapter->link_duplex = 0;
-			DPRINTK(LINK, INFO, "NIC Link is Down\n");
+			printk(KERN_INFO "e1000: %s NIC Link is Down\n",
+			       netdev->name);
 			netif_carrier_off(netdev);
 			netif_stop_queue(netdev);
 			mod_timer(&adapter->phy_info_timer, round_jiffies(jiffies + 2 * HZ));
maintainer Applied
#4 lore raw

Re: [NET-NEXT PATCH 3/5] e1000: cleanup link up/down messages

From: Jeff Kirsher <[email protected]>
Date: Wed, 26 Nov 2008 16:02:35 -0800

Quoted 5 lines

The system log messages created on a link status change need to follow a specific format to work with tools some customers use. This also makes the messages consistant with other Intel driver link messages.

Applied.

#5 lore raw

PATCH 4/5 ixgb: cleanup link up/down messages

In reply to Jeff Kirsher

The system log messages created on a link status change need to follow a specific format to work with tools some customers use. This also makes the messages consistant with other Intel driver link messages.

---

 drivers/net/ixgb/ixgb_main.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
drivers/net/ixgb/ixgb_main.c +11 -3
index a04e389..820a92c 100644
@@ -1110,8 +1110,15 @@ ixgb_watchdog(unsigned long data)
 
 	if (adapter->hw.link_up) {
 		if (!netif_carrier_ok(netdev)) {
-			DPRINTK(LINK, INFO,
-			        "NIC Link is Up 10000 Mbps Full Duplex\n");
+			printk(KERN_INFO "ixgb: %s NIC Link is Up 10 Gbps "
+			       "Full Duplex, Flow Control: %s\n",
+			       netdev->name,
+			       (adapter->hw.fc.type == ixgb_fc_full) ?
+			        "RX/TX" :
+			        ((adapter->hw.fc.type == ixgb_fc_rx_pause) ?
+			         "RX" :
+			         ((adapter->hw.fc.type == ixgb_fc_tx_pause) ?
+			          "TX" : "None")));
 			adapter->link_speed = 10000;
 			adapter->link_duplex = FULL_DUPLEX;
 			netif_carrier_on(netdev);
@@ -1121,7 +1128,8 @@ ixgb_watchdog(unsigned long data)
 		if (netif_carrier_ok(netdev)) {
 			adapter->link_speed = 0;
 			adapter->link_duplex = 0;
-			DPRINTK(LINK, INFO, "NIC Link is Down\n");
+			printk(KERN_INFO "ixgb: %s NIC Link is Down\n",
+			       netdev->name);
 			netif_carrier_off(netdev);
 			netif_stop_queue(netdev);
 
maintainer Applied
#6 lore raw

Re: [NET-NEXT PATCH 4/5] ixgb: cleanup link up/down messages

From: Jeff Kirsher <[email protected]>
Date: Wed, 26 Nov 2008 16:02:48 -0800

Quoted 5 lines

The system log messages created on a link status change need to follow a specific format to work with tools some customers use. This also makes the messages consistant with other Intel driver link messages.

Applied.

#7 lore raw

PATCH 5/5 e100: cleanup link up/down messages

In reply to Jeff Kirsher

The system log messages created on a link status change need to follow a specific format to work with tools some customers use. This also makes the messages consistant with other Intel driver link messages.

---

 drivers/net/e100.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
drivers/net/e100.c +6 -4
index 2001a63..dce7ff2 100644
@@ -1580,11 +1580,13 @@ static void e100_watchdog(unsigned long data)
 	mii_ethtool_gset(&nic->mii, &cmd);
 
 	if(mii_link_ok(&nic->mii) && !netif_carrier_ok(nic->netdev)) {
-		DPRINTK(LINK, INFO, "link up, %sMbps, %s-duplex\n",
-			cmd.speed == SPEED_100 ? "100" : "10",
-			cmd.duplex == DUPLEX_FULL ? "full" : "half");
+		printk(KERN_INFO "e100: %s NIC Link is Up %s Mbps %s Duplex\n",
+		       nic->netdev->name,
+		       cmd.speed == SPEED_100 ? "100" : "10",
+		       cmd.duplex == DUPLEX_FULL ? "Full" : "Half");
 	} else if(!mii_link_ok(&nic->mii) && netif_carrier_ok(nic->netdev)) {
-		DPRINTK(LINK, INFO, "link down\n");
+		printk(KERN_INFO "e100: %s NIC Link is Down\n",
+		       nic->netdev->name);
 	}
 
 	mii_check_link(&nic->mii);
maintainer Applied
#8 lore raw

Re: [NET-NEXT PATCH 5/5] e100: cleanup link up/down messages

From: Jeff Kirsher <[email protected]>
Date: Wed, 26 Nov 2008 16:03:02 -0800

Quoted 5 lines

The system log messages created on a link status change need to follow a specific format to work with tools some customers use. This also makes the messages consistant with other Intel driver link messages.

Applied.

#10 lore raw
In reply to Jeff Kirsher
Quoted 4 lines · Jeff Kirsher

From: Alexander Duyck <[email protected]>

The system log messages created on a link status change need to follow a specific format to work with tools some customers use.

It would be better to define standard helper functions that output this format somewhere. Then this could be also used in other drivers.

-Andi

Signature · 1 line
[email protected]
maintainer
#11 lore raw

From: Andi Kleen <[email protected]>
Date: Thu, 27 Nov 2008 11:50:45 +0100

Quoted 9 lines
Quoted 4 lines · Jeff Kirsher

From: Alexander Duyck <[email protected]>

The system log messages created on a link status change need to follow a specific format to work with tools some customers use.

It would be better to define standard helper functions that output this format somewhere. Then this could be also used in other drivers.

He's already been told this.