From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wenzhuo Lu Subject: [PATCH 08/37] ixgbe/base: return err when SFP module is not present Date: Wed, 24 Jun 2015 11:25:57 +0800 Message-ID: <1435116386-12010-9-git-send-email-wenzhuo.lu@intel.com> References: <1435116386-12010-1-git-send-email-wenzhuo.lu@intel.com> To: dev@dpdk.org Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 61863C63E for ; Wed, 24 Jun 2015 05:26:52 +0200 (CEST) In-Reply-To: <1435116386-12010-1-git-send-email-wenzhuo.lu@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/net/ixgbe/base/ixgbe_x550.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c index 2aa1fc7..1ae79d1 100644 --- a/drivers/net/ixgbe/base/ixgbe_x550.c +++ b/drivers/net/ixgbe/base/ixgbe_x550.c @@ -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; -- 1.9.3