From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 3/3] ixgbe: rework fix of media type for bypass device
Date: Wed, 25 Jun 2014 14:22:17 +0200 [thread overview]
Message-ID: <1403698937-30407-4-git-send-email-thomas.monjalon@6wind.com> (raw)
In-Reply-To: <1403698937-30407-1-git-send-email-thomas.monjalon@6wind.com>
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
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 <pablo.de.lara.guarch@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
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
next prev parent reply other threads:[~2014-06-25 12:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-25 12:22 [dpdk-dev] [PATCH 0/3] previous patches about "shared code"/"base drivers" Thomas Monjalon
2014-06-25 12:22 ` [dpdk-dev] [PATCH 1/3] i40e: explicit shared code naming as base driver Thomas Monjalon
2014-06-25 14:43 ` Chen, Jing D
2014-06-25 14:47 ` Chen, Jing D
2014-06-25 12:22 ` [dpdk-dev] [PATCH 2/3] i40e/base: ignore warning Thomas Monjalon
2014-06-25 12:22 ` Thomas Monjalon [this message]
2014-06-25 16:07 ` [dpdk-dev] [PATCH 0/3] previous patches about "shared code"/"base drivers" Richardson, Bruce
2014-06-26 12:16 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1403698937-30407-4-git-send-email-thomas.monjalon@6wind.com \
--to=thomas.monjalon@6wind.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).