[dpdk-dev] [PATCH v1 1/8] ethdev: support the mirror action for flow
SimonX Lu
simonx.lu at intel.com
Wed Oct 14 10:41:24 CEST 2020
From: Simon Lu <simonx.lu at intel.com>
Added the mirror type within rte_filter_type, and defined corresponding
action & item to support mirror in rte_flow.
Signed-off-by: Simon Lu <simonx.lu at intel.com>
---
lib/librte_ethdev/rte_eth_ctrl.h | 1 +
lib/librte_ethdev/rte_flow.c | 1 +
lib/librte_ethdev/rte_flow.h | 7 +++++++
3 files changed, 9 insertions(+)
diff --git a/lib/librte_ethdev/rte_eth_ctrl.h b/lib/librte_ethdev/rte_eth_ctrl.h
index 1416c371f..1418854e0 100644
--- a/lib/librte_ethdev/rte_eth_ctrl.h
+++ b/lib/librte_ethdev/rte_eth_ctrl.h
@@ -35,6 +35,7 @@ enum rte_filter_type {
RTE_ETH_FILTER_TUNNEL,
RTE_ETH_FILTER_FDIR,
RTE_ETH_FILTER_HASH,
+ RTE_ETH_FILTER_MIRROR,
RTE_ETH_FILTER_L2_TUNNEL,
RTE_ETH_FILTER_GENERIC,
RTE_ETH_FILTER_MAX
diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c
index 8d1b279bc..2718b9cfb 100644
--- a/lib/librte_ethdev/rte_flow.c
+++ b/lib/librte_ethdev/rte_flow.c
@@ -117,6 +117,7 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = {
MK_FLOW_ACTION(DROP, 0),
MK_FLOW_ACTION(COUNT, sizeof(struct rte_flow_action_count)),
MK_FLOW_ACTION(RSS, sizeof(struct rte_flow_action_rss)),
+ MK_FLOW_ACTION(MIRROR, 0),
MK_FLOW_ACTION(PF, 0),
MK_FLOW_ACTION(VF, sizeof(struct rte_flow_action_vf)),
MK_FLOW_ACTION(PHY_PORT, sizeof(struct rte_flow_action_phy_port)),
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index da8bfa548..016578fa2 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -1730,6 +1730,13 @@ enum rte_flow_action_type {
*/
RTE_FLOW_ACTION_TYPE_RSS,
+ /**
+ * Mirror traffic to a given virtual function or physical function
+ *
+ * See struct rte_flow_action_mirror.
+ */
+ RTE_FLOW_ACTION_TYPE_MIRROR,
+
/**
* Directs matching traffic to the physical function (PF) of the
* current device.
--
2.17.1
More information about the dev
mailing list