patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] app/testpmd: fix template action mask parsing
@ 2023-02-20 19:18 Gregory Etelson
  0 siblings, 0 replies; only message in thread
From: Gregory Etelson @ 2023-02-20 19:18 UTC (permalink / raw)
  To: dev
  Cc: getelson, matan, rasland, stable, Ori Kam, Aman Singh,
	Yuying Zhang, Alexander Kozyrev

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-20 19:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-20 19:18 [PATCH] app/testpmd: fix template action mask parsing Gregory Etelson

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).