Skip to contentSkip to conversation

net/ice: support original represented_port action

PATCH Superseded [email protected] 3 participants 5 messages Aug 26, 2022 – Sep 6, 2022 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ice: support original represented_port action

From: Zhichao Zeng <[email protected]>

Add support to send matching traffic to the original DCF port with represented_port action by using DCF port id as ethdev_port_id.

---
 drivers/net/ice/ice_switch_filter.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/ice/ice_switch_filter.c +5 -1
index da81e49bfa..dbcb8bdfdc 100644
@@ -1623,6 +1623,7 @@ ice_switch_parse_dcf_action(struct ice_dcf_adapter *ad,
 	const struct rte_eth_dev *repr_dev;
 	enum rte_flow_action_type action_type;
 	uint16_t rule_port_id, backer_port_id;
+	const char *pf_dev_name;
 
 	for (action = actions; action->type !=
 				RTE_FLOW_ACTION_TYPE_END; action++) {
@@ -1638,8 +1639,11 @@ ice_switch_parse_dcf_action(struct ice_dcf_adapter *ad,
 
 			rule_port_id = ad->parent.pf.dev_data->port_id;
 			backer_port_id = repr_dev->data->backer_port_id;
+			pf_dev_name = ad->parent.pf.dev_data->name;
 
-			if (backer_port_id != rule_port_id)
+			if (backer_port_id != rule_port_id &&
+					strncmp(pf_dev_name, repr_dev->data->name,
+							strlen(pf_dev_name)))
 				goto invalid;
 
 			rule_info->sw_act.vsi_handle = repr_dev->data->representor_id;
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 1/1 net/ice: support original represented_port action

Add support to send matching traffic to the original DCF port with represented_port action by using DCF port id as ethdev_port_id.

---
v2: use id instead of name to represent port for comparing

---
 drivers/net/ice/ice_switch_filter.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ice/ice_switch_filter.c +2 -1
index da81e49bfa..240fa10750 100644
@@ -1639,7 +1639,8 @@ ice_switch_parse_dcf_action(struct ice_dcf_adapter *ad,
 			rule_port_id = ad->parent.pf.dev_data->port_id;
 			backer_port_id = repr_dev->data->backer_port_id;
 
-			if (backer_port_id != rule_port_id)
+			if (backer_port_id != rule_port_id &&
+					act_ethdev->port_id != rule_port_id)
 				goto invalid;
 
 			rule_info->sw_act.vsi_handle = repr_dev->data->representor_id;
Signature · 1 line
2.25.1
Acked-by on v2 1/1 Applied
#2 lore raw
Quoted 11 lines

-----Original Message-----
From: Zeng, ZhichaoX <[email protected]>
Sent: Wednesday, August 31, 2022 1:42 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Zhou, YidingX <[email protected]>; Zeng, ZhichaoX <[email protected]>; Zhang, Qi Z <[email protected]>
Subject: [PATCH v2] net/ice: support original represented_port action

Quoted 4 lines

Add support to send matching traffic to the original DCF port with represented_port action by using DCF port id as ethdev_port_id.

Applied to dpdk-next-net-intel.

Thanks
Qi

#3 lore raw
Quoted 21 lines

-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: Thursday, September 1, 2022 9:12 AM
To: Zeng, ZhichaoX <[email protected]>; [email protected]
Cc: Yang, Qiming <[email protected]>; Zhou, YidingX <[email protected]>
Subject: RE: [PATCH v2] net/ice: support original represented_port action

Quoted 9 lines

-----Original Message-----
From: Zeng, ZhichaoX <[email protected]>
Sent: Wednesday, August 31, 2022 1:42 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Zhou, YidingX <[email protected]>; Zeng, ZhichaoX <[email protected]>; Zhang, Qi Z <[email protected]>
Subject: [PATCH v2] net/ice: support original represented_port action

Quoted 8 lines
Quoted 4 lines

Add support to send matching traffic to the original DCF port with represented_port action by using DCF port id as ethdev_port_id.

Applied to dpdk-next-net-intel.

For traffic to original DCF port , it should use RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR but not RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT The patch has been dropped in dpdk-next-net-net.
A new version is expected.

Quoted 3 lines

Thanks
Qi

Tested-by on v2 1/1
#4 lore raw
In reply to Zhichao Zeng
Quoted 10 lines

-----Original Message-----
From: Zhichao Zeng <[email protected]>
Sent: Wednesday, August 31, 2022 1:42 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Zhou, YidingX <[email protected]>; Zeng, ZhichaoX <[email protected]>; Zhang, Qi Z <[email protected]>
Subject: [PATCH v2] net/ice: support original represented_port action

Quoted 4 lines

Add support to send matching traffic to the original DCF port with represented_port action by using DCF port id as ethdev_port_id.

V2 patch for original action tested and passed.

Regards,