[dpdk-stable] [PATCH 1/2] net/ixgbe: fix x550 code to handle unidentified PHY

Luca Boccassi bluca at debian.org
Thu Nov 1 15:04:12 CET 2018


ixgbe_identify_phy_x550em() was missing the code to handle unidentified
PHY that has been there in 82599 so it was not able to complete
initialization of ixgbe sequence if no sfp plugged in.
Port it over to return an appropriate type and complete init sequence
properly.

Fixes: d2e72774e58c ("ixgbe/base: support X550")
Cc: stable at dpdk.org

Signed-off-by: Luca Boccassi <bluca at debian.org>
---
v2: refresh to remove merge conflict with master

 drivers/net/ixgbe/base/ixgbe_x550.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c
index f7b98af52..83b394861 100644
--- a/drivers/net/ixgbe/base/ixgbe_x550.c
+++ b/drivers/net/ixgbe/base/ixgbe_x550.c
@@ -315,13 +315,21 @@ STATIC void ixgbe_setup_mux_ctl(struct ixgbe_hw *hw)
  */
 STATIC s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw)
 {
+	s32 status;
+
 	hw->mac.ops.set_lan_id(hw);
 
 	ixgbe_read_mng_if_sel_x550em(hw);
 
 	switch (hw->device_id) {
 	case IXGBE_DEV_ID_X550EM_A_SFP:
-		return ixgbe_identify_sfp_module_X550em(hw);
+		status = ixgbe_identify_sfp_module_X550em(hw);
+		/* Set PHY type none if no PHY detected */
+		if (hw->phy.type == ixgbe_phy_unknown) {
+			hw->phy.type = ixgbe_phy_none;
+			return IXGBE_SUCCESS;
+		}
+		return status;
 	case IXGBE_DEV_ID_X550EM_X_SFP:
 		/* set up for CS4227 usage */
 		ixgbe_setup_mux_ctl(hw);
@@ -329,8 +337,13 @@ STATIC s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw)
 		/* Fallthrough */
 
 	case IXGBE_DEV_ID_X550EM_A_SFP_N:
-		return ixgbe_identify_sfp_module_X550em(hw);
-		break;
+		status = ixgbe_identify_sfp_module_X550em(hw);
+		/* Set PHY type none if no PHY detected */
+		if (hw->phy.type == ixgbe_phy_unknown) {
+			hw->phy.type = ixgbe_phy_none;
+			return IXGBE_SUCCESS;
+		}
+		return status;
 	case IXGBE_DEV_ID_X550EM_X_KX4:
 		hw->phy.type = ixgbe_phy_x550em_kx4;
 		break;
-- 
2.19.1



More information about the stable mailing list