DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix push VLAN action mask iteration
@ 2022-11-17 10:06 Dariusz Sosnowski
  2022-11-20 15:31 ` Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Dariusz Sosnowski @ 2022-11-17 10:06 UTC (permalink / raw)
  To: Matan Azrad, Viacheslav Ovsiienko, Gregory Etelson; +Cc: dev, Raslan Darawsheh

Before this patch, during translation of OF_PUSH_VLAN actions iterator
was moved forward to the position of OF_SET_VLAN_VID or
OF_SET_VLAN_PCP, but masks iterator was not updated.
As a result, the following actions were incorrectly translated,
because iterators were not aligned.

This patch fixes this behavior by properly adjusting masks iterator
alognside actions iterator.

Fixes: 773ca0e91ba1 ("net/mlx5: support VLAN push/pop/modify with HWS")
Cc: getelson@nvidia.com

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index f4493ad556..ff0c3064c1 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -1346,6 +1346,7 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,
 	bool actions_end = false;
 	uint32_t type;
 	bool reformat_used = false;
+	unsigned int of_vlan_offset;
 	uint16_t action_pos;
 	uint16_t jump_pos;
 	uint32_t ct_idx;
@@ -1413,9 +1414,11 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,
 					(priv, acts, actions->type,
 					 actions - action_start, action_pos))
 				goto err;
-			actions += is_of_vlan_pcp_present(actions) ?
+			of_vlan_offset = is_of_vlan_pcp_present(actions) ?
 					MLX5_HW_VLAN_PUSH_PCP_IDX :
 					MLX5_HW_VLAN_PUSH_VID_IDX;
+			actions += of_vlan_offset;
+			masks += of_vlan_offset;
 			break;
 		case RTE_FLOW_ACTION_TYPE_OF_POP_VLAN:
 			action_pos = at->actions_off[actions - at->actions];
-- 
2.25.1


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

* RE: [PATCH] net/mlx5: fix push VLAN action mask iteration
  2022-11-17 10:06 [PATCH] net/mlx5: fix push VLAN action mask iteration Dariusz Sosnowski
@ 2022-11-20 15:31 ` Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2022-11-20 15:31 UTC (permalink / raw)
  To: Dariusz Sosnowski, Matan Azrad, Slava Ovsiienko, Gregory Etelson; +Cc: dev

Hi,
> -----Original Message-----
> From: Dariusz Sosnowski <dsosnowski@nvidia.com>
> Sent: Thursday, November 17, 2022 12:07 PM
> To: Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Gregory Etelson <getelson@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>
> Subject: [PATCH] net/mlx5: fix push VLAN action mask iteration
> 
> Before this patch, during translation of OF_PUSH_VLAN actions iterator
> was moved forward to the position of OF_SET_VLAN_VID or
> OF_SET_VLAN_PCP, but masks iterator was not updated.
> As a result, the following actions were incorrectly translated,
> because iterators were not aligned.
> 
> This patch fixes this behavior by properly adjusting masks iterator
> alognside actions iterator.
> 
> Fixes: 773ca0e91ba1 ("net/mlx5: support VLAN push/pop/modify with HWS")
> Cc: getelson@nvidia.com
> 
> Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh


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

end of thread, other threads:[~2022-11-20 15:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-17 10:06 [PATCH] net/mlx5: fix push VLAN action mask iteration Dariusz Sosnowski
2022-11-20 15:31 ` 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).