net/mlx5: fix VLAN push 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: 773ca0e91b ("net/mlx5: support VLAN push/pop/modify with HWS")

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
This commit is contained in:
Dariusz Sosnowski 2022-11-17 10:06:47 +00:00 committed by Raslan Darawsheh
parent 44864503a5
commit 28ffc4bbab

View File

@ -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];