[dpdk-dev,25/39] net/ixgbe/base: set default autoneg speed at reset

Message ID 1472312902-16963-26-git-send-email-xiao.w.wang@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Bruce Richardson
Headers

Commit Message

Xiao Wang Aug. 27, 2016, 3:48 p.m. UTC
  This patch avoids the situation where we initialize adapter and not
yet set up phy.autoneg_advertised speeds. In that case we could end
up in having no autoneg speeds enabled and get no link until we
reset link and set autoneg speeds correctly.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_x550.c | 6 ++++++
 1 file changed, 6 insertions(+)
  

Patch

diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c
index 3c19326..32759cc 100644
--- a/drivers/net/ixgbe/base/ixgbe_x550.c
+++ b/drivers/net/ixgbe/base/ixgbe_x550.c
@@ -2283,6 +2283,12 @@  STATIC s32 ixgbe_reset_phy_m88(struct ixgbe_hw *hw)
 
 	hw->mac.ops.release_swfw_sync(hw, mask);
 
+	/* In case of first reset set advertised speeds to default value */
+	if (!hw->phy.autoneg_advertised)
+		hw->phy.autoneg_advertised = IXGBE_LINK_SPEED_1GB_FULL |
+					     IXGBE_LINK_SPEED_100_FULL |
+					     IXGBE_LINK_SPEED_10_FULL;
+
 	return ixgbe_setup_m88(hw);
 
 out: