Skip to content

Commit 090f3e4

Browse files
royno-nvidiaSaeed Mahameed
authored and
Saeed Mahameed
committed
net/mlx5: Fix cmd error logging for manage pages cmd
When the driver unloads, give/reclaim_pages may fail as PF driver in teardown flow, current code will lead to the following kernel log print 'failed reclaiming pages: err 0'. Fix it to get same behavior as before the cited commits, by calling mlx5_cmd_check before handling error state. mlx5_cmd_check will verify if the returned error is an actual error needed to be handled by the driver or not and will return an appropriate value. Fixes: 8d56429 ("net/mlx5: Remove redundant error on reclaim pages") Fixes: 4dac2f1 ("net/mlx5: Remove redundant notify fail on give pages") Signed-off-by: Roy Novich <[email protected]> Reviewed-by: Moshe Shemesh <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 8e93f29 commit 090f3e4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

+6-3
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,8 @@ static int give_pages(struct mlx5_core_dev *dev, u16 func_id, int npages,
376376
goto out_dropped;
377377
}
378378
}
379+
err = mlx5_cmd_check(dev, err, in, out);
379380
if (err) {
380-
err = mlx5_cmd_check(dev, err, in, out);
381381
mlx5_core_warn(dev, "func_id 0x%x, npages %d, err %d\n",
382382
func_id, npages, err);
383383
goto out_dropped;
@@ -524,10 +524,13 @@ static int reclaim_pages(struct mlx5_core_dev *dev, u16 func_id, int npages,
524524
dev->priv.reclaim_pages_discard += npages;
525525
}
526526
/* if triggered by FW event and failed by FW then ignore */
527-
if (event && err == -EREMOTEIO)
527+
if (event && err == -EREMOTEIO) {
528528
err = 0;
529+
goto out_free;
530+
}
531+
532+
err = mlx5_cmd_check(dev, err, in, out);
529533
if (err) {
530-
err = mlx5_cmd_check(dev, err, in, out);
531534
mlx5_core_err(dev, "failed reclaiming pages: err %d\n", err);
532535
goto out_free;
533536
}

0 commit comments

Comments
 (0)