The macros used were not informative and did not add any value beyond code
golf, so remove them and make MAC type checks explicit.

Signed-off-by: Anatoly Burakov <[email protected]>
---
 drivers/net/intel/ixgbe/ixgbe_ethdev.h | 12 ------------
 drivers/net/intel/ixgbe/ixgbe_flow.c   | 20 +++++++++++++++++---
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.h 
b/drivers/net/intel/ixgbe/ixgbe_ethdev.h
index 5393c81363..55b121b15d 100644
--- a/drivers/net/intel/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.h
@@ -137,18 +137,6 @@
 #define IXGBE_MAX_FDIR_FILTER_NUM       (1024 * 32)
 #define IXGBE_MAX_L2_TN_FILTER_NUM      128
 
-#define MAC_TYPE_FILTER_SUP_EXT(type)    do {\
-       if ((type) != ixgbe_mac_82599EB && (type) != ixgbe_mac_X540)\
-               return -ENOTSUP;\
-} while (0)
-
-#define MAC_TYPE_FILTER_SUP(type)    do {\
-       if ((type) != ixgbe_mac_82599EB && (type) != ixgbe_mac_X540 &&\
-               (type) != ixgbe_mac_X550 && (type) != ixgbe_mac_X550EM_x &&\
-               (type) != ixgbe_mac_X550EM_a && (type) != ixgbe_mac_E610)\
-               return -ENOTSUP;\
-} while (0)
-
 /* Link speed for X550 auto negotiation */
 #define IXGBE_LINK_SPEED_X550_AUTONEG  (IXGBE_LINK_SPEED_100_FULL | \
                                         IXGBE_LINK_SPEED_1GB_FULL | \
diff --git a/drivers/net/intel/ixgbe/ixgbe_flow.c 
b/drivers/net/intel/ixgbe/ixgbe_flow.c
index 27d2ba1132..a1245bb906 100644
--- a/drivers/net/intel/ixgbe/ixgbe_flow.c
+++ b/drivers/net/intel/ixgbe/ixgbe_flow.c
@@ -621,7 +621,9 @@ ixgbe_parse_ntuple_filter(struct rte_eth_dev *dev,
        int ret;
        struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
-       MAC_TYPE_FILTER_SUP_EXT(hw->mac.type);
+       if (hw->mac.type != ixgbe_mac_82599EB &&
+                       hw->mac.type != ixgbe_mac_X540)
+               return -ENOTSUP;
 
        ret = cons_parse_ntuple_filter(attr, pattern, actions, filter, error);
 
@@ -861,7 +863,13 @@ ixgbe_parse_ethertype_filter(struct rte_eth_dev *dev,
        int ret;
        struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
-       MAC_TYPE_FILTER_SUP(hw->mac.type);
+       if (hw->mac.type != ixgbe_mac_82599EB &&
+                       hw->mac.type != ixgbe_mac_X540 &&
+                       hw->mac.type != ixgbe_mac_X550 &&
+                       hw->mac.type != ixgbe_mac_X550EM_x &&
+                       hw->mac.type != ixgbe_mac_X550EM_a &&
+                       hw->mac.type != ixgbe_mac_E610)
+               return -ENOTSUP;
 
        ret = cons_parse_ethertype_filter(attr, pattern,
                                        actions, filter, error);
@@ -1150,7 +1158,13 @@ ixgbe_parse_syn_filter(struct rte_eth_dev *dev,
        int ret;
        struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
-       MAC_TYPE_FILTER_SUP(hw->mac.type);
+       if (hw->mac.type != ixgbe_mac_82599EB &&
+                       hw->mac.type != ixgbe_mac_X540 &&
+                       hw->mac.type != ixgbe_mac_X550 &&
+                       hw->mac.type != ixgbe_mac_X550EM_x &&
+                       hw->mac.type != ixgbe_mac_X550EM_a &&
+                       hw->mac.type != ixgbe_mac_E610)
+               return -ENOTSUP;
 
        ret = cons_parse_syn_filter(attr, pattern,
                                        actions, filter, error);
-- 
2.47.3

Reply via email to