public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Junxian Huang <huangjunxian6@hisilicon.com>
Cc: dennis.dalessandro@cornelisnetworks.com, jgg@ziepe.ca,
	linux-rdma@vger.kernel.org, linuxarm@huawei.com,
	linux-kernel@vger.kernel.org, tangchengchang@huawei.com
Subject: Re: [PATCH for-next 0/2] Small optimization for ib_map_mr_sg() and ib_map_mr_sg_pi()
Date: Wed, 6 Nov 2024 14:08:19 +0200	[thread overview]
Message-ID: <20241106120819.GA5006@unreal> (raw)
In-Reply-To: <20241105120841.860068-1-huangjunxian6@hisilicon.com>

On Tue, Nov 05, 2024 at 08:08:39PM +0800, Junxian Huang wrote:
> 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(-)

So what does this change give us?
We have same functionality, same number of lines, same everything ...

Thanks

> 
> --
> 2.33.0
> 
> 

  parent reply	other threads:[~2024-11-06 12:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Leon Romanovsky [this message]
2024-11-06 13:12   ` [PATCH for-next 0/2] Small optimization for ib_map_mr_sg() and ib_map_mr_sg_pi() Junxian Huang
2024-11-06 13:36     ` Leon Romanovsky
2024-11-07  1:41       ` Junxian Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241106120819.GA5006@unreal \
    --to=leon@kernel.org \
    --cc=dennis.dalessandro@cornelisnetworks.com \
    --cc=huangjunxian6@hisilicon.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=tangchengchang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox