Re: [PATCH] IB/mlx5: unify return value to ENOENT

From: lizhijian@xxxxxxxxxxx
Date: Wed Sep 29 2021 - 00:28:39 EST


ping


On 03/09/2021 16:48, Li Zhijian wrote:
> Previously, ENOENT or EINVAL will be returned by ibv_advise_mr() although
> the errors all occur at get_prefetchable_mr().
>
> flags = IBV_ADVISE_MR_FLAG_FLUSH:
> mlx5_ib_advise_mr_prefetch()
> -> mlx5_ib_prefetch_sg_list()
> -> get_prefetchable_mr()
> return -ENOENT;
>
> flags = 0:
> mlx5_ib_advise_mr_prefetch()
> -> init_prefetch_work()
> -> get_prefetchable_mr()
> return -EINVAL;
>
> Signed-off-by: Li Zhijian <lizhijian@xxxxxxxxxxxxxx>
> ---
> drivers/infiniband/hw/mlx5/odp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/odp.c
> index d0d98e584ebc..52572e7ea6f6 100644
> --- a/drivers/infiniband/hw/mlx5/odp.c
> +++ b/drivers/infiniband/hw/mlx5/odp.c
> @@ -1828,7 +1828,7 @@ int mlx5_ib_advise_mr_prefetch(struct ib_pd *pd,
>
> if (!init_prefetch_work(pd, advice, pf_flags, work, sg_list, num_sge)) {
> destroy_prefetch_work(work);
> - return -EINVAL;
> + return -ENOENT;
> }
> queue_work(system_unbound_wq, &work->work);
> return 0;