* Re: [PATCH] RDMA/rxe: Fix data copy for IB_SEND_INLINE
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)
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Zhu Yanjun @ 2024-05-16 13:24 UTC (permalink / raw)
To: Honggang LI, zyjzyj2000, jgg, leon; +Cc: linux-rdma
On 16.05.24 11: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>
Thanks a lot.
Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Zhu Yanjun
> ---
> 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;
> }
> }
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] RDMA/rxe: Fix data copy for IB_SEND_INLINE
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)
2024-05-17 10:47 ` Zhijian Li (Fujitsu)
2024-05-24 15:05 ` Jason Gunthorpe
2024-05-30 13:20 ` Leon Romanovsky
3 siblings, 1 reply; 6+ messages in thread
From: Zhijian Li (Fujitsu) @ 2024-05-17 1:43 UTC (permalink / raw)
To: Honggang LI, zyjzyj2000@gmail.com, jgg@ziepe.ca, leon@kernel.org
Cc: linux-rdma@vger.kernel.org
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;
> }
> }
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] RDMA/rxe: Fix data copy for IB_SEND_INLINE
2024-05-17 1:43 ` Zhijian Li (Fujitsu)
@ 2024-05-17 10:47 ` Zhijian Li (Fujitsu)
0 siblings, 0 replies; 6+ messages in thread
From: Zhijian Li (Fujitsu) @ 2024-05-17 10:47 UTC (permalink / raw)
To: Honggang LI, zyjzyj2000@gmail.com, jgg@ziepe.ca, leon@kernel.org
Cc: linux-rdma@vger.kernel.org
On 17/05/2024 09:43, Zhijian Li (Fujitsu) wrote:
>
>
> 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)
At a glance, copy_inline_data_to_wqe() will only called from the ULP, not the rdma-core.
>
>
>> ---
>> 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;
>> }
>> }
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] RDMA/rxe: Fix data copy for IB_SEND_INLINE
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)
@ 2024-05-24 15:05 ` Jason Gunthorpe
2024-05-30 13:20 ` Leon Romanovsky
3 siblings, 0 replies; 6+ messages in thread
From: Jason Gunthorpe @ 2024-05-24 15:05 UTC (permalink / raw)
To: Honggang LI; +Cc: zyjzyj2000, leon, linux-rdma
On Thu, May 16, 2024 at 05:50:52PM +0800, 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>
> ---
> drivers/infiniband/sw/rxe/rxe_verbs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
This seems like a serious bug
Cc: stable@kernel.org
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Jason
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] RDMA/rxe: Fix data copy for IB_SEND_INLINE
2024-05-16 9:50 [PATCH] RDMA/rxe: Fix data copy for IB_SEND_INLINE Honggang LI
` (2 preceding siblings ...)
2024-05-24 15:05 ` Jason Gunthorpe
@ 2024-05-30 13:20 ` Leon Romanovsky
3 siblings, 0 replies; 6+ messages in thread
From: Leon Romanovsky @ 2024-05-30 13:20 UTC (permalink / raw)
To: zyjzyj2000, jgg, Honggang LI; +Cc: linux-rdma
On Thu, 16 May 2024 17:50:52 +0800, 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.
>
>
> [...]
Applied, thanks!
[1/1] RDMA/rxe: Fix data copy for IB_SEND_INLINE
https://git.kernel.org/rdma/rdma/c/03fa18a992d562
Best regards,
--
Leon Romanovsky <leon@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread