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>, <akozyrev@nvidia.com>, <stable@dpdk.org>
Subject: [PATCH] app/testpmd: fix the rule number parsing
Date: Fri, 30 Jun 2023 16:30:02 +0300	[thread overview]
Message-ID: <20230630133002.435747-1-bingz@nvidia.com> (raw)

When creating a template table, the object pointer of the
command line "struct context" was set with an offset from the
original out buffer if there is a template ID.

If the "rules_number" is specified after the template IDs, it
couldn't be set and passed to the API correctly. With this commit,
the pointer is reset before pasring the "rules_number" field.

Fixes: c4b38873346b ("app/testpmd: add flow table management")
Cc: akozyrev@nvidia.com
Cc: stable@dpdk.org

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

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 5771281125..bd626e2347 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -3369,6 +3369,7 @@ static const struct token token_list[] = {
 			     NEXT_ENTRY(COMMON_UNSIGNED)),
 		.args = ARGS(ARGS_ENTRY(struct buffer,
 					args.table.attr.nb_flows)),
+		.call = parse_table,
 	},
 	[TABLE_PATTERN_TEMPLATE] = {
 		.name = "pattern_template",
@@ -10157,6 +10158,11 @@ parse_table(struct context *ctx, const struct token *token,
 			return -1;
 		out->args.table.attr.specialize = RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_VPORT_ORIG;
 		return len;
+	case TABLE_RULES_NUMBER:
+		ctx->objdata = 0;
+		ctx->object = out;
+		ctx->objmask = NULL;
+		return len;
 	default:
 		return -1;
 	}
-- 
2.34.1


             reply	other threads:[~2023-06-30 13:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-30 13:30 Bing Zhao [this message]
2023-07-10  7:39 ` Ori Kam
2023-07-10 10:11   ` 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=20230630133002.435747-1-bingz@nvidia.com \
    --to=bingz@nvidia.com \
    --cc=akozyrev@nvidia.com \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=orika@nvidia.com \
    --cc=stable@dpdk.org \
    --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).