Skip to content

Commit

Permalink
mlx5: DR, Can't go to uplink vport on RX rule
Browse files Browse the repository at this point in the history
Go-To-Vport action on RX is not allowed when the vport is uplink.  If
this happens on RX domain, the rule insertion fails, as the rule is
illegal.
If this happens on RX side of the FDB domain, then the TX part of the
rule is legal, and the RX part will be replaced with drop.

Fixes: 828351a ("mlx5: Expose steering action functionality")
Signed-off-by: Yevgeny Kliteynik <[email protected]>
Reviewed-by: Erez Shitrit <[email protected]>
Signed-off-by: Yishai Hadas <[email protected]>
  • Loading branch information
kliteyn authored and Yishai Hadas committed Dec 28, 2023
1 parent c16e771 commit 5afb79f
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions providers/mlx5/dr_action.c
Expand Up @@ -873,10 +873,21 @@ int dr_actions_build_ste_arr(struct mlx5dv_dr_matcher *matcher,
dr_dbg(dmn, "Destination vport belongs to a different domain\n");
goto out_invalid_arg;
}
attr.hit_gvmi = action->vport.caps->vhca_gvmi;
attr.final_icm_addr = rx_rule ?
action->vport.caps->icm_address_rx :
action->vport.caps->icm_address_tx;
if (unlikely(rx_rule && action->vport.caps->num == WIRE_PORT)) {
if (dmn->type == MLX5DV_DR_DOMAIN_TYPE_NIC_RX) {
dr_dbg(dmn, "Forwarding to uplink vport on RX is not allowed\n");
goto out_invalid_arg;
}

/* silently drop the packets for RX side of FDB */
attr.final_icm_addr = nic_dmn->drop_icm_addr;
attr.hit_gvmi = nic_dmn->drop_icm_addr >> 48;
} else {
attr.hit_gvmi = action->vport.caps->vhca_gvmi;
attr.final_icm_addr = rx_rule ?
action->vport.caps->icm_address_rx :
action->vport.caps->icm_address_tx;
}
break;
case DR_ACTION_TYP_DEST_ARRAY:
if (action->dest_array.dmn != dmn) {
Expand Down

0 comments on commit 5afb79f

Please sign in to comment.