From: <kirankumark@marvell.com>
To: Ori Kam <orika@nvidia.com>,
Aman Singh <aman.deep.singh@intel.com>,
"Thomas Monjalon" <thomas@monjalon.net>,
Ferruh Yigit <ferruh.yigit@amd.com>,
"Andrew Rybchenko" <andrew.rybchenko@oktetlabs.ru>
Cc: <dev@dpdk.org>, Kiran Kumar K <kirankumark@marvell.com>
Subject: [PATCH v2] ethdev: add support for flow action pop E-tag
Date: Tue, 22 Apr 2025 11:23:30 +0530 [thread overview]
Message-ID: <20250422055331.1270825-1-kirankumark@marvell.com> (raw)
In-Reply-To: <20250421115134.841719-1-kirankumark@marvell.com>
From: Kiran Kumar K <kirankumark@marvell.com>
Add support for the following OpenFlow-defined action.
RTE_FLOW_ACTION_TYPE_OF_POP_ETAG: Pop E-tag from the packet.
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
---
*V2 Changes:
- Address comment related to order of enum values
app/test-pmd/cmdline_flow.c | 9 +++++++++
lib/ethdev/rte_flow.c | 1 +
lib/ethdev/rte_flow.h | 10 +++++++++-
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 998527590f..b486bfd348 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -651,6 +651,7 @@ enum index {
ACTION_METER_COLOR_MODE,
ACTION_METER_STATE,
ACTION_OF_DEC_NW_TTL,
+ ACTION_OF_POP_ETAG,
ACTION_OF_POP_VLAN,
ACTION_OF_PUSH_VLAN,
ACTION_OF_PUSH_VLAN_ETHERTYPE,
@@ -2274,6 +2275,7 @@ static const enum index next_action[] = {
ACTION_METER_MARK,
ACTION_METER_MARK_CONF,
ACTION_OF_DEC_NW_TTL,
+ ACTION_OF_POP_ETAG,
ACTION_OF_POP_VLAN,
ACTION_OF_PUSH_VLAN,
ACTION_OF_SET_VLAN_VID,
@@ -6925,6 +6927,13 @@ static const struct token token_list[] = {
.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
.call = parse_vc,
},
+ [ACTION_OF_POP_ETAG] = {
+ .name = "of_pop_etag",
+ .help = "OpenFlow's OFPAT_POP_ETAG",
+ .priv = PRIV_ACTION(OF_POP_ETAG, 0),
+ .next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
+ .call = parse_vc,
+ },
[ACTION_OF_POP_VLAN] = {
.name = "of_pop_vlan",
.help = "OpenFlow's OFPAT_POP_VLAN",
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 9f8d8f3dc2..3d227f3bc5 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -212,6 +212,7 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = {
MK_FLOW_ACTION(METER, sizeof(struct rte_flow_action_meter)),
MK_FLOW_ACTION(SECURITY, sizeof(struct rte_flow_action_security)),
MK_FLOW_ACTION(OF_DEC_NW_TTL, 0),
+ MK_FLOW_ACTION(OF_POP_ETAG, 0),
MK_FLOW_ACTION(OF_POP_VLAN, 0),
MK_FLOW_ACTION(OF_PUSH_VLAN,
sizeof(struct rte_flow_action_of_push_vlan)),
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 3d2ccdeb92..fb4f4bf9b7 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -3201,7 +3201,7 @@ enum rte_flow_action_type {
* @see struct rte_flow_query_quota
* @see struct rte_flow_update_quota
*/
- RTE_FLOW_ACTION_TYPE_QUOTA,
+ RTE_FLOW_ACTION_TYPE_QUOTA,
/**
* Skip congestion management configuration.
@@ -3263,6 +3263,14 @@ enum rte_flow_action_type {
* @see struct rte_flow_action_jump_to_table_index.
*/
RTE_FLOW_ACTION_TYPE_JUMP_TO_TABLE_INDEX,
+
+ /**
+ * Implements POP_ETAG ("pop the outer 802.1BR Etag") as defined
+ * by the OpenFlow Switch Specification.
+ *
+ * No associated configuration structure.
+ */
+ RTE_FLOW_ACTION_TYPE_OF_POP_ETAG,
};
/**
--
2.48.1
next prev parent reply other threads:[~2025-04-22 5:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-21 11:51 [PATCH] " kirankumark
2025-04-21 14:51 ` Stephen Hemminger
2025-04-22 5:53 ` kirankumark [this message]
2025-04-23 0:03 ` [PATCH v2] " Thomas Monjalon
2025-04-22 5:47 kirankumark
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=20250422055331.1270825-1-kirankumark@marvell.com \
--to=kirankumark@marvell.com \
--cc=aman.deep.singh@intel.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=orika@nvidia.com \
--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).