Skip to content

Commit 5b2a252

Browse files
kliteynSaeed Mahameed
authored andcommitted
net/mlx5: DR, Can't go to uplink vport on RX rule
Go-To-Vport action on RX is not allowed when the vport is uplink. In such case, the packet should be dropped. Fixes: 9db810e ("net/mlx5: DR, Expose steering action functionality") Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com> Reviewed-by: Erez Shitrit <erezsh@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
1 parent 5665954 commit 5b2a252

File tree

1 file changed

+11
-5
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/steering

1 file changed

+11
-5
lines changed

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -874,11 +874,17 @@ int mlx5dr_actions_build_ste_arr(struct mlx5dr_matcher *matcher,
874874
action->sampler->tx_icm_addr;
875875
break;
876876
case DR_ACTION_TYP_VPORT:
877-
attr.hit_gvmi = action->vport->caps->vhca_gvmi;
878-
dest_action = action;
879-
attr.final_icm_addr = rx_rule ?
880-
action->vport->caps->icm_address_rx :
881-
action->vport->caps->icm_address_tx;
877+
if (unlikely(rx_rule && action->vport->caps->num == MLX5_VPORT_UPLINK)) {
878+
/* can't go to uplink on RX rule - dropping instead */
879+
attr.final_icm_addr = nic_dmn->drop_icm_addr;
880+
attr.hit_gvmi = nic_dmn->drop_icm_addr >> 48;
881+
} else {
882+
attr.hit_gvmi = action->vport->caps->vhca_gvmi;
883+
dest_action = action;
884+
attr.final_icm_addr = rx_rule ?
885+
action->vport->caps->icm_address_rx :
886+
action->vport->caps->icm_address_tx;
887+
}
882888
break;
883889
case DR_ACTION_TYP_POP_VLAN:
884890
if (!rx_rule && !(dmn->ste_ctx->actions_caps &

0 commit comments

Comments
 (0)