From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Chaoyong He <chaoyong.he@corigine.com>,
Long Wu <long.wu@corigine.com>,
Peng Zhang <peng.zhang@corigine.com>
Subject: [PATCH 4/7] net/nfp: refactor to prepare for add flow trace point
Date: Wed, 19 Jun 2024 18:07:51 +0800 [thread overview]
Message-ID: <20240619100754.3480077-5-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20240619100754.3480077-1-chaoyong.he@corigine.com>
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.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@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
next prev parent reply other threads:[~2024-06-19 10:08 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-19 10:07 [PATCH 0/7] add trace support for control message Chaoyong He
2024-06-19 10:07 ` [PATCH 1/7] net/nfp: add trace points about port Chaoyong He
2024-06-19 10:07 ` [PATCH 2/7] net/nfp: add trace point about tunnel Chaoyong He
2024-06-19 10:07 ` [PATCH 3/7] net/nfp: add trace point about Qos Chaoyong He
2024-06-19 10:07 ` Chaoyong He [this message]
2024-06-19 10:07 ` [PATCH 5/7] net/nfp: add trace point about flow rule Chaoyong He
2024-06-19 10:07 ` [PATCH 6/7] net/nfp: add trace point about flow rule pattern Chaoyong He
2024-06-19 10:07 ` [PATCH 7/7] net/nfp: add trace point about flow rule action Chaoyong He
2024-07-07 22:43 ` [PATCH 0/7] add trace support for control message Ferruh Yigit
2024-07-08 1:42 ` Chaoyong He
2024-07-08 2:45 ` [PATCH v2 " Chaoyong He
2024-07-08 2:45 ` [PATCH v2 1/7] net/nfp: add trace points about port Chaoyong He
2024-07-08 2:45 ` [PATCH v2 2/7] net/nfp: add trace point about tunnel Chaoyong He
2024-07-08 2:45 ` [PATCH v2 3/7] net/nfp: add trace point about Qos Chaoyong He
2024-07-08 2:45 ` [PATCH v2 4/7] net/nfp: refactor to prepare for add flow trace point Chaoyong He
2024-07-08 2:45 ` [PATCH v2 5/7] net/nfp: add trace point about flow rule Chaoyong He
2024-07-08 2:45 ` [PATCH v2 6/7] net/nfp: add trace point about flow rule pattern Chaoyong He
2024-07-08 2:45 ` [PATCH v2 7/7] net/nfp: add trace point about flow rule action Chaoyong He
2024-07-08 11:45 ` [PATCH v2 0/7] add trace support for control message Ferruh Yigit
2024-07-09 1:15 ` Chaoyong He
2024-07-09 3:16 ` Chaoyong He
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240619100754.3480077-5-chaoyong.he@corigine.com \
--to=chaoyong.he@corigine.com \
--cc=dev@dpdk.org \
--cc=long.wu@corigine.com \
--cc=oss-drivers@corigine.com \
--cc=peng.zhang@corigine.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).