Skip to content

Commit 1bf8b0d

Browse files
roidayanSaeed Mahameed
authored andcommitted
net/mlx5e: Verify flow_source cap before using it
When adding send to vport rule verify flow_source matching is supported by checking the flow_source cap. Fixes: d044425 ("net/mlx5: E-Switch, set flow source for send to uplink rule") Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Maor Dickman <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent e1ed30c commit 1bf8b0d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,8 @@ mlx5_eswitch_add_send_to_vport_rule(struct mlx5_eswitch *on_esw,
869869
dest.vport.flags |= MLX5_FLOW_DEST_VPORT_VHCA_ID;
870870
flow_act.action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
871871

872-
if (rep->vport == MLX5_VPORT_UPLINK)
872+
if (MLX5_CAP_ESW_FLOWTABLE(on_esw->dev, flow_source) &&
873+
rep->vport == MLX5_VPORT_UPLINK)
873874
spec->flow_context.flow_source = MLX5_FLOW_CONTEXT_FLOW_SOURCE_LOCAL_VPORT;
874875

875876
flow_rule = mlx5_add_flow_rules(mlx5_eswitch_get_slow_fdb(on_esw),

0 commit comments

Comments
 (0)