Commit 090f3e4f authored by Roy Novich's avatar Roy Novich Committed by Saeed Mahameed

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: 8d564292 ("net/mlx5: Remove redundant error on reclaim pages")
Fixes: 4dac2f10 ("net/mlx5: Remove redundant notify fail on give pages")
Signed-off-by: default avatarRoy Novich <royno@nvidia.com>
Reviewed-by: default avatarMoshe Shemesh <moshe@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 8e93f294
...@@ -376,8 +376,8 @@ static int give_pages(struct mlx5_core_dev *dev, u16 func_id, int npages, ...@@ -376,8 +376,8 @@ static int give_pages(struct mlx5_core_dev *dev, u16 func_id, int npages,
goto out_dropped; goto out_dropped;
} }
} }
if (err) {
err = mlx5_cmd_check(dev, err, in, out); err = mlx5_cmd_check(dev, err, in, out);
if (err) {
mlx5_core_warn(dev, "func_id 0x%x, npages %d, err %d\n", mlx5_core_warn(dev, "func_id 0x%x, npages %d, err %d\n",
func_id, npages, err); func_id, npages, err);
goto out_dropped; goto out_dropped;
...@@ -524,10 +524,13 @@ static int reclaim_pages(struct mlx5_core_dev *dev, u16 func_id, int npages, ...@@ -524,10 +524,13 @@ static int reclaim_pages(struct mlx5_core_dev *dev, u16 func_id, int npages,
dev->priv.reclaim_pages_discard += npages; dev->priv.reclaim_pages_discard += npages;
} }
/* if triggered by FW event and failed by FW then ignore */ /* if triggered by FW event and failed by FW then ignore */
if (event && err == -EREMOTEIO) if (event && err == -EREMOTEIO) {
err = 0; err = 0;
if (err) { goto out_free;
}
err = mlx5_cmd_check(dev, err, in, out); err = mlx5_cmd_check(dev, err, in, out);
if (err) {
mlx5_core_err(dev, "failed reclaiming pages: err %d\n", err); mlx5_core_err(dev, "failed reclaiming pages: err %d\n", err);
goto out_free; goto out_free;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment