linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] RDMA/mlx5: return the EFAULT per ibv_advise_mr(3)
@ 2021-08-01  9:20 Li Zhijian
  2021-08-01 11:27 ` Leon Romanovsky
  2021-08-03 16:25 ` Jason Gunthorpe
  0 siblings, 2 replies; 13+ messages in thread
From: Li Zhijian @ 2021-08-01  9:20 UTC (permalink / raw)
  To: leon, dledford, jgg, linux-rdma, linux-kernel; +Cc: Li Zhijian

ibv_advise_mr(3) says:
EFAULT In one of the following: o When the range requested is out of the  MR  bounds,
       or  when  parts of it are not part of the process address space. o One of the
       lkeys provided in the scatter gather list is invalid or with wrong write access

Actually get_prefetchable_mr() will return NULL if it see above conditions

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..8d2a626c87cf 100644
--- a/drivers/infiniband/hw/mlx5/odp.c
+++ b/drivers/infiniband/hw/mlx5/odp.c
@@ -1791,7 +1791,7 @@ static int mlx5_ib_prefetch_sg_list(struct ib_pd *pd,
 
 		mr = get_prefetchable_mr(pd, advice, sg_list[i].lkey);
 		if (!mr)
-			return -ENOENT;
+			return -EFAULT;
 		ret = pagefault_mr(mr, sg_list[i].addr, sg_list[i].length,
 				   &bytes_mapped, pf_flags);
 		if (ret < 0) {
-- 
2.30.2




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

end of thread, other threads:[~2021-08-28  8:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-01  9:20 [PATCH] RDMA/mlx5: return the EFAULT per ibv_advise_mr(3) Li Zhijian
2021-08-01 11:27 ` Leon Romanovsky
2021-08-03 16:25 ` Jason Gunthorpe
2021-08-03 17:56   ` Leon Romanovsky
2021-08-03 18:13     ` Jason Gunthorpe
2021-08-04  5:35       ` Leon Romanovsky
2021-08-04 18:50         ` Jason Gunthorpe
2021-08-05  6:43           ` Leon Romanovsky
2021-08-16  2:59             ` lizhijian
2021-08-21  9:44               ` Li, Zhijian
2021-08-25 17:28                 ` Jason Gunthorpe
2021-08-26  1:18                   ` lizhijian
2021-08-28  8:42                     ` Li, Zhijian

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).