public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-next 0/2] Small optimization for ib_map_mr_sg() and ib_map_mr_sg_pi()
@ 2024-11-05 12:08 Junxian Huang
  2024-11-05 12:08 ` [PATCH for-next 1/2] RDMA/core: Add dummy sg_offset pointer " Junxian Huang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Junxian Huang @ 2024-11-05 12:08 UTC (permalink / raw)
  To: dennis.dalessandro, jgg, leon
  Cc: linux-rdma, linuxarm, linux-kernel, tangchengchang, huangjunxian6

ib_map_mr_sg() and ib_map_mr_sg_pi() allow ULPs to specify NULL as
the sg_offset/data_sg_offset/meta_sg_offset arguments. Drivers who
need to derefernce these arguments have to add NULL pointer checks
to avoid crashing the kernel.

This can be optimized by adding dummy sg_offset pointer to these
two APIs. When the sg_offset arguments are NULL, pass the pointer
of dummy to drivers. Drivers can always get a valid pointer, so no
need to add NULL pointer checks.

Junxian Huang (2):
  RDMA/core: Add dummy sg_offset pointer for ib_map_mr_sg() and
    ib_map_mr_sg_pi()
  RDMA: Delete NULL pointer checks for sg_offset in .map_mr_sg ops

 drivers/infiniband/core/verbs.c         | 12 +++++++++---
 drivers/infiniband/hw/mlx5/mr.c         | 18 ++++++------------
 drivers/infiniband/sw/rdmavt/trace_mr.h |  2 +-
 3 files changed, 16 insertions(+), 16 deletions(-)

--
2.33.0


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

end of thread, other threads:[~2024-11-07  1:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-05 12:08 [PATCH for-next 0/2] Small optimization for ib_map_mr_sg() and ib_map_mr_sg_pi() Junxian Huang
2024-11-05 12:08 ` [PATCH for-next 1/2] RDMA/core: Add dummy sg_offset pointer " Junxian Huang
2024-11-05 12:08 ` [PATCH for-next 2/2] RDMA: Delete NULL pointer checks for sg_offset in .map_mr_sg ops Junxian Huang
2024-11-06 12:08 ` [PATCH for-next 0/2] Small optimization for ib_map_mr_sg() and ib_map_mr_sg_pi() Leon Romanovsky
2024-11-06 13:12   ` Junxian Huang
2024-11-06 13:36     ` Leon Romanovsky
2024-11-07  1:41       ` Junxian Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox