From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 52FE9ADBE for ; Tue, 24 Jun 2014 16:42:02 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 24 Jun 2014 07:36:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,538,1400050800"; d="scan'208";a="562520888" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 24 Jun 2014 07:41:33 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s5OEfW9N020771; Tue, 24 Jun 2014 15:41:32 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id s5OEfWmP029901; Tue, 24 Jun 2014 15:41:32 +0100 Received: (from pdelarax@localhost) by sivswdev02.ir.intel.com with id s5OEfW4F029897; Tue, 24 Jun 2014 15:41:32 +0100 From: Pablo de Lara To: dev@dpdk.org Date: Tue, 24 Jun 2014 15:41:29 +0100 Message-Id: <1403620889-29179-1-git-send-email-pablox.de.lara.guarch@intel.com> X-Mailer: git-send-email 1.7.0.7 Subject: [dpdk-dev] [PATCH] ixgbe: Alternative fix for 82599 Bypass NIC, getting incorrect media type X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jun 2014 14:42:02 -0000 From: Pablo de Lara This was previosly solved in commit 60a70d4e042350ca0f9200334b341063438be89b, but this alternative fix solves the same issue, but without modifying the ixgbe shared code. Signed-off-by: Pablo de Lara --- lib/librte_pmd_ixgbe/ixgbe/ixgbe_82599.c | 3 -- lib/librte_pmd_ixgbe/ixgbe_82599_bypass.c | 35 ++++++++++++++++++---------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_82599.c b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_82599.c index 93c4e35..ed97ad9 100644 --- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_82599.c +++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_82599.c @@ -537,9 +537,6 @@ enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw) case IXGBE_DEV_ID_82599_SFP_SF2: case IXGBE_DEV_ID_82599_SFP_SF_QP: case IXGBE_DEV_ID_82599EN_SFP: -#ifdef RTE_NIC_BYPASS - case IXGBE_DEV_ID_82599_BYPASS: -#endif media_type = ixgbe_media_type_fiber; break; case IXGBE_DEV_ID_82599_CX4: diff --git a/lib/librte_pmd_ixgbe/ixgbe_82599_bypass.c b/lib/librte_pmd_ixgbe/ixgbe_82599_bypass.c index 27a5f70..6748ea4 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_82599_bypass.c +++ b/lib/librte_pmd_ixgbe/ixgbe_82599_bypass.c @@ -256,19 +256,6 @@ out: return status; } -/* - * Wrapper around ND functions to support BYPASS nic. - */ -s32 -ixgbe_bypass_init_shared_code(struct ixgbe_hw *hw) -{ - if (hw->device_id == IXGBE_DEV_ID_82599_BYPASS) { - hw->mac.type = ixgbe_mac_82599EB; - } - - return (ixgbe_init_shared_code(hw)); -} - static enum ixgbe_media_type ixgbe_bypass_get_media_type(struct ixgbe_hw *hw) { @@ -284,6 +271,28 @@ ixgbe_bypass_get_media_type(struct ixgbe_hw *hw) return (media_type); } +/* + * Wrapper around ND functions to support BYPASS nic. + */ +s32 +ixgbe_bypass_init_shared_code(struct ixgbe_hw *hw) +{ + s32 ret_val; + + if (hw->device_id == IXGBE_DEV_ID_82599_BYPASS) { + hw->mac.type = ixgbe_mac_82599EB; + } + + ret_val = ixgbe_init_shared_code(hw); + if (hw->device_id == IXGBE_DEV_ID_82599_BYPASS) { + hw->mac.ops.get_media_type = &ixgbe_bypass_get_media_type; + ixgbe_init_mac_link_ops_82599(hw); + } + + return ret_val; +} + + s32 ixgbe_bypass_init_hw(struct ixgbe_hw *hw) { -- 1.7.0.7