mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 04:23:35 +02:00
net/mlx5: Fix peer miss rules host disabled checks
The check on mlx5_esw_host_functions_enabled(esw->dev) for adding VF
peer miss rules is incorrect. These rules match traffic from peer's VFs,
so the local device's host function status is irrelevant. Remove this
check to ensure peer VF traffic is properly handled regardless of local
host configuration.
Also fix the PF peer miss rule deletion to be symmetric with the add
path, so only attempt to delete the rule if it was actually created.
Fixes: 520369ef43 ("net/mlx5: Support disabling host PFs")
Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260305142634.1813208-3-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
24b2795f96
commit
76324e4041
|
|
@ -1241,21 +1241,17 @@ static int esw_add_fdb_peer_miss_rules(struct mlx5_eswitch *esw,
|
|||
flows[peer_vport->index] = flow;
|
||||
}
|
||||
|
||||
if (mlx5_esw_host_functions_enabled(esw->dev)) {
|
||||
mlx5_esw_for_each_vf_vport(peer_esw, i, peer_vport,
|
||||
mlx5_core_max_vfs(peer_dev)) {
|
||||
esw_set_peer_miss_rule_source_port(esw, peer_esw,
|
||||
spec,
|
||||
peer_vport->vport);
|
||||
|
||||
flow = mlx5_add_flow_rules(mlx5_eswitch_get_slow_fdb(esw),
|
||||
spec, &flow_act, &dest, 1);
|
||||
if (IS_ERR(flow)) {
|
||||
err = PTR_ERR(flow);
|
||||
goto add_vf_flow_err;
|
||||
}
|
||||
flows[peer_vport->index] = flow;
|
||||
mlx5_esw_for_each_vf_vport(peer_esw, i, peer_vport,
|
||||
mlx5_core_max_vfs(peer_dev)) {
|
||||
esw_set_peer_miss_rule_source_port(esw, peer_esw, spec,
|
||||
peer_vport->vport);
|
||||
flow = mlx5_add_flow_rules(mlx5_eswitch_get_slow_fdb(esw),
|
||||
spec, &flow_act, &dest, 1);
|
||||
if (IS_ERR(flow)) {
|
||||
err = PTR_ERR(flow);
|
||||
goto add_vf_flow_err;
|
||||
}
|
||||
flows[peer_vport->index] = flow;
|
||||
}
|
||||
|
||||
if (mlx5_core_ec_sriov_enabled(peer_dev)) {
|
||||
|
|
@ -1347,7 +1343,8 @@ static void esw_del_fdb_peer_miss_rules(struct mlx5_eswitch *esw,
|
|||
mlx5_del_flow_rules(flows[peer_vport->index]);
|
||||
}
|
||||
|
||||
if (mlx5_core_is_ecpf_esw_manager(peer_dev)) {
|
||||
if (mlx5_core_is_ecpf_esw_manager(peer_dev) &&
|
||||
mlx5_esw_host_functions_enabled(peer_dev)) {
|
||||
peer_vport = mlx5_eswitch_get_vport(peer_esw, MLX5_VPORT_PF);
|
||||
mlx5_del_flow_rules(flows[peer_vport->index]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user