DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] app/testpmd: register metadata dynfield on modify field
@ 2022-03-01 11:51 Dariusz Sosnowski
  2022-03-03 12:20 ` Ferruh Yigit
  0 siblings, 1 reply; 4+ messages in thread
From: Dariusz Sosnowski @ 2022-03-01 11:51 UTC (permalink / raw)
  To: Ori Kam, Xiaoyun Li, Aman Singh, Yuying Zhang; +Cc: dev, Viacheslav Ovsiienko

This patch adds implicit registration of metadata dynamic field and flag
whenever a modify_field action with META as source and/or destination
field is used.

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 app/test-pmd/cmdline_flow.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 4f7a9f17f9..dd38a635b0 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -8347,6 +8347,7 @@ parse_vc_modify_field_id(struct context *ctx, const struct token *token,
 {
 	struct rte_flow_action_modify_field *action_modify_field;
 	unsigned int i;
+	int ret;
 
 	(void)token;
 	(void)buf;
@@ -8362,9 +8363,15 @@ parse_vc_modify_field_id(struct context *ctx, const struct token *token,
 	if (!ctx->object)
 		return len;
 	action_modify_field = ctx->object;
-	if (ctx->curr == ACTION_MODIFY_FIELD_DST_TYPE_VALUE)
+	if (ctx->curr == ACTION_MODIFY_FIELD_DST_TYPE_VALUE) {
 		action_modify_field->dst.field = (enum rte_flow_field_id)i;
-	else
+		if (action_modify_field->dst.field == RTE_FLOW_FIELD_META) {
+			ret = rte_flow_dynf_metadata_register();
+			if (ret < 0)
+				return -1;
+		}
+
+	} else
 		action_modify_field->src.field = (enum rte_flow_field_id)i;
 	return len;
 }
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-14 20:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-01 11:51 [PATCH] app/testpmd: register metadata dynfield on modify field Dariusz Sosnowski
2022-03-03 12:20 ` Ferruh Yigit
2022-03-09 11:50   ` Dariusz Sosnowski
2022-03-14 20:42     ` Thomas Monjalon

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