From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by dpdk.org (Postfix) with ESMTP id EB694B0A3 for ; Wed, 25 Jun 2014 14:22:38 +0200 (CEST) Received: by mail-wi0-f180.google.com with SMTP id hi2so2384822wib.7 for ; Wed, 25 Jun 2014 05:22:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jKx4Ziepni0nBhQNdHLunMSo35MHGbFNgNzEbhFLSII=; b=HIIYBP2eMbzfPZoZp2EhNnw0xySBMU05HO5b8yiMyEWpTCJCK9l7jQkIqjUNELzwbE 1oGxYxuI/KZDHSC1Zv80rUqwQ0EptzKiD3s6eutPqAj3b+neFMmy/AbbAY8hkML3h1JY AkM36hxyv2pQOvsCo2+Tw3Gfj5G2RE3K7Y4JebB7MCO0wesUv6h8j4VoJ6ohhUSESGdU esnN6BR2M7bTueN4kmQfXzhQF8LKgXImzcVziWHPhgcpXHradGNZk6PDywoGHbayTQl0 tedxfrXgl7Kd1DT+CH3au+klewHM56CJ4IuCNNRoE2Uhj+lvAhlNZRFeQbna7Q9PP6NZ CGxw== X-Gm-Message-State: ALoCoQlARoHRz9pbvuBv/JjWuwwFJAtkJCIspJllVBbIN2/EWjFh7uzV6gI01/+XvRihZgw1CYCN X-Received: by 10.194.48.103 with SMTP id k7mr9412018wjn.68.1403698974939; Wed, 25 Jun 2014 05:22:54 -0700 (PDT) Received: from localhost.localdomain (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id w5sm53250748wif.3.2014.06.25.05.22.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Jun 2014 05:22:54 -0700 (PDT) From: Thomas Monjalon To: dev@dpdk.org Date: Wed, 25 Jun 2014 14:22:17 +0200 Message-Id: <1403698937-30407-4-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1403698937-30407-1-git-send-email-thomas.monjalon@6wind.com> References: <1403698937-30407-1-git-send-email-thomas.monjalon@6wind.com> Subject: [dpdk-dev] [PATCH 3/3] ixgbe: rework fix of media type for bypass device 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: Wed, 25 Jun 2014 12:22:39 -0000 From: Pablo de Lara This was previously solved in commit 60a70d4e042350ca (fix link status interrupt of bypass device), but this alternative fix reverts the previous one and solves the same issue without modifying the base driver (also named "shared code"). Signed-off-by: Pablo de Lara Acked-by: Konstantin Ananyev --- lib/librte_pmd_ixgbe/ixgbe/ixgbe_82599.c | 3 --- lib/librte_pmd_ixgbe/ixgbe_82599_bypass.c | 34 +++++++++++++++++++------------ 2 files changed, 21 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..0f0000c 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,27 @@ ixgbe_bypass_get_media_type(struct ixgbe_hw *hw) return (media_type); } +/* + * Wrapper around shared code (base driver) 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) { -- 2.0.0