[dpdk-dev,08/37] ixgbe/base: return err when SFP module is not present
Commit Message
This patch updates ixgbe_supported_sfp_modules_X550em to return
IXGBE_ERR_SFP_NOT_PRESENT when SFP module is not present and updates
ixgbe_setup_mac_link_sfp_x550em to handle this return value.
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
drivers/net/ixgbe/base/ixgbe_x550.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
@@ -1000,7 +1000,7 @@ STATIC s32 ixgbe_supported_sfp_modules_X550em(struct ixgbe_hw *hw, bool *linear)
switch (hw->phy.sfp_type) {
case ixgbe_sfp_type_not_present:
- return IXGBE_SUCCESS;
+ return IXGBE_ERR_SFP_NOT_PRESENT;
case ixgbe_sfp_type_da_cu_core0:
case ixgbe_sfp_type_da_cu_core1:
*linear = true;
@@ -1725,6 +1725,13 @@ s32 ixgbe_setup_mac_link_sfp_x550em(struct ixgbe_hw *hw,
/* Check if SFP module is supported and linear */
ret_val = ixgbe_supported_sfp_modules_X550em(hw, &setup_linear);
+ /* If no SFP module present, then return success. Return success since
+ * there is no reason to configure CS4227 and SFP not present error is
+ * not excepted in the setup MAC link flow.
+ */
+ if (ret_val == IXGBE_ERR_SFP_NOT_PRESENT)
+ return IXGBE_SUCCESS;
+
if (ret_val != IXGBE_SUCCESS)
return ret_val;