[v1,1/8] ethdev: support the mirror action for flow
Checks
Commit Message
From: Simon Lu <simonx.lu@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@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(+)
Comments
Hi Simon,
BSP,
> -----Original Message-----
> From: SimonX Lu <simonx.lu@intel.com>
> Sent: Wednesday, October 14, 2020 11:41 AM
> To: dev@dpdk.org
> Cc: jia.guo@intel.com; haiyue.wang@intel.com; qiming.yang@intel.com;
> beilei.xing@intel.com; Ori Kam <orika@nvidia.com>; Simon Lu
> <simonx.lu@intel.com>
> Subject: [PATCH v1 1/8] ethdev: support the mirror action for flow
>
> From: Simon Lu <simonx.lu@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@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(+)
>
Why did you create new action?
There was a new action "sampling" submitted in this release.
When set to 1 it means mirror since all packets will get duplicated
Please review https://patches.dpdk.org/cover/78893/
Thanks,
Ori
@@ -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
@@ -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)),
@@ -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.