Re: [PATCH 5/6] IB core: Fix ib_sg_to_pages()

2015-12-06 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 5/6] IB core: Fix ib_sg_to_pages()

2015-12-06 Thread Sagi Grimberg
Looks fine, Reviewed-by: Sagi Grimberg -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 5/6] IB core: Fix ib_sg_to_pages()

2015-12-03 Thread Bart Van Assche
On 12/03/2015 01:18 AM, Christoph Hellwig wrote: > The patch looks good to me, but while we touch this area, how about > throwing in a few cosmetic fixes as well? How about the patch below ? In that version of the ib_sg_to_pages() fix these concerns have been addressed and additionally to more bu

Re: [PATCH 5/6] IB core: Fix ib_sg_to_pages()

2015-12-03 Thread Christoph Hellwig
> How about the patch below ? The patch looks good to me, but while we touch this area, how about throwing in a few cosmetic fixes as well? > - if (i && page_addr != dma_addr) { > + if (i && (page_addr != dma_addr || last_page_off != 0)) { > if (last_

Re: [PATCH 5/6] IB core: Fix ib_sg_to_pages()

2015-12-03 Thread Sagi Grimberg
Hello Sagi, Hmm ... why would it be unacceptable to return 0 if sg_nents == 0 ? Regarding which component to modify if mapping the first page fails: for almost every kernel function I know a negative return value means failure and a return value >= 0 means success. Hence my proposal to change

Re: [PATCH 5/6] IB core: Fix ib_sg_to_pages()

2015-12-02 Thread Bart Van Assche
On 12/02/2015 01:31 AM, Sagi Grimberg wrote: > On 01/12/2015 21:10, Bart Van Assche wrote: >> On 12/01/2015 10:32 AM, Sagi Grimberg wrote: >> How ib_sg_to_pages() reports to its caller that mapping the first >> scatterlist element failed is not important to me. I included that >> change in this pat

Re: [PATCH 5/6] IB core: Fix ib_sg_to_pages()

2015-12-02 Thread Sagi Grimberg
On 01/12/2015 21:10, Bart Van Assche wrote: On 12/01/2015 10:32 AM, Sagi Grimberg wrote: Fix the code for detecting gaps and disable the code for chunking. A gap occurs not only if the second or later scatterlist element is not aligned but also if any scatterlist element other than the last do

Re: [PATCH 5/6] IB core: Fix ib_sg_to_pages()

2015-12-01 Thread Bart Van Assche
On 12/01/2015 10:32 AM, Sagi Grimberg wrote: Fix the code for detecting gaps and disable the code for chunking. A gap occurs not only if the second or later scatterlist element is not aligned but also if any scatterlist element other than the last does not end at a page boundary. Disable the code

Re: [PATCH 5/6] IB core: Fix ib_sg_to_pages()

2015-12-01 Thread Sagi Grimberg
Hi Bart, Fix the code for detecting gaps and disable the code for chunking. A gap occurs not only if the second or later scatterlist element is not aligned but also if any scatterlist element other than the last does not end at a page boundary. Disable the code for chunking. So can you explain

[PATCH 5/6] IB core: Fix ib_sg_to_pages()

2015-12-01 Thread Bart Van Assche
Fix the code for detecting gaps and disable the code for chunking. A gap occurs not only if the second or later scatterlist element is not aligned but also if any scatterlist element other than the last does not end at a page boundary. Disable the code for chunking. Ensure that this function return