All of lore.kernel.org
 help / color / mirror / Atom feed
From: Devesh Sharma <devesh.s.sharma@oracle.com>
To: Jason Gunthorpe <jgg@nvidia.com>,
	Leon Romanovsky <leon@kernel.org>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>
Cc: Aharon Landau <aharonl@nvidia.com>,
	Leon Romanovsky <leonro@nvidia.com>,
	Michael Guralnik <michaelgur@nvidia.com>
Subject: RE: [PATCH] RDMA/mlx5: Use rdma_umem_for_each_dma_block()
Date: Tue, 14 Feb 2023 04:17:00 +0000	[thread overview]
Message-ID: <CO6PR10MB5635AF77EED755B4F91B4E9FDDA29@CO6PR10MB5635.namprd10.prod.outlook.com> (raw)
In-Reply-To: <0-v1-c13a5b88359b+556d0-mlx5_umem_block_jgg@nvidia.com>



> -----Original Message-----
> From: Jason Gunthorpe <jgg@nvidia.com>
> Sent: Monday, February 13, 2023 11:44 PM
> To: Leon Romanovsky <leon@kernel.org>; linux-rdma@vger.kernel.org
> Cc: Aharon Landau <aharonl@nvidia.com>; Leon Romanovsky
> <leonro@nvidia.com>; Michael Guralnik <michaelgur@nvidia.com>
> Subject: [PATCH] RDMA/mlx5: Use rdma_umem_for_each_dma_block()
> 
> Replace an open coding of rdma_umem_for_each_dma_block() with the
> proper function.
> 
> Fixes: b3d47ebd4908 ("RDMA/mlx5: Use mlx5_umr_post_send_wait() to
> update MR pas")
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> ---
>  drivers/infiniband/hw/mlx5/umr.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx5/umr.c
> b/drivers/infiniband/hw/mlx5/umr.c
> index 029e9536ec28f2..55f4e048d94743 100644
> --- a/drivers/infiniband/hw/mlx5/umr.c
> +++ b/drivers/infiniband/hw/mlx5/umr.c
> @@ -636,9 +636,7 @@ int mlx5r_umr_update_mr_pas(struct mlx5_ib_mr
> *mr, unsigned int flags)
>  	mlx5r_umr_set_update_xlt_data_seg(&wqe.data_seg, &sg);
> 
>  	cur_mtt = mtt;
> -	rdma_for_each_block(mr->umem->sgt_append.sgt.sgl, &biter,
> -			    mr->umem->sgt_append.sgt.nents,
> -			    BIT(mr->page_shift)) {
> +	rdma_umem_for_each_dma_block(mr->umem, &biter, BIT(mr-
> >page_shift)) {
>  		if (cur_mtt == (void *)mtt + sg.length) {
>  			dma_sync_single_for_device(ddev, sg.addr,
> sg.length,
>  						   DMA_TO_DEVICE);
> 

Looks good!

Reviewed-by: Devesh Sharma <devesh.s.sharma@oracle.com>

> base-commit: 627122280c878cf5d3cda2d2c5a0a8f6a7e35cb7
> --
> 2.39.1


  reply	other threads:[~2023-02-14  4:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 18:14 [PATCH] RDMA/mlx5: Use rdma_umem_for_each_dma_block() Jason Gunthorpe
2023-02-14  4:17 ` Devesh Sharma [this message]
2023-02-15 11:22 ` Leon Romanovsky

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=CO6PR10MB5635AF77EED755B4F91B4E9FDDA29@CO6PR10MB5635.namprd10.prod.outlook.com \
    --to=devesh.s.sharma@oracle.com \
    --cc=aharonl@nvidia.com \
    --cc=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=leonro@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=michaelgur@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.