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

Christoph Hellwig hch at lst.de
Wed Feb 22 08:29:03 PST 2006


> +	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.




More information about the general mailing list