linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IB/mlx5: unify return value to ENOENT
@ 2021-09-03  8:48 Li Zhijian
  2021-09-28 17:08 ` Jason Gunthorpe
  2021-09-29  4:21 ` lizhijian
  0 siblings, 2 replies; 7+ messages in thread
From: Li Zhijian @ 2021-09-03  8:48 UTC (permalink / raw)
  To: leon, dledford, jgg, linux-rdma; +Cc: linux-kernel, Li Zhijian

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@cn.fujitsu.com>
---
 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;
-- 
2.31.1




^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-10-13 18:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-03  8:48 [PATCH] IB/mlx5: unify return value to ENOENT Li Zhijian
2021-09-28 17:08 ` Jason Gunthorpe
2021-09-29  4:37   ` lizhijian
2021-10-01 14:45     ` Jason Gunthorpe
2021-10-13  7:26   ` lizhijian
2021-10-13 18:02     ` Jason Gunthorpe
2021-09-29  4:21 ` lizhijian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).