Linux-RDMA Archive mirror
 help / color / mirror / Atom feed
From: "Zhijian Li (Fujitsu)" <lizhijian@fujitsu.com>
To: Honggang LI <honggangli@163.com>,
	"zyjzyj2000@gmail.com" <zyjzyj2000@gmail.com>,
	"jgg@ziepe.ca" <jgg@ziepe.ca>,
	"leon@kernel.org" <leon@kernel.org>
Cc: "linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>
Subject: Re: [PATCH] RDMA/rxe: Fix data copy for IB_SEND_INLINE
Date: Fri, 17 May 2024 01:43:59 +0000	[thread overview]
Message-ID: <ef948dee-a65e-4c8c-a8ab-12cc06634b17@fujitsu.com> (raw)
In-Reply-To: <20240516095052.542767-1-honggangli@163.com>



On 16/05/2024 17:50, Honggang LI wrote:
> For RDMA Send and Write with IB_SEND_INLINE, the memory buffers
> specified in sge list will be placed inline in the Send Request.
> 
> The data should be copied by CPU from the virtual addresses of
> corresponding sge list DMA addresses.
> 
> Fixes: 8d7c7c0eeb74 ("RDMA: Add ib_virt_dma_to_page()")
> Signed-off-by: Honggang LI <honggangli@163.com>

Good catch.

Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>

(BTW, Does it mean current pyverb tests in rdma-core have not covered IB_SEND_INLINE)


> ---
>   drivers/infiniband/sw/rxe/rxe_verbs.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c
> index 614581989b38..b94d05e9167a 100644
> --- a/drivers/infiniband/sw/rxe/rxe_verbs.c
> +++ b/drivers/infiniband/sw/rxe/rxe_verbs.c
> @@ -812,7 +812,7 @@ static void copy_inline_data_to_wqe(struct rxe_send_wqe *wqe,
>   	int i;
>   
>   	for (i = 0; i < ibwr->num_sge; i++, sge++) {
> -		memcpy(p, ib_virt_dma_to_page(sge->addr), sge->length);
> +		memcpy(p, ib_virt_dma_to_ptr(sge->addr), sge->length);
>   		p += sge->length;
>   	}
>   }

  parent reply	other threads:[~2024-05-17  1:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-16  9:50 [PATCH] RDMA/rxe: Fix data copy for IB_SEND_INLINE Honggang LI
2024-05-16 13:24 ` Zhu Yanjun
2024-05-17  1:43 ` Zhijian Li (Fujitsu) [this message]
2024-05-17 10:47   ` Zhijian Li (Fujitsu)
2024-05-24 15:05 ` Jason Gunthorpe
2024-05-30 13:20 ` 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=ef948dee-a65e-4c8c-a8ab-12cc06634b17@fujitsu.com \
    --to=lizhijian@fujitsu.com \
    --cc=honggangli@163.com \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=zyjzyj2000@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).