Message ID | 1549560811-8655-1-git-send-email-maxg@mellanox.com (mailing list archive) |
---|---|
Headers | show |
Series | Introduce new API for T10-PI offload | expand |
On Thu, Feb 07, 2019 at 07:33:14PM +0200, Max Gurtovoy wrote: > Hello Sagi, Christoph, Keith, Jason, Doug, Leon and Co > Jason, Doug, I reviewed it internally, so on all series. Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
What tree is this against? It fails to apply to Linus' master tree for me with conflicts in the iser code.
On 2/12/2019 5:57 PM, Christoph Hellwig wrote: > What tree is this against? It fails to apply to Linus' master tree > for me with conflicts in the iser code. As mentioned in the cover letter it applies on kernel 5.0-rc5 + iser patch ("IB/iser: Pass the correct number of entries for dma mapped SGL"). Iser patch is yet not in rc5 and that's why it's not applied cleanly. sorry for that :) From 19fd2a28b0817f10bbeb01185d4ff58a07128dda Mon Sep 17 00:00:00 2001 From: Israel Rukshin <israelr@mellanox.com> Date: Sun, 13 Jan 2019 12:56:57 +0000 Subject: [PATCH 1/1] IB/iser: Pass the correct number of entries for dma mapped SGL ib_dma_map_sg() augments the SGL into a 'dma mapped SGL'. This process may change the number of entries and the lengths of each entry. Code that touches dma_address is iterating over the 'dma mapped SGL' and must use dma_nents which returned from ib_dma_map_sg(). ib_sg_to_pages() and ib_map_mr_sg() are using dma_address so they must use dma_nents. Fixes: 39405885005a ("IB/iser: Port to new fast registration API") Fixes: bfe066e256d5 ("IB/iser: Reuse ib_sg_to_pages") Signed-off-by: Israel Rukshin <israelr@mellanox.com> Reviewed-by: Max Gurtovoy <maxg@mellanox.com> --- drivers/infiniband/ulp/iser/iser_memory.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c index e9b7efc302d0..394d1b9c2ff7 100644 --- a/drivers/infiniband/ulp/iser/iser_memory.c +++ b/drivers/infiniband/ulp/iser/iser_memory.c @@ -240,8 +240,8 @@ int iser_fast_reg_fmr(struct iscsi_iser_task *iser_task, page_vec->npages = 0; page_vec->fake_mr.page_size = SIZE_4K; plen = ib_sg_to_pages(&page_vec->fake_mr, mem->sg, - mem->size, NULL, iser_set_page); - if (unlikely(plen < mem->size)) { + mem->dma_nents, NULL, iser_set_page); + if (unlikely(plen < mem->dma_nents)) { iser_err("page vec too short to hold this SG\n"); iser_data_buf_dump(mem, device->ib_device); iser_dump_page_vec(page_vec); @@ -448,10 +448,10 @@ static int iser_fast_reg_mr(struct iscsi_iser_task *iser_task, ib_update_fast_reg_key(mr, ib_inc_rkey(mr->rkey)); - n = ib_map_mr_sg(mr, mem->sg, mem->size, NULL, SIZE_4K); - if (unlikely(n != mem->size)) { + n = ib_map_mr_sg(mr, mem->sg, mem->dma_nents, NULL, SIZE_4K); + if (unlikely(n != mem->dma_nents)) { iser_err("failed to map sg (%d/%d)\n", - n, mem->size); + n, mem->dma_nents); return n < 0 ? n : -EINVAL; }