All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/ice: support traffic to original DCF port
@ 2022-09-17  1:49 Zhichao Zeng
  2022-09-18  6:06 ` Zhang, Qi Z
  2022-09-19  7:46 ` Xu, Ke1
  0 siblings, 2 replies; 3+ messages in thread
From: Zhichao Zeng @ 2022-09-17  1:49 UTC (permalink / raw)
  To: dev; +Cc: yidingx.zhou, Zhichao Zeng, Qiming Yang, Qi Zhang

Add support for sending traffic to the original DCF port
with 'port_representor' action by using DCF port id as 'port_id'.

For example:
testpmd> flow create 0 ingress pattern any
         / end actions port_representor port_id 0 / end

Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
---
 doc/guides/nics/features/ice.ini    |  1 +
 drivers/net/ice/ice_switch_filter.c | 25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/doc/guides/nics/features/ice.ini b/doc/guides/nics/features/ice.ini
index fe1e81302c..221e8e90f5 100644
--- a/doc/guides/nics/features/ice.ini
+++ b/doc/guides/nics/features/ice.ini
@@ -82,3 +82,4 @@ passthru             = Y
 queue                = Y
 rss                  = Y
 represented_port     = Y
+port_representor     = Y
diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
index ef20b9ad95..60f7934a16 100644
--- a/drivers/net/ice/ice_switch_filter.c
+++ b/drivers/net/ice/ice_switch_filter.c
@@ -1628,6 +1628,30 @@ ice_switch_parse_dcf_action(struct ice_dcf_adapter *ad,
 				RTE_FLOW_ACTION_TYPE_END; action++) {
 		action_type = action->type;
 		switch (action_type) {
+		case RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR:
+			rule_info->sw_act.fltr_act = ICE_FWD_TO_VSI;
+			act_ethdev = action->conf;
+
+			if (!rte_eth_dev_is_valid_port(act_ethdev->port_id))
+				goto invalid_port_id;
+
+			/* For traffic to original DCF port */
+			rule_port_id = ad->parent.pf.dev_data->port_id;
+
+			if (rule_port_id != act_ethdev->port_id)
+				goto invalid_port_id;
+
+			rule_info->sw_act.vsi_handle = 0;
+
+			break;
+
+invalid_port_id:
+			rte_flow_error_set(error,
+						EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
+						actions,
+						"Invalid port_id");
+			return -rte_errno;
+
 		case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT:
 			rule_info->sw_act.fltr_act = ICE_FWD_TO_VSI;
 			act_ethdev = action->conf;
@@ -1799,6 +1823,7 @@ ice_switch_check_action(const struct rte_flow_action *actions,
 		case RTE_FLOW_ACTION_TYPE_QUEUE:
 		case RTE_FLOW_ACTION_TYPE_DROP:
 		case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT:
+		case RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR:
 			actions_num++;
 			break;
 		case RTE_FLOW_ACTION_TYPE_VOID:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] net/ice: support traffic to original DCF port
  2022-09-17  1:49 [PATCH] net/ice: support traffic to original DCF port Zhichao Zeng
@ 2022-09-18  6:06 ` Zhang, Qi Z
  2022-09-19  7:46 ` Xu, Ke1
  1 sibling, 0 replies; 3+ messages in thread
From: Zhang, Qi Z @ 2022-09-18  6:06 UTC (permalink / raw)
  To: Zeng, ZhichaoX, dev; +Cc: Zhou, YidingX, Yang, Qiming



> -----Original Message-----
> From: Zeng, ZhichaoX <zhichaox.zeng@intel.com>
> Sent: Saturday, September 17, 2022 9:49 AM
> To: dev@dpdk.org
> Cc: Zhou, YidingX <yidingx.zhou@intel.com>; Zeng, ZhichaoX
> <zhichaox.zeng@intel.com>; Yang, Qiming <qiming.yang@intel.com>; Zhang,
> Qi Z <qi.z.zhang@intel.com>
> Subject: [PATCH] net/ice: support traffic to original DCF port
> 
> Add support for sending traffic to the original DCF port with
> 'port_representor' action by using DCF port id as 'port_id'.
> 
> For example:
> testpmd> flow create 0 ingress pattern any
>          / end actions port_representor port_id 0 / end
> 
> Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] net/ice: support traffic to original DCF port
  2022-09-17  1:49 [PATCH] net/ice: support traffic to original DCF port Zhichao Zeng
  2022-09-18  6:06 ` Zhang, Qi Z
@ 2022-09-19  7:46 ` Xu, Ke1
  1 sibling, 0 replies; 3+ messages in thread
From: Xu, Ke1 @ 2022-09-19  7:46 UTC (permalink / raw)
  To: Zeng, ZhichaoX, dev
  Cc: Zhou, YidingX, Zeng, ZhichaoX, Yang, Qiming, Zhang, Qi Z


> -----Original Message-----
> From: Zhichao Zeng <zhichaox.zeng@intel.com>
> Sent: Saturday, September 17, 2022 9:49 AM
> To: dev@dpdk.org
> Cc: Zhou, YidingX <yidingx.zhou@intel.com>; Zeng, ZhichaoX
> <zhichaox.zeng@intel.com>; Yang, Qiming <qiming.yang@intel.com>; Zhang,
> Qi Z <qi.z.zhang@intel.com>
> Subject: [PATCH] net/ice: support traffic to original DCF port
> 
> Add support for sending traffic to the original DCF port with
> 'port_representor' action by using DCF port id as 'port_id'.
> 
> For example:
> testpmd> flow create 0 ingress pattern any
>          / end actions port_representor port_id 0 / end
> 
> Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
> ---
>  doc/guides/nics/features/ice.ini    |  1 +
>  drivers/net/ice/ice_switch_filter.c | 25 +++++++++++++++++++++++++
>  2 files changed, 26 insertions(+)
> 

Tested and passed, using 'port_representor' action covering dcf to self dcf, dcf to other dcf, dcf to iavf, dcf to iavf of other dcf.

Tested-by: Ke Xu <ke1.xu@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-19  7:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-17  1:49 [PATCH] net/ice: support traffic to original DCF port Zhichao Zeng
2022-09-18  6:06 ` Zhang, Qi Z
2022-09-19  7:46 ` Xu, Ke1

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.