On Tue, 2019-02-05 at 16:36 +-0000, Jason Gunthorpe wrote: +AD4 On Tue, Feb 05, 2019 at 08:33:44AM -0800, Bart Van Assche wrote: +AD4 +AD4 On Mon, 2019-02-04 at 19:50 +-0200, Max Gurtovoy wrote: +AD4 +AD4 +AD4 +AFs ... +AF0 +AD4 +AD4 +AD4 +-/+ACo +AD4 +AD4 +AD4 +- +ACo struct ib+AF8-scatterlist - Mapped scatterlist for RDMA operations +AD4 +AD4 +AD4 +- +ACo +AEA-sg: dma mapped sg list +AD4 +AD4 +AD4 +- +ACo +AEA-dma+AF8-nents: returned by dma+AF8-map+AF8-sg +AD4 +AD4 +AD4 +- +ACo +AEA-offset: start offset in bytes into the first sg element +AD4 +AD4 +AD4 +- +ACo-/ +AD4 +AD4 +AD4 +-struct ib+AF8-scatterlist +AHs +AD4 +AD4 +AD4 +- struct scatterlist +ACo-sg+ADs +AD4 +AD4 +AD4 +- int dma+AF8-nents+ADs +AD4 +AD4 +AD4 +- unsigned int offset+ADs +AD4 +AD4 +AD4 +-+AH0AOw +AD4 +AD4 +AD4 +AD4 There is nothing in this data structure that is RDMA specific. Are you sure +AD4 +AD4 the name +ACI-ib+AF8-scatterlist+ACI is a good choice? +AD4 +AD4 Why do we need an offset anyhow? What is that? +AD4 +AD4 Is that actually the MR virtual base address? Hi Jason, You may want to have a look at the following commit: commit 9aa8b3217ed3c13d4e3496020b140da0e6f49a08 Author: Bart Van Assche +ADw-bart.vanassche+AEA-sandisk.com+AD4 Date: Thu May 12 10:49:15 2016 -0700 IB/core: Enhance ib+AF8-map+AF8-mr+AF8-sg() The SRP initiator allows to set max+AF8-sectors to a value that exceeds the largest amount of data that can be mapped at once with an mlx4 HCA using fast registration and a page size of 4 KB. Hence modify ib+AF8-map+AF8-mr+AF8-sg() such that it can map partial sg-elements. If an sg-element has been mapped partially, let the caller know which fraction has been mapped by adjusting +ACo-sg+AF8-offset. +AFs .... +AF0 +- +ACo +AEA-sg+AF8-offset+AF8-p: IN: start offset in bytes into sg +- +ACo OUT: offset in bytes for element n of the sg of the first +- +ACo byte that has not been processed where n is the return +- +ACo value of this function. +AFs .... +AF0 int ib+AF8-sg+AF8-to+AF8-pages(struct ib+AF8-mr +ACo-mr, struct scatterlist +ACo-sgl, int sg+AF8-nents, - unsigned int sg+AF8-offset, int (+ACo-set+AF8-page)(struct ib+AF8-mr +ACo, u64)) +- unsigned int +ACo-sg+AF8-offset+AF8-p, int (+ACo-set+AF8-page)(struct ib+AF8-mr +ACo, u64)) +AFs ... +AF0 Bart.