DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: port id action must be after VLAN actions
@ 2019-10-30 14:19 Xiaoyu Min
  2019-11-03 15:34 ` Matan Azrad
  2019-11-04 12:43 ` [dpdk-dev] [PATCH v2] " Xiaoyu Min
  0 siblings, 2 replies; 4+ messages in thread
From: Xiaoyu Min @ 2019-10-30 14:19 UTC (permalink / raw)
  To: Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko; +Cc: dev, motih

Rdma-core needs the dst_vport (port_id) action be after push/pop VLAN
and modify hdr actions otherwise it will reject to create rule.

This pach validates the port_id is after push/pop VLAN and set VLAN
VID/PCP otherwise PMD spits out errors.

Fixes: 5f163d520cff ("net/mlx5: support modify VLAN ID on existing VLAN header")
Cc: motih@mellanox.com

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index d9a7fd4b25..e2f7a45953 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -973,6 +973,11 @@ flow_dv_validate_action_pop_vlan(struct rte_eth_dev *dev,
 					  NULL,
 					  "cannot pop vlan without a "
 					  "match on (outer) vlan in the flow");
+	if (action_flags & MLX5_FLOW_ACTION_PORT_ID)
+		return rte_flow_error_set(error, EINVAL,
+					  RTE_FLOW_ERROR_TYPE_ACTION, action,
+					  "wrong action order, port_id should "
+					  "be after pop VLAN action");
 	return 0;
 }
 
@@ -1067,6 +1072,11 @@ flow_dv_validate_action_push_vlan(uint64_t action_flags,
 					  RTE_FLOW_ERROR_TYPE_ACTION, action,
 					  "no support for multiple VLAN "
 					  "actions");
+	if (action_flags & MLX5_FLOW_ACTION_PORT_ID)
+		return rte_flow_error_set(error, EINVAL,
+					  RTE_FLOW_ERROR_TYPE_ACTION, action,
+					  "wrong action order, port_id should "
+					  "be after push VLAN");
 	(void)attr;
 	return 0;
 }
@@ -1109,6 +1119,11 @@ flow_dv_validate_action_set_vlan_pcp(uint64_t action_flags,
 					  RTE_FLOW_ERROR_TYPE_ACTION, action,
 					  "set VLAN PCP action must precede "
 					  "the push VLAN action");
+	if (action_flags & MLX5_FLOW_ACTION_PORT_ID)
+		return rte_flow_error_set(error, EINVAL,
+					  RTE_FLOW_ERROR_TYPE_ACTION, action,
+					  "wrong action order, port_id should "
+					  "be after set VLAN PCP");
 	return 0;
 }
 
@@ -1129,6 +1144,7 @@ flow_dv_validate_action_set_vlan_pcp(uint64_t action_flags,
  */
 static int
 flow_dv_validate_action_set_vlan_vid(uint64_t item_flags,
+				     uint64_t action_flags,
 				     const struct rte_flow_action actions[],
 				     struct rte_flow_error *error)
 {
@@ -1155,11 +1171,21 @@ flow_dv_validate_action_set_vlan_vid(uint64_t item_flags,
 					  RTE_FLOW_ERROR_TYPE_ACTION, action,
 					  "Multiple VLAN VID modifications are "
 					  "not supported");
-	if (!(item_flags & MLX5_FLOW_LAYER_OUTER_VLAN))
+	/*
+	 * If there is preceeding of_push_vlan action, this set_vlan_vid means
+	 * set vlan id in pushed vlan header.
+	 */
+	if (!(item_flags & MLX5_FLOW_LAYER_OUTER_VLAN) &&
+	    !(item_flags & MLX5_FLOW_ACTION_OF_PUSH_VLAN))
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_ACTION, action,
 					  "match on VLAN is required in order "
 					  "to set VLAN VID");
+	if (action_flags & MLX5_FLOW_ACTION_PORT_ID)
+		return rte_flow_error_set(error, EINVAL,
+					  RTE_FLOW_ERROR_TYPE_ACTION, action,
+					  "wrong action order, port_id should "
+					  "be after set VLAN VID");
 	return 0;
 }
 
@@ -3638,7 +3664,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 			break;
 		case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID:
 			ret = flow_dv_validate_action_set_vlan_vid
-						(item_flags, actions, error);
+						(item_flags, action_flags,
+						 actions, error);
 			if (ret < 0)
 				return ret;
 			/* Count VID with push_vlan command. */
-- 
2.24.0.rc0.3.g12a4aeaad8


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

* Re: [dpdk-dev] [PATCH] net/mlx5: port id action must be after VLAN actions
  2019-10-30 14:19 [dpdk-dev] [PATCH] net/mlx5: port id action must be after VLAN actions Xiaoyu Min
@ 2019-11-03 15:34 ` Matan Azrad
  2019-11-04 12:43 ` [dpdk-dev] [PATCH v2] " Xiaoyu Min
  1 sibling, 0 replies; 4+ messages in thread
From: Matan Azrad @ 2019-11-03 15:34 UTC (permalink / raw)
  To: Jack Min, Shahaf Shuler, Slava Ovsiienko; +Cc: dev, Moti Haimovsky

Hi

From: Xiaoyu Min
> Rdma-core needs the dst_vport (port_id) action be after push/pop VLAN
> and modify hdr actions otherwise it will reject to create rule.
> 
> This pach validates the port_id is after push/pop VLAN and set VLAN VID/PCP
> otherwise PMD spits out errors.
> 
> Fixes: 5f163d520cff ("net/mlx5: support modify VLAN ID on existing VLAN
> header")
> Cc: motih@mellanox.com
> 
> Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>

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

* [dpdk-dev] [PATCH v2] net/mlx5: port id action must be after VLAN actions
  2019-10-30 14:19 [dpdk-dev] [PATCH] net/mlx5: port id action must be after VLAN actions Xiaoyu Min
  2019-11-03 15:34 ` Matan Azrad
@ 2019-11-04 12:43 ` Xiaoyu Min
  2019-11-04 15:09   ` Raslan Darawsheh
  1 sibling, 1 reply; 4+ messages in thread
From: Xiaoyu Min @ 2019-11-04 12:43 UTC (permalink / raw)
  To: Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko; +Cc: dev, motih

Rdma-core needs the dst_vport (port_id) action be after push/pop VLAN
and modify hdr actions otherwise it will reject to create rule.

This pach validates the port_id is after push/pop VLAN and set VLAN
VID/PCP otherwise PMD spits out errors.

Fixes: 5f163d520cff ("net/mlx5: support modify VLAN ID on existing VLAN header")
Cc: motih@mellanox.com

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
v2:
  * rebased

 drivers/net/mlx5/mlx5_flow_dv.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 4be059ded5..b49175e5a4 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1000,6 +1000,11 @@ flow_dv_validate_action_pop_vlan(struct rte_eth_dev *dev,
 					  NULL,
 					  "cannot pop vlan without a "
 					  "match on (outer) vlan in the flow");
+	if (action_flags & MLX5_FLOW_ACTION_PORT_ID)
+		return rte_flow_error_set(error, EINVAL,
+					  RTE_FLOW_ERROR_TYPE_ACTION, action,
+					  "wrong action order, port_id should "
+					  "be after pop VLAN action");
 	return 0;
 }
 
@@ -1103,6 +1108,11 @@ flow_dv_validate_action_push_vlan(uint64_t action_flags,
 				"push VLAN needs to match on VLAN in order to "
 				"get VLAN VID information because there is "
 				"no followed set VLAN VID action");
+	if (action_flags & MLX5_FLOW_ACTION_PORT_ID)
+		return rte_flow_error_set(error, EINVAL,
+					  RTE_FLOW_ERROR_TYPE_ACTION, action,
+					  "wrong action order, port_id should "
+					  "be after push VLAN");
 	(void)attr;
 	return 0;
 }
@@ -1144,6 +1154,11 @@ flow_dv_validate_action_set_vlan_pcp(uint64_t action_flags,
 					  RTE_FLOW_ERROR_TYPE_ACTION, action,
 					  "Multiple VLAN PCP modification are "
 					  "not supported");
+	if (action_flags & MLX5_FLOW_ACTION_PORT_ID)
+		return rte_flow_error_set(error, EINVAL,
+					  RTE_FLOW_ERROR_TYPE_ACTION, action,
+					  "wrong action order, port_id should "
+					  "be after set VLAN PCP");
 	return 0;
 }
 
@@ -1202,6 +1217,11 @@ flow_dv_validate_action_set_vlan_vid(uint64_t item_flags,
 					  RTE_FLOW_ERROR_TYPE_ACTION, action,
 					  "match on VLAN is required in order "
 					  "to set VLAN VID");
+	if (action_flags & MLX5_FLOW_ACTION_PORT_ID)
+		return rte_flow_error_set(error, EINVAL,
+					  RTE_FLOW_ERROR_TYPE_ACTION, action,
+					  "wrong action order, port_id should "
+					  "be after set VLAN VID");
 	return 0;
 }
 
-- 
2.24.0.rc0.3.g12a4aeaad8


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

* Re: [dpdk-dev] [PATCH v2] net/mlx5: port id action must be after VLAN actions
  2019-11-04 12:43 ` [dpdk-dev] [PATCH v2] " Xiaoyu Min
@ 2019-11-04 15:09   ` Raslan Darawsheh
  0 siblings, 0 replies; 4+ messages in thread
From: Raslan Darawsheh @ 2019-11-04 15:09 UTC (permalink / raw)
  To: Jack Min, Matan Azrad, Shahaf Shuler, Slava Ovsiienko; +Cc: dev, Moti Haimovsky

Hi,
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Xiaoyu Min
> Sent: Monday, November 4, 2019 2:44 PM
> To: Matan Azrad <matan@mellanox.com>; Shahaf Shuler
> <shahafs@mellanox.com>; Slava Ovsiienko <viacheslavo@mellanox.com>
> Cc: dev@dpdk.org; Moti Haimovsky <motih@mellanox.com>
> Subject: [dpdk-dev] [PATCH v2] net/mlx5: port id action must be after VLAN
> actions
> 
> Rdma-core needs the dst_vport (port_id) action be after push/pop VLAN
> and modify hdr actions otherwise it will reject to create rule.
> 
> This pach validates the port_id is after push/pop VLAN and set VLAN VID/PCP
> otherwise PMD spits out errors.
> 
> Fixes: 5f163d520cff ("net/mlx5: support modify VLAN ID on existing VLAN
> header")
> Cc: motih@mellanox.com
> 
> Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
> Acked-by: Matan Azrad <matan@mellanox.com>
> ---
> v2:
>   * rebased
> 

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

end of thread, other threads:[~2019-11-04 15:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-30 14:19 [dpdk-dev] [PATCH] net/mlx5: port id action must be after VLAN actions Xiaoyu Min
2019-11-03 15:34 ` Matan Azrad
2019-11-04 12:43 ` [dpdk-dev] [PATCH v2] " Xiaoyu Min
2019-11-04 15:09   ` Raslan Darawsheh

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).