[openib-general] [PATCH 5/6] [RFC] iser handling of memory for RDMA

Or Gerlitz ogerlitz at voltaire.com
Thu Feb 23 01:52:05 PST 2006


Christoph Hellwig wrote:
>> +	if (cmd_dir == ISER_DIR_OUT) {
>> +		/* copy the unaligned sg the buffer which is used for RDMA */
>> +		struct scatterlist *p_sg = (struct scatterlist *)p_mem->p_buf;
>> +		int i;
>> +		char *p;
>> +
>> +		for (p = mem, i = 0; i < p_mem->size; i++) {
>> +			memcpy(p,
>> +			       page_address(p_sg[i].page) + p_sg[i].offset,
>> +			       p_sg[i].length);
>> +			p += p_sg[i].length;

> pages you get sent down in a sg list don't have to be kernel mapped,
> you need to use kmap or kmap_atomic to access them.

OK

Can you educate me here a little... basically what i was thinking about 
dma mapping is that it maps from kernel virtual address to the bus 
address related to the device and SG sent down to a LLD from the 
midlayer can be supplied to dma_map_sg.

Since that was my thought i assumed using page_address(sg->page) is fine

So what you say here is that there are cases (eg highmem) where 
dma_map_sg does not assume such mapping currently exist? nor the LLD can 
  assume this.

Or.






More information about the general mailing list