net/ice/base: move some macros
authorQi Zhang <qi.z.zhang@intel.com>
Mon, 30 Mar 2020 11:45:34 +0000 (19:45 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 Apr 2020 11:57:05 +0000 (13:57 +0200)
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.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
drivers/net/ice/base/ice_switch.c
drivers/net/ice/base/ice_switch.h

index 83fb40f..ff479cd 100644 (file)
  *     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 */
index 30f3746..cf9f6fd 100644 (file)
 #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 \