From: Xiaoyu Min <jackmin@mellanox.com>
To: dev@dpdk.org
Cc: shahafs@mellanox.com, adrien.mazarguil@6wind.com,
xuemingl@mellanox.com, thomas@monjalon.net,
ferruh.yigit@intel.com, arybchenko@solarflare.com
Subject: [dpdk-dev] [PATCH v2] ethdev: add generic MAC address rewrite actions
Date: Thu, 30 Aug 2018 14:54:12 +0800 [thread overview]
Message-ID: <20180830065412.26680-1-jackmin@mellanox.com> (raw)
In-Reply-To: <DB6PR0501MB20235BFE300BA95C00FBF539CC270@DB6PR0501MB2023.eurprd05.prod.outlook.com>
There is a need to offload rewrite outermost MAC address for both
destination and source from the matched flow
The proposed actions could make above easily achieved
Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
---
v2:
- Updated description about the MAC address is the outermost one
lib/librte_ethdev/rte_flow.h | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index f8ba71cdb..c9cce1049 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -1505,6 +1505,26 @@ enum rte_flow_action_type {
* error.
*/
RTE_FLOW_ACTION_TYPE_NVGRE_DECAP,
+
+ /**
+ * Set outermost source MAC address from matched flow.
+ *
+ * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_ETH,
+ * the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error.
+ *
+ * See struct rte_flow_action_set_mac.
+ */
+ RTE_FLOW_ACTION_TYPE_SET_MAC_SRC,
+
+ /**
+ * Set outermost destination MAC address from matched flow.
+ *
+ * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_ETH,
+ * the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error.
+ *
+ * See struct rte_flow_action_set_mac.
+ */
+ RTE_FLOW_ACTION_TYPE_SET_MAC_DST,
};
/**
@@ -1868,6 +1888,18 @@ struct rte_flow_action_nvgre_encap {
struct rte_flow_item *definition;
};
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ACTION_TYPE_SET_MAC
+ *
+ * Set outermost MAC address from the matched flow
+ */
+struct rte_flow_action_set_mac {
+ uint8_t mac_addr[ETHER_ADDR_LEN];
+};
+
/*
* Definition of a single action.
*
--
2.17.1
next prev parent reply other threads:[~2018-08-30 6:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-07 14:20 [dpdk-dev] [RFC] " Jack Min
2018-08-13 10:08 ` Rahul Lakkireddy
2018-08-14 9:15 ` Jack MIN
2018-08-21 8:14 ` Rahul Lakkireddy
2018-08-23 2:15 ` Jack MIN
2018-08-23 8:13 ` Rahul Lakkireddy
2018-08-23 13:58 ` Ferruh Yigit
2018-08-28 10:15 ` Andrew Rybchenko
2018-08-29 3:25 ` Jack MIN
2018-08-30 6:54 ` Xiaoyu Min [this message]
2018-08-30 7:40 ` [dpdk-dev] [PATCH v2] " Jack MIN
2018-08-30 8:00 ` [dpdk-dev] [RFC " Xiaoyu Min
2018-08-31 8:33 ` Andrew Rybchenko
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=20180830065412.26680-1-jackmin@mellanox.com \
--to=jackmin@mellanox.com \
--cc=adrien.mazarguil@6wind.com \
--cc=arybchenko@solarflare.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=shahafs@mellanox.com \
--cc=thomas@monjalon.net \
--cc=xuemingl@mellanox.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 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).