Skip to content

Commit

Permalink
ixgbe: advertise highest capable link speed
Browse files Browse the repository at this point in the history
On module insert advertise highest capable link speed. If module is
capable of 10G, then advertise 10G, else advertise modules capable
link speeds.

Signed-off-by: Paul Greenwalt <paul.greenwalt@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
  • Loading branch information
Paul Greenwalt authored and Jeff Kirsher committed Jan 9, 2018
1 parent 09099dd commit 3ead7c2
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7656,6 +7656,7 @@ static void ixgbe_sfp_detection_subtask(struct ixgbe_adapter *adapter)
static void ixgbe_sfp_link_config_subtask(struct ixgbe_adapter *adapter)
{
struct ixgbe_hw *hw = &adapter->hw;
u32 cap_speed;
u32 speed;
bool autoneg = false;

Expand All @@ -7668,16 +7669,14 @@ static void ixgbe_sfp_link_config_subtask(struct ixgbe_adapter *adapter)

adapter->flags &= ~IXGBE_FLAG_NEED_LINK_CONFIG;

speed = hw->phy.autoneg_advertised;
if ((!speed) && (hw->mac.ops.get_link_capabilities)) {
hw->mac.ops.get_link_capabilities(hw, &speed, &autoneg);
hw->mac.ops.get_link_capabilities(hw, &cap_speed, &autoneg);

/* setup the highest link when no autoneg */
if (!autoneg) {
if (speed & IXGBE_LINK_SPEED_10GB_FULL)
speed = IXGBE_LINK_SPEED_10GB_FULL;
}
}
/* advertise highest capable link speed */
if (!autoneg && (cap_speed & IXGBE_LINK_SPEED_10GB_FULL))
speed = IXGBE_LINK_SPEED_10GB_FULL;
else
speed = cap_speed & (IXGBE_LINK_SPEED_10GB_FULL |
IXGBE_LINK_SPEED_1GB_FULL);

if (hw->mac.ops.setup_link)
hw->mac.ops.setup_link(hw, speed, true);
Expand Down

0 comments on commit 3ead7c2

Please sign in to comment.