All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH] ixgbe: do not call check_link for ethtool in ixgbe_get_settings()
@ 2015-12-03 23:20 Emil Tantilov
  2016-01-08  1:31 ` Schmitt, Phillip J
  0 siblings, 1 reply; 2+ messages in thread
From: Emil Tantilov @ 2015-12-03 23:20 UTC (permalink / raw)
  To: intel-wired-lan

In ixgbe_get_settings() the link status and speed of the interface
are determined based on a read from the LINKS register via the call
to mac.ops.check.link(). This can cause issues where external drivers
may end up with unknown speed when calling ethtool_get_setings().

Instead of calling the mac.ops.check_link() we can report the speed
from the adapter structure which is populated by the driver.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index 2c5696a..6ddb2e6 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -185,9 +185,7 @@ static int ixgbe_get_settings(struct net_device *netdev,
 	struct ixgbe_adapter *adapter = netdev_priv(netdev);
 	struct ixgbe_hw *hw = &adapter->hw;
 	ixgbe_link_speed supported_link;
-	u32 link_speed = 0;
 	bool autoneg = false;
-	bool link_up;
 
 	hw->mac.ops.get_link_capabilities(hw, &supported_link, &autoneg);
 
@@ -313,9 +311,8 @@ static int ixgbe_get_settings(struct net_device *netdev,
 		break;
 	}
 
-	hw->mac.ops.check_link(hw, &link_speed, &link_up, false);
-	if (link_up) {
-		switch (link_speed) {
+	if (netif_carrier_ok(netdev)) {
+		switch (adapter->link_speed) {
 		case IXGBE_LINK_SPEED_10GB_FULL:
 			ethtool_cmd_speed_set(ecmd, SPEED_10000);
 			break;


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Intel-wired-lan] [PATCH] ixgbe: do not call check_link for ethtool in ixgbe_get_settings()
  2015-12-03 23:20 [Intel-wired-lan] [PATCH] ixgbe: do not call check_link for ethtool in ixgbe_get_settings() Emil Tantilov
@ 2016-01-08  1:31 ` Schmitt, Phillip J
  0 siblings, 0 replies; 2+ messages in thread
From: Schmitt, Phillip J @ 2016-01-08  1:31 UTC (permalink / raw)
  To: intel-wired-lan


> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Emil Tantilov
> Sent: Thursday, December 03, 2015 3:20 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH] ixgbe: do not call check_link for ethtool in
> ixgbe_get_settings()
> 
> In ixgbe_get_settings() the link status and speed of the interface are determined
> based on a read from the LINKS register via the call to mac.ops.check.link(). This
> can cause issues where external drivers may end up with unknown speed when
> calling ethtool_get_setings().
> 
> Instead of calling the mac.ops.check_link() we can report the speed from the
> adapter structure which is populated by the driver.
> 
> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
> ---

Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-08  1:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-03 23:20 [Intel-wired-lan] [PATCH] ixgbe: do not call check_link for ethtool in ixgbe_get_settings() Emil Tantilov
2016-01-08  1:31 ` Schmitt, Phillip J

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.