diff options
author | Emil Tantilov <emil.s.tantilov@intel.com> | 2013-08-30 03:55:24 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2013-09-13 12:51:03 -0400 |
commit | ed33ff66d8064e7b84459ad8ba49aad4cc67c269 (patch) | |
tree | 8ba9125a2e53725687aa5b842b903095149cf897 /drivers/net/ethernet | |
parent | 91ffdc842b8ac0f96b5283b0f0b72927b7dfa8c7 (diff) |
ixgbe: limit setting speed to only one at a time for QSFP modules
QSFP+ modules do not support auto negotiation and should advertise only
one speed at a time.
This patch adds logic in ethtool to allow setting and reporting the
advertised speed at either 1Gbps or 10Gbps, but not both. Also limits
the speed set in ixgbe_sfp_link_config_subtask() to highest supported.
Previously the link was set to whatever the supported speeds were.
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 13 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 10 |
2 files changed, 22 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index 08efc253fb8d..b41db3be9184 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | |||
@@ -186,6 +186,11 @@ static int ixgbe_get_settings(struct net_device *netdev, | |||
186 | ecmd->advertising |= ADVERTISED_1000baseT_Full; | 186 | ecmd->advertising |= ADVERTISED_1000baseT_Full; |
187 | if (supported_link & IXGBE_LINK_SPEED_100_FULL) | 187 | if (supported_link & IXGBE_LINK_SPEED_100_FULL) |
188 | ecmd->advertising |= ADVERTISED_100baseT_Full; | 188 | ecmd->advertising |= ADVERTISED_100baseT_Full; |
189 | |||
190 | if (hw->phy.multispeed_fiber && !autoneg) { | ||
191 | if (supported_link & IXGBE_LINK_SPEED_10GB_FULL) | ||
192 | ecmd->advertising = ADVERTISED_10000baseT_Full; | ||
193 | } | ||
189 | } | 194 | } |
190 | 195 | ||
191 | if (autoneg) { | 196 | if (autoneg) { |
@@ -314,6 +319,14 @@ static int ixgbe_set_settings(struct net_device *netdev, | |||
314 | if (ecmd->advertising & ~ecmd->supported) | 319 | if (ecmd->advertising & ~ecmd->supported) |
315 | return -EINVAL; | 320 | return -EINVAL; |
316 | 321 | ||
322 | /* only allow one speed at a time if no autoneg */ | ||
323 | if (!ecmd->autoneg && hw->phy.multispeed_fiber) { | ||
324 | if (ecmd->advertising == | ||
325 | (ADVERTISED_10000baseT_Full | | ||
326 | ADVERTISED_1000baseT_Full)) | ||
327 | return -EINVAL; | ||
328 | } | ||
329 | |||
317 | old = hw->phy.autoneg_advertised; | 330 | old = hw->phy.autoneg_advertised; |
318 | advertised = 0; | 331 | advertised = 0; |
319 | if (ecmd->advertising & ADVERTISED_10000baseT_Full) | 332 | if (ecmd->advertising & ADVERTISED_10000baseT_Full) |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index ae267868429b..0ade0cd5ef53 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -6000,8 +6000,16 @@ static void ixgbe_sfp_link_config_subtask(struct ixgbe_adapter *adapter) | |||
6000 | adapter->flags &= ~IXGBE_FLAG_NEED_LINK_CONFIG; | 6000 | adapter->flags &= ~IXGBE_FLAG_NEED_LINK_CONFIG; |
6001 | 6001 | ||
6002 | speed = hw->phy.autoneg_advertised; | 6002 | speed = hw->phy.autoneg_advertised; |
6003 | if ((!speed) && (hw->mac.ops.get_link_capabilities)) | 6003 | if ((!speed) && (hw->mac.ops.get_link_capabilities)) { |
6004 | hw->mac.ops.get_link_capabilities(hw, &speed, &autoneg); | 6004 | hw->mac.ops.get_link_capabilities(hw, &speed, &autoneg); |
6005 | |||
6006 | /* setup the highest link when no autoneg */ | ||
6007 | if (!autoneg) { | ||
6008 | if (speed & IXGBE_LINK_SPEED_10GB_FULL) | ||
6009 | speed = IXGBE_LINK_SPEED_10GB_FULL; | ||
6010 | } | ||
6011 | } | ||
6012 | |||
6005 | if (hw->mac.ops.setup_link) | 6013 | if (hw->mac.ops.setup_link) |
6006 | hw->mac.ops.setup_link(hw, speed, true); | 6014 | hw->mac.ops.setup_link(hw, speed, true); |
6007 | 6015 | ||