All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dariusz Sosnowski <dsosnowski@nvidia.com>
To: Ori Kam <orika@nvidia.com>, Xiaoyun Li <xiaoyun.li@intel.com>,
	Aman Singh <aman.deep.singh@intel.com>,
	Yuying Zhang <yuying.zhang@intel.com>
Cc: <dev@dpdk.org>, Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Subject: [PATCH] app/testpmd: register metadata dynfield on modify field
Date: Tue, 1 Mar 2022 11:51:13 +0000	[thread overview]
Message-ID: <20220301115113.306497-1-dsosnowski@nvidia.com> (raw)

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


             reply	other threads:[~2022-03-01 11:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01 11:51 Dariusz Sosnowski [this message]
2022-03-03 12:20 ` [PATCH] app/testpmd: register metadata dynfield on modify field Ferruh Yigit
2022-03-09 11:50   ` Dariusz Sosnowski
2022-03-14 20:42     ` Thomas Monjalon

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=20220301115113.306497-1-dsosnowski@nvidia.com \
    --to=dsosnowski@nvidia.com \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=orika@nvidia.com \
    --cc=viacheslavo@nvidia.com \
    --cc=xiaoyun.li@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.