Skip to content

Commit 1b540de

Browse files
ayalevinSaeed Mahameed
authored andcommitted
net/mlx5e: Nullify table pointer when failing to create
On failing to create promisc flow steering table, the pointer is returned with an error. Nullify it so unloading the driver won't try to destroy a non existing table. Failing to create promisc table may happen over BF devices when the ARM side is going through a firmware tear down. The host side start a reload flow. While the driver unloads, it tries to remove the promisc table. Remove WARN in this state as it is a valid error flow. Fixes: 1c46d74 ("net/mlx5e: Optimize promiscuous mode") Signed-off-by: Aya Levin <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent dfad997 commit 1b540de

File tree

1 file changed

+2
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,7 @@ static int mlx5e_create_promisc_table(struct mlx5e_flow_steering *fs)
783783
ft->t = mlx5_create_auto_grouped_flow_table(fs->ns, &ft_attr);
784784
if (IS_ERR(ft->t)) {
785785
err = PTR_ERR(ft->t);
786+
ft->t = NULL;
786787
fs_err(fs, "fail to create promisc table err=%d\n", err);
787788
return err;
788789
}
@@ -810,7 +811,7 @@ static void mlx5e_del_promisc_rule(struct mlx5e_flow_steering *fs)
810811

811812
static void mlx5e_destroy_promisc_table(struct mlx5e_flow_steering *fs)
812813
{
813-
if (WARN(!fs->promisc.ft.t, "Trying to remove non-existing promiscuous table"))
814+
if (!fs->promisc.ft.t)
814815
return;
815816
mlx5e_del_promisc_rule(fs);
816817
mlx5_destroy_flow_table(fs->promisc.ft.t);

0 commit comments

Comments
 (0)