Move some macro from ice_switch.c to ice_switch.h. Currently this
is only required by kernel driver, DPDK just to sync the code.

Signed-off-by: Xiao Zhang <xiao.zh...@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell...@intel.com>
Signed-off-by: Qi Zhang <qi.z.zh...@intel.com>
---
 drivers/net/ice/base/ice_switch.c | 22 ----------------------
 drivers/net/ice/base/ice_switch.h | 22 ++++++++++++++++++++++
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/net/ice/base/ice_switch.c 
b/drivers/net/ice/base/ice_switch.c
index 83fb40f7a..ff479cdd2 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -29,32 +29,10 @@
  *     In case of Ether type filter it is treated as header without VLAN tag
  *     and byte 12 and 13 is used to program a given Ether type instead
  */
-#define DUMMY_ETH_HDR_LEN              16
 static const u8 dummy_eth_header[DUMMY_ETH_HDR_LEN] = { 0x2, 0, 0, 0, 0, 0,
                                                        0x2, 0, 0, 0, 0, 0,
                                                        0x81, 0, 0, 0};
 
-#define ICE_SW_RULE_RX_TX_ETH_HDR_SIZE \
-       (sizeof(struct ice_aqc_sw_rules_elem) - \
-        sizeof(((struct ice_aqc_sw_rules_elem *)0)->pdata) + \
-        sizeof(struct ice_sw_rule_lkup_rx_tx) + DUMMY_ETH_HDR_LEN - 1)
-#define ICE_SW_RULE_RX_TX_NO_HDR_SIZE \
-       (sizeof(struct ice_aqc_sw_rules_elem) - \
-        sizeof(((struct ice_aqc_sw_rules_elem *)0)->pdata) + \
-        sizeof(struct ice_sw_rule_lkup_rx_tx) - 1)
-#define ICE_SW_RULE_LG_ACT_SIZE(n) \
-       (sizeof(struct ice_aqc_sw_rules_elem) - \
-        sizeof(((struct ice_aqc_sw_rules_elem *)0)->pdata) + \
-        sizeof(struct ice_sw_rule_lg_act) - \
-        sizeof(((struct ice_sw_rule_lg_act *)0)->act) + \
-        ((n) * sizeof(((struct ice_sw_rule_lg_act *)0)->act)))
-#define ICE_SW_RULE_VSI_LIST_SIZE(n) \
-       (sizeof(struct ice_aqc_sw_rules_elem) - \
-        sizeof(((struct ice_aqc_sw_rules_elem *)0)->pdata) + \
-        sizeof(struct ice_sw_rule_vsi_list) - \
-        sizeof(((struct ice_sw_rule_vsi_list *)0)->vsi) + \
-        ((n) * sizeof(((struct ice_sw_rule_vsi_list *)0)->vsi)))
-
 struct ice_dummy_pkt_offsets {
        enum ice_protocol_type type;
        u16 offset; /* ICE_PROTOCOL_LAST indicates end of list */
diff --git a/drivers/net/ice/base/ice_switch.h 
b/drivers/net/ice/base/ice_switch.h
index 30f3746dc..cf9f6fd73 100644
--- a/drivers/net/ice/base/ice_switch.h
+++ b/drivers/net/ice/base/ice_switch.h
@@ -20,6 +20,28 @@
 #define ICE_PROFID_IPV6_AH             74
 #define ICE_PROFID_MAC_IPV6_L2TPV3     78
 
+#define DUMMY_ETH_HDR_LEN              16
+#define ICE_SW_RULE_RX_TX_ETH_HDR_SIZE \
+       (sizeof(struct ice_aqc_sw_rules_elem) - \
+        sizeof(((struct ice_aqc_sw_rules_elem *)0)->pdata) + \
+        sizeof(struct ice_sw_rule_lkup_rx_tx) + DUMMY_ETH_HDR_LEN - 1)
+#define ICE_SW_RULE_RX_TX_NO_HDR_SIZE \
+       (sizeof(struct ice_aqc_sw_rules_elem) - \
+        sizeof(((struct ice_aqc_sw_rules_elem *)0)->pdata) + \
+        sizeof(struct ice_sw_rule_lkup_rx_tx) - 1)
+#define ICE_SW_RULE_LG_ACT_SIZE(n) \
+       (sizeof(struct ice_aqc_sw_rules_elem) - \
+        sizeof(((struct ice_aqc_sw_rules_elem *)0)->pdata) + \
+        sizeof(struct ice_sw_rule_lg_act) - \
+        sizeof(((struct ice_sw_rule_lg_act *)0)->act) + \
+        ((n) * sizeof(((struct ice_sw_rule_lg_act *)0)->act)))
+#define ICE_SW_RULE_VSI_LIST_SIZE(n) \
+       (sizeof(struct ice_aqc_sw_rules_elem) - \
+        sizeof(((struct ice_aqc_sw_rules_elem *)0)->pdata) + \
+        sizeof(struct ice_sw_rule_vsi_list) - \
+        sizeof(((struct ice_sw_rule_vsi_list *)0)->vsi) + \
+        ((n) * sizeof(((struct ice_sw_rule_vsi_list *)0)->vsi)))
+
 /* Worst case buffer length for ice_aqc_opc_get_res_alloc */
 #define ICE_MAX_RES_TYPES 0x80
 #define ICE_AQ_GET_RES_ALLOC_BUF_LEN \
-- 
2.13.6

Reply via email to