linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mlx5: Fix mlx5_ib_map_mr_sg mr length
@ 2017-04-23 11:31 Sagi Grimberg
       [not found] ` <1492947102-3133-1-git-send-email-sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Sagi Grimberg @ 2017-04-23 11:31 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Bart Van Assche, Leon Romanovsky, Max Gurtuvoy

In case we got an initial sg_offset, we need to
account for it in the mr length.

Fixes: ff2ba9936591 ("IB/core: Add passing an offset into the SG to
ib_map_mr_sg")
Signed-off-by: Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
---
 drivers/infiniband/hw/mlx5/mr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
index b8f9382a8b7d..d9c6c0ea750b 100644
--- a/drivers/infiniband/hw/mlx5/mr.c
+++ b/drivers/infiniband/hw/mlx5/mr.c
@@ -1782,7 +1782,7 @@ mlx5_ib_sg_to_klms(struct mlx5_ib_mr *mr,
 		klms[i].va = cpu_to_be64(sg_dma_address(sg) + sg_offset);
 		klms[i].bcount = cpu_to_be32(sg_dma_len(sg) - sg_offset);
 		klms[i].key = cpu_to_be32(lkey);
-		mr->ibmr.length += sg_dma_len(sg);
+		mr->ibmr.length += sg_dma_len(sg) - sg_offset;
 
 		sg_offset = 0;
 	}
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] mlx5: Fix mlx5_ib_map_mr_sg mr length
       [not found] ` <1492947102-3133-1-git-send-email-sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
@ 2017-04-23 13:51   ` Max Gurtovoy
  2017-04-24 14:51   ` Israel Rukshin
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Max Gurtovoy @ 2017-04-23 13:51 UTC (permalink / raw)
  To: Sagi Grimberg, linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Bart Van Assche, Leon Romanovsky, Israel Rukshin



On 4/23/2017 2:31 PM, Sagi Grimberg wrote:
> In case we got an initial sg_offset, we need to
> account for it in the mr length.
>
> Fixes: ff2ba9936591 ("IB/core: Add passing an offset into the SG to
> ib_map_mr_sg")
> Signed-off-by: Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
> ---
>  drivers/infiniband/hw/mlx5/mr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
> index b8f9382a8b7d..d9c6c0ea750b 100644
> --- a/drivers/infiniband/hw/mlx5/mr.c
> +++ b/drivers/infiniband/hw/mlx5/mr.c
> @@ -1782,7 +1782,7 @@ mlx5_ib_sg_to_klms(struct mlx5_ib_mr *mr,
>  		klms[i].va = cpu_to_be64(sg_dma_address(sg) + sg_offset);
>  		klms[i].bcount = cpu_to_be32(sg_dma_len(sg) - sg_offset);
>  		klms[i].key = cpu_to_be32(lkey);
> -		mr->ibmr.length += sg_dma_len(sg);
> +		mr->ibmr.length += sg_dma_len(sg) - sg_offset;
>
>  		sg_offset = 0;
>  	}
>

Israel,
Can you please test it with our regression test suite (SRP can send 
sg_offset != 0) and send Tested-By signature ?
Also run Laurence scenario with SG_GAPS patch applied too.

thanks,
Max.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] mlx5: Fix mlx5_ib_map_mr_sg mr length
       [not found] ` <1492947102-3133-1-git-send-email-sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
  2017-04-23 13:51   ` Max Gurtovoy
@ 2017-04-24 14:51   ` Israel Rukshin
  2017-04-24 15:20   ` Bart Van Assche
  2017-05-01 18:58   ` Doug Ledford
  3 siblings, 0 replies; 5+ messages in thread
From: Israel Rukshin @ 2017-04-24 14:51 UTC (permalink / raw)
  To: Sagi Grimberg, linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Bart Van Assche, Leon Romanovsky, Max Gurtuvoy

On 4/23/2017 2:31 PM, Sagi Grimberg wrote:
> In case we got an initial sg_offset, we need to
> account for it in the mr length.
>
> Fixes: ff2ba9936591 ("IB/core: Add passing an offset into the SG to
> ib_map_mr_sg")
> Signed-off-by: Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
Tested-by: Israel Rukshin <israelr-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] mlx5: Fix mlx5_ib_map_mr_sg mr length
       [not found] ` <1492947102-3133-1-git-send-email-sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
  2017-04-23 13:51   ` Max Gurtovoy
  2017-04-24 14:51   ` Israel Rukshin
@ 2017-04-24 15:20   ` Bart Van Assche
  2017-05-01 18:58   ` Doug Ledford
  3 siblings, 0 replies; 5+ messages in thread
From: Bart Van Assche @ 2017-04-24 15:20 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org
  Cc: maxg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org

On Sun, 2017-04-23 at 14:31 +0300, Sagi Grimberg wrote:
> In case we got an initial sg_offset, we need to
> account for it in the mr length.
> 
> Fixes: ff2ba9936591 ("IB/core: Add passing an offset into the SG to
> ib_map_mr_sg")
> Signed-off-by: Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
> ---
>  drivers/infiniband/hw/mlx5/mr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
> index b8f9382a8b7d..d9c6c0ea750b 100644
> --- a/drivers/infiniband/hw/mlx5/mr.c
> +++ b/drivers/infiniband/hw/mlx5/mr.c
> @@ -1782,7 +1782,7 @@ mlx5_ib_sg_to_klms(struct mlx5_ib_mr *mr,
>  		klms[i].va = cpu_to_be64(sg_dma_address(sg) + sg_offset);
>  		klms[i].bcount = cpu_to_be32(sg_dma_len(sg) - sg_offset);
>  		klms[i].key = cpu_to_be32(lkey);
> -		mr->ibmr.length += sg_dma_len(sg);
> +		mr->ibmr.length += sg_dma_len(sg) - sg_offset;
>  
>  		sg_offset = 0;
>  	}

Hello Sagi,

Please add "Cc: <stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>" to this patch.

Thanks,

Bart.--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] mlx5: Fix mlx5_ib_map_mr_sg mr length
       [not found] ` <1492947102-3133-1-git-send-email-sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
                     ` (2 preceding siblings ...)
  2017-04-24 15:20   ` Bart Van Assche
@ 2017-05-01 18:58   ` Doug Ledford
  3 siblings, 0 replies; 5+ messages in thread
From: Doug Ledford @ 2017-05-01 18:58 UTC (permalink / raw)
  To: Sagi Grimberg, linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Bart Van Assche, Leon Romanovsky, Max Gurtuvoy

On Sun, 2017-04-23 at 14:31 +0300, Sagi Grimberg wrote:
> In case we got an initial sg_offset, we need to
> account for it in the mr length.
> 
> Fixes: ff2ba9936591 ("IB/core: Add passing an offset into the SG to
> ib_map_mr_sg")
> Signed-off-by: Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>

Cc: stable added and applied, thanks.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    GPG KeyID: B826A3330E572FDD
   
Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2017-05-01 18:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-23 11:31 [PATCH] mlx5: Fix mlx5_ib_map_mr_sg mr length Sagi Grimberg
     [not found] ` <1492947102-3133-1-git-send-email-sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
2017-04-23 13:51   ` Max Gurtovoy
2017-04-24 14:51   ` Israel Rukshin
2017-04-24 15:20   ` Bart Van Assche
2017-05-01 18:58   ` Doug Ledford

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 NNTP newsgroup(s).