DPDK patches and discussions
 help / color / mirror / Atom feed
From: Alexander Kozyrev <akozyrev@nvidia.com>
To: <dev@dpdk.org>
Cc: <dsosnowski@nvidia.com>, <orika@nvidia.com>,
	<thomas@monjalon.net>, <matan@nvidia.com>, <ferruh.yigit@amd.com>,
	<stephen@networkplumber.org>
Subject: [PATCH 6/6] app/testpmd: add jump to table index action
Date: Thu, 19 Sep 2024 03:48:13 +0300	[thread overview]
Message-ID: <20240919004813.3158356-7-akozyrev@nvidia.com> (raw)
In-Reply-To: <20240919004813.3158356-1-akozyrev@nvidia.com>

Add a new command line options to create the
RTE_FLOW_ACTION_TYPE_JUMP_TO_TABLE_INDEX action
from the testpmd command line.

flow queue 0 create 0 template_table 0 pattern_template 0
  actions_template 0 postpone no pattern eth / end
  actions jump_to_table_index table 0x166f9ce00 index 5 / end

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
---
 app/test-pmd/cmdline_flow.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 855273365e..b7bcf18311 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -785,6 +785,9 @@ enum index {
 	ACTION_IPV6_EXT_PUSH_INDEX_VALUE,
 	ACTION_NAT64,
 	ACTION_NAT64_MODE,
+	ACTION_JUMP_TO_TABLE_INDEX,
+	ACTION_JUMP_TO_TABLE_INDEX_TABLE,
+	ACTION_JUMP_TO_TABLE_INDEX_INDEX,
 };
 
 /** Maximum size for pattern in struct rte_flow_item_raw. */
@@ -2328,6 +2331,7 @@ static const enum index next_action[] = {
 	ACTION_IPV6_EXT_REMOVE,
 	ACTION_IPV6_EXT_PUSH,
 	ACTION_NAT64,
+	ACTION_JUMP_TO_TABLE_INDEX,
 	ZERO,
 };
 
@@ -2688,6 +2692,13 @@ static const enum index next_hash_encap_dest_subcmd[] = {
 	ZERO,
 };
 
+static const enum index action_jump_to_table_index[] = {
+	ACTION_JUMP_TO_TABLE_INDEX_TABLE,
+	ACTION_JUMP_TO_TABLE_INDEX_INDEX,
+	ACTION_NEXT,
+	ZERO,
+};
+
 static int parse_set_raw_encap_decap(struct context *, const struct token *,
 				     const char *, unsigned int,
 				     void *, unsigned int);
@@ -7608,6 +7619,29 @@ static const struct token token_list[] = {
 		.args = ARGS(ARGS_ENTRY(struct rte_flow_action_nat64, type)),
 		.call = parse_vc_conf,
 	},
+	[ACTION_JUMP_TO_TABLE_INDEX] = {
+		.name = "jump_to_table_index",
+		.help = "Jump to table index",
+		.priv = PRIV_ACTION(JUMP_TO_TABLE_INDEX,
+				    sizeof(struct rte_flow_action_jump_to_table_index)),
+		.next = NEXT(action_jump_to_table_index),
+		.call = parse_vc,
+	},
+	[ACTION_JUMP_TO_TABLE_INDEX_TABLE] = {
+		.name = "table",
+		.help = "table to redirect traffic to",
+		.next = NEXT(action_jump_to_table_index, NEXT_ENTRY(COMMON_UNSIGNED)),
+		.args = ARGS(ARGS_ENTRY(struct rte_flow_action_jump_to_table_index, table)),
+		.call = parse_vc_conf,
+	},
+	[ACTION_JUMP_TO_TABLE_INDEX_INDEX] = {
+		.name = "index",
+		.help = "rule index to redirect traffic to",
+		.next = NEXT(action_jump_to_table_index, NEXT_ENTRY(COMMON_UNSIGNED)),
+		.args = ARGS(ARGS_ENTRY(struct rte_flow_action_jump_to_table_index, index)),
+		.call = parse_vc_conf,
+	},
+
 	/* Top level command. */
 	[SET] = {
 		.name = "set",
-- 
2.18.2


      parent reply	other threads:[~2024-09-19  0:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-19  0:48 [PATCH 0/6] ethdev: jump to table support Alexander Kozyrev
2024-09-19  0:48 ` [PATCH 1/6] ethdev: add insertion by index with pattern Alexander Kozyrev
2024-09-19  0:48 ` [PATCH 2/6] app/testpmd: add index with pattern insertion type Alexander Kozyrev
2024-09-19  0:48 ` [PATCH 3/6] ethdev: add flow rule insertion by index with pattern Alexander Kozyrev
2024-09-19  0:48 ` [PATCH 4/6] app/testpmd: add insertion by index with pattern option Alexander Kozyrev
2024-09-19  0:48 ` [PATCH 5/6] ethdev: add jump to table index action Alexander Kozyrev
2024-09-19  0:48 ` Alexander Kozyrev [this message]

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=20240919004813.3158356-7-akozyrev@nvidia.com \
    --to=akozyrev@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=ferruh.yigit@amd.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /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).