ixgbe: rework fix of media type for bypass device
authorPablo de Lara <pablo.de.lara.guarch@intel.com>
Tue, 24 Jun 2014 14:41:29 +0000 (15:41 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 26 Jun 2014 05:16:53 +0000 (07:16 +0200)
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>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
lib/librte_pmd_ixgbe/ixgbe/ixgbe_82599.c
lib/librte_pmd_ixgbe/ixgbe_82599_bypass.c

index 93c4e35..ed97ad9 100644 (file)
@@ -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:
index 27a5f70..0f0000c 100644 (file)
@@ -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)
 {