diff mbox

[1/1] ixgbe: get link speed as a slave nic unrelated with link up

Message ID 1454311675-24676-2-git-send-email-zyjzyj2000@gmail.com
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show

Commit Message

Zhu Yanjun Feb. 1, 2016, 7:27 a.m. UTC
From: Zhu Yanjun <zyjzyj2000@gmail.com>

The commit 0e4d422f5f72 ("ixgbe: do not call check_link for ethtool
in ixgbe_get_settings()") decreases the bonding failures. But the
following time slice still results in a bonding failure.

bonding                ixgbe
  |                     |
  |                    carrier_on
  |                     |
  |    <----------------|
 link_up                |
  |                     |
  |                    carrier_off
  |                     |
 get_link_speed ------->|
  |                     |

As such, the nic link speed can unconditionally be gotten as a
slave nic whether the link is up or not.

Signed-off-by: Zhu Yanjun <zyjzyj2000@gmail.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tantilov, Emil S Feb. 1, 2016, 3:55 p.m. UTC | #1
>-----Original Message-----
>From: zyjzyj2000@gmail.com [mailto:zyjzyj2000@gmail.com]
>Sent: Sunday, January 31, 2016 11:28 PM
>To: zyjzyj2000@gmail.com; Tantilov, Emil S; Schmitt, Phillip J; Kirsher,
>Jeffrey T; netdev@vger.kernel.org; e1000-devel@lists.sourceforge.net;
>Shteinbock, Boris (Wind River)
>Subject: [PATCH 1/1] ixgbe: get link speed as a slave nic unrelated with
>link up
>
>From: Zhu Yanjun <zyjzyj2000@gmail.com>
>
>The commit 0e4d422f5f72 ("ixgbe: do not call check_link for ethtool
>in ixgbe_get_settings()") decreases the bonding failures. But the
>following time slice still results in a bonding failure.
>
>bonding                ixgbe
>  |                     |
>  |                    carrier_on
>  |                     |
>  |    <----------------|
> link_up                |
>  |                     |
>  |                    carrier_off
>  |                     |
> get_link_speed ------->|
>  |                     |

The driver does not set carrier_off unless the link is actually down.

Did you actually test this patch?

Thanks,
Emil
diff mbox

Patch

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index bea96b3..53edf39 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -311,7 +311,7 @@  static int ixgbe_get_settings(struct net_device *netdev,
 		break;
 	}
 
-	if (netif_carrier_ok(netdev)) {
+	if (netif_carrier_ok(netdev) || (netdev->flags & IFF_SLAVE)) {
 		switch (adapter->link_speed) {
 		case IXGBE_LINK_SPEED_10GB_FULL:
 			ethtool_cmd_speed_set(ecmd, SPEED_10000);