diff options
author | Roi Dayan <[email protected]> | 2023-04-23 10:53:18 +0300 |
---|---|---|
committer | Saeed Mahameed <[email protected]> | 2023-05-19 10:50:30 -0700 |
commit | bea416c7e970399b438b801a9f3ffa24c4ddf855 (patch) | |
tree | 40e66288aebd58160c41b7051b7f00f81ad15501 | |
parent | 6cb9318a2534b7081eb9f375a720972f811665f6 (diff) |
net/mlx5e: E-Switch, Check device is PF when stopping esw offloads
Checking sriov is done on the pci device so it can return true
on other devices like SF but nothing should be done in this case.
Add a check that the device is PF.
Signed-off-by: Roi Dayan <[email protected]>
Reviewed-by: Maor Dickman <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index 66a522d08be1..44b5d1359155 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -3301,7 +3301,7 @@ static int esw_offloads_stop(struct mlx5_eswitch *esw, /* If changing from switchdev to legacy mode without sriov enabled, * no need to create legacy fdb. */ - if (!mlx5_sriov_is_enabled(esw->dev)) + if (!mlx5_core_is_pf(esw->dev) || !mlx5_sriov_is_enabled(esw->dev)) return 0; err = mlx5_eswitch_enable_locked(esw, MLX5_ESWITCH_IGNORE_NUM_VFS); |