DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bing Zhao <bingz@nvidia.com>
To: <orika@nvidia.com>, <aman.deep.singh@intel.com>,
	<yuying.zhang@intel.com>
Cc: <dev@dpdk.org>
Subject: [PATCH v2] app/testpmd: add IP length field matching
Date: Sat, 1 Jul 2023 12:26:32 +0300	[thread overview]
Message-ID: <20230701092632.439715-1-bingz@nvidia.com> (raw)
In-Reply-To: <20230701014721.437572-1-bingz@nvidia.com>

Added support of parsing IPv4 total length and IPv6 payload length
in the command line. The value of L3 length can be passed to the
rte_flow API for testing.

Signed-off-by: Bing Zhao <bingz@nvidia.com>
---
 app/test-pmd/cmdline_flow.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index bd626e2347..cc47d6cb80 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -313,6 +313,7 @@ enum index {
 	ITEM_IPV4,
 	ITEM_IPV4_VER_IHL,
 	ITEM_IPV4_TOS,
+	ITEM_IPV4_LENGTH,
 	ITEM_IPV4_ID,
 	ITEM_IPV4_FRAGMENT_OFFSET,
 	ITEM_IPV4_TTL,
@@ -322,6 +323,7 @@ enum index {
 	ITEM_IPV6,
 	ITEM_IPV6_TC,
 	ITEM_IPV6_FLOW,
+	ITEM_IPV6_LEN,
 	ITEM_IPV6_PROTO,
 	ITEM_IPV6_HOP,
 	ITEM_IPV6_SRC,
@@ -1604,6 +1606,7 @@ static const enum index item_vlan[] = {
 static const enum index item_ipv4[] = {
 	ITEM_IPV4_VER_IHL,
 	ITEM_IPV4_TOS,
+	ITEM_IPV4_LENGTH,
 	ITEM_IPV4_ID,
 	ITEM_IPV4_FRAGMENT_OFFSET,
 	ITEM_IPV4_TTL,
@@ -1617,6 +1620,7 @@ static const enum index item_ipv4[] = {
 static const enum index item_ipv6[] = {
 	ITEM_IPV6_TC,
 	ITEM_IPV6_FLOW,
+	ITEM_IPV6_LEN,
 	ITEM_IPV6_PROTO,
 	ITEM_IPV6_HOP,
 	ITEM_IPV6_SRC,
@@ -4229,6 +4233,14 @@ static const struct token token_list[] = {
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ipv4,
 					     hdr.type_of_service)),
 	},
+	[ITEM_IPV4_LENGTH] = {
+		.name = "length",
+		.help = "total length",
+		.next = NEXT(item_ipv4, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ipv4,
+					     hdr.total_length)),
+	},
 	[ITEM_IPV4_ID] = {
 		.name = "packet_id",
 		.help = "fragment packet id",
@@ -4302,6 +4314,14 @@ static const struct token token_list[] = {
 						  hdr.vtc_flow,
 						  "\x00\x0f\xff\xff")),
 	},
+	[ITEM_IPV6_LEN] = {
+		.name = "length",
+		.help = "payload length",
+		.next = NEXT(item_ipv6, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ipv6,
+					     hdr.payload_len)),
+	},
 	[ITEM_IPV6_PROTO] = {
 		.name = "proto",
 		.help = "protocol (next header)",
-- 
2.34.1


  reply	other threads:[~2023-07-01  9:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-01  1:47 [PATCH] app/testpmd: add IPv4 " Bing Zhao
2023-07-01  9:26 ` Bing Zhao [this message]
2023-07-06 11:38   ` [PATCH v2] app/testpmd: add IP " Ori Kam
2023-07-06 13:57     ` Ferruh Yigit

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=20230701092632.439715-1-bingz@nvidia.com \
    --to=bingz@nvidia.com \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=orika@nvidia.com \
    --cc=yuying.zhang@intel.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).