Refactor 'nfp_flower_flow' module, move some macro into the header file in order to prepare for flow trace points.
Signed-off-by: Chaoyong He <chaoyong...@corigine.com> Reviewed-by: Long Wu <long...@corigine.com> Reviewed-by: Peng Zhang <peng.zh...@corigine.com> --- drivers/net/nfp/flower/nfp_flower_flow.c | 46 ------------------------ drivers/net/nfp/flower/nfp_flower_flow.h | 46 ++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower_flow.c b/drivers/net/nfp/flower/nfp_flower_flow.c index 8aafbe4c86..9f410515e6 100644 --- a/drivers/net/nfp/flower/nfp_flower_flow.c +++ b/drivers/net/nfp/flower/nfp_flower_flow.c @@ -16,21 +16,6 @@ #include "nfp_logs.h" #include "nfp_mtr.h" -#define NFP_FLOWER_LAYER_EXT_META RTE_BIT32(0) -#define NFP_FLOWER_LAYER_PORT RTE_BIT32(1) -#define NFP_FLOWER_LAYER_MAC RTE_BIT32(2) -#define NFP_FLOWER_LAYER_TP RTE_BIT32(3) -#define NFP_FLOWER_LAYER_IPV4 RTE_BIT32(4) -#define NFP_FLOWER_LAYER_IPV6 RTE_BIT32(5) -#define NFP_FLOWER_LAYER_CT RTE_BIT32(6) -#define NFP_FLOWER_LAYER_VXLAN RTE_BIT32(7) - -#define NFP_FLOWER_LAYER2_GRE RTE_BIT32(0) -#define NFP_FLOWER_LAYER2_QINQ RTE_BIT32(4) -#define NFP_FLOWER_LAYER2_GENEVE RTE_BIT32(5) -#define NFP_FLOWER_LAYER2_GENEVE_OP RTE_BIT32(6) -#define NFP_FLOWER_LAYER2_TUN_IPV6 RTE_BIT32(7) - /* Compressed HW representation of TCP Flags */ #define NFP_FL_TCP_FLAG_FIN RTE_BIT32(0) #define NFP_FL_TCP_FLAG_SYN RTE_BIT32(1) @@ -55,37 +40,6 @@ /* GRE Tunnel flags */ #define NFP_FL_GRE_FLAG_KEY (1 << 2) -/* Action opcodes */ -#define NFP_FL_ACTION_OPCODE_OUTPUT 0 -#define NFP_FL_ACTION_OPCODE_PUSH_VLAN 1 -#define NFP_FL_ACTION_OPCODE_POP_VLAN 2 -#define NFP_FL_ACTION_OPCODE_PUSH_MPLS 3 -#define NFP_FL_ACTION_OPCODE_POP_MPLS 4 -#define NFP_FL_ACTION_OPCODE_USERSPACE 5 -#define NFP_FL_ACTION_OPCODE_SET_TUNNEL 6 -#define NFP_FL_ACTION_OPCODE_SET_ETHERNET 7 -#define NFP_FL_ACTION_OPCODE_SET_MPLS 8 -#define NFP_FL_ACTION_OPCODE_SET_IPV4_ADDRS 9 -#define NFP_FL_ACTION_OPCODE_SET_IPV4_TTL_TOS 10 -#define NFP_FL_ACTION_OPCODE_SET_IPV6_SRC 11 -#define NFP_FL_ACTION_OPCODE_SET_IPV6_DST 12 -#define NFP_FL_ACTION_OPCODE_SET_IPV6_TC_HL_FL 13 -#define NFP_FL_ACTION_OPCODE_SET_UDP 14 -#define NFP_FL_ACTION_OPCODE_SET_TCP 15 -#define NFP_FL_ACTION_OPCODE_PRE_LAG 16 -#define NFP_FL_ACTION_OPCODE_PRE_TUNNEL 17 -#define NFP_FL_ACTION_OPCODE_PRE_GS 18 -#define NFP_FL_ACTION_OPCODE_GS 19 -#define NFP_FL_ACTION_OPCODE_PUSH_NSH 20 -#define NFP_FL_ACTION_OPCODE_POP_NSH 21 -#define NFP_FL_ACTION_OPCODE_SET_QUEUE 22 -#define NFP_FL_ACTION_OPCODE_CONNTRACK 23 -#define NFP_FL_ACTION_OPCODE_METER 24 -#define NFP_FL_ACTION_OPCODE_CT_NAT_EXT 25 -#define NFP_FL_ACTION_OPCODE_PUSH_GENEVE 26 -#define NFP_FL_ACTION_OPCODE_SET_PARTIAL 27 -#define NFP_FL_ACTION_OPCODE_NUM 32 - #define NFP_FL_OUT_FLAGS_LAST RTE_BIT32(15) /* Tunnel ports */ diff --git a/drivers/net/nfp/flower/nfp_flower_flow.h b/drivers/net/nfp/flower/nfp_flower_flow.h index f54ad6cf55..c1c8014699 100644 --- a/drivers/net/nfp/flower/nfp_flower_flow.h +++ b/drivers/net/nfp/flower/nfp_flower_flow.h @@ -9,6 +9,52 @@ #include "../nfp_net_common.h" #include "nfp_flower.h" +#define NFP_FLOWER_LAYER_EXT_META RTE_BIT32(0) +#define NFP_FLOWER_LAYER_PORT RTE_BIT32(1) +#define NFP_FLOWER_LAYER_MAC RTE_BIT32(2) +#define NFP_FLOWER_LAYER_TP RTE_BIT32(3) +#define NFP_FLOWER_LAYER_IPV4 RTE_BIT32(4) +#define NFP_FLOWER_LAYER_IPV6 RTE_BIT32(5) +#define NFP_FLOWER_LAYER_CT RTE_BIT32(6) +#define NFP_FLOWER_LAYER_VXLAN RTE_BIT32(7) + +#define NFP_FLOWER_LAYER2_GRE RTE_BIT32(0) +#define NFP_FLOWER_LAYER2_QINQ RTE_BIT32(4) +#define NFP_FLOWER_LAYER2_GENEVE RTE_BIT32(5) +#define NFP_FLOWER_LAYER2_GENEVE_OP RTE_BIT32(6) +#define NFP_FLOWER_LAYER2_TUN_IPV6 RTE_BIT32(7) + +/* Action opcodes */ +#define NFP_FL_ACTION_OPCODE_OUTPUT 0 +#define NFP_FL_ACTION_OPCODE_PUSH_VLAN 1 +#define NFP_FL_ACTION_OPCODE_POP_VLAN 2 +#define NFP_FL_ACTION_OPCODE_PUSH_MPLS 3 +#define NFP_FL_ACTION_OPCODE_POP_MPLS 4 +#define NFP_FL_ACTION_OPCODE_USERSPACE 5 +#define NFP_FL_ACTION_OPCODE_SET_TUNNEL 6 +#define NFP_FL_ACTION_OPCODE_SET_ETHERNET 7 +#define NFP_FL_ACTION_OPCODE_SET_MPLS 8 +#define NFP_FL_ACTION_OPCODE_SET_IPV4_ADDRS 9 +#define NFP_FL_ACTION_OPCODE_SET_IPV4_TTL_TOS 10 +#define NFP_FL_ACTION_OPCODE_SET_IPV6_SRC 11 +#define NFP_FL_ACTION_OPCODE_SET_IPV6_DST 12 +#define NFP_FL_ACTION_OPCODE_SET_IPV6_TC_HL_FL 13 +#define NFP_FL_ACTION_OPCODE_SET_UDP 14 +#define NFP_FL_ACTION_OPCODE_SET_TCP 15 +#define NFP_FL_ACTION_OPCODE_PRE_LAG 16 +#define NFP_FL_ACTION_OPCODE_PRE_TUNNEL 17 +#define NFP_FL_ACTION_OPCODE_PRE_GS 18 +#define NFP_FL_ACTION_OPCODE_GS 19 +#define NFP_FL_ACTION_OPCODE_PUSH_NSH 20 +#define NFP_FL_ACTION_OPCODE_POP_NSH 21 +#define NFP_FL_ACTION_OPCODE_SET_QUEUE 22 +#define NFP_FL_ACTION_OPCODE_CONNTRACK 23 +#define NFP_FL_ACTION_OPCODE_METER 24 +#define NFP_FL_ACTION_OPCODE_CT_NAT_EXT 25 +#define NFP_FL_ACTION_OPCODE_PUSH_GENEVE 26 +#define NFP_FL_ACTION_OPCODE_SET_PARTIAL 27 +#define NFP_FL_ACTION_OPCODE_NUM 32 + /* The firmware expects lengths in units of long words */ #define NFP_FL_LW_SIZ 2 -- 2.39.1