From: Gregory Etelson <getelson@nvidia.com>
To: <dev@dpdk.org>
Cc: <getelson@nvidia.com>, <matan@nvidia.com>, <rasland@nvidia.com>,
<stable@dpdk.org>, Ori Kam <orika@nvidia.com>,
Aman Singh <aman.deep.singh@intel.com>,
Yuying Zhang <yuying.zhang@intel.com>,
"Alexander Kozyrev" <akozyrev@nvidia.com>
Subject: [PATCH] app/testpmd: fix template action mask parsing
Date: Mon, 20 Feb 2023 21:18:24 +0200 [thread overview]
Message-ID: <20230220191824.2393-1-getelson@nvidia.com> (raw)
In the flow template API, non-masked action must set its configuration
to NULL.
If flow action defined a configuration structure, then
testpmd *always* provided the action with configuration buffer.
Testpmd also implicitly assigned 0 to all action configuration
members that were not mentioned in a flow rule.
As the result, testpmd configured non-masked flow action as masked
with all parameters set to 0.
The patch fixes testpmd parsing. If flow action token is followed
by the actions separator character `/` in template masks section,
testpmd will not assign action configuration buffer.
Fixes: ecdc927b99f2 ("app/testpmd: add async flow create/destroy operations")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
---
app/test-pmd/cmdline_flow.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index f1991a5a9a..134b316c18 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -7490,6 +7490,14 @@ parse_vc(struct context *ctx, const struct token *token,
out->args.vc.actions + out->args.vc.actions_n;
data_size = priv->size; /* configuration */
+ if (out->args.vc.masks) {
+ while (!isspace(*str))
+ str++; /* skip current token */
+ while (isspace(*str))
+ str++; /* skip blanks */
+ if (str[0] == '/')
+ data_size = 0;
+ }
data = (void *)RTE_ALIGN_FLOOR((uintptr_t)
(out->args.vc.data - data_size),
sizeof(double));
--
2.34.1
reply other threads:[~2023-02-20 19:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20230220191824.2393-1-getelson@nvidia.com \
--to=getelson@nvidia.com \
--cc=akozyrev@nvidia.com \
--cc=aman.deep.singh@intel.com \
--cc=dev@dpdk.org \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=rasland@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).