Jens Axboe 9e973e64ac xen/blkfront: use blk_rq_map_sg to generate ring entries
On occasion, the request will apparently have more segments than we
fit into the ring. Jens says:

> The second problem is that the block layer then appears to create one
> too many segments, but from the dump it has rq->nr_phys_segments ==
> BLKIF_MAX_SEGMENTS_PER_REQUEST. I suspect the latter is due to
> xen-blkfront not handling the merging on its own. It should check that
> the new page doesn't form part of the previous page. The
> rq_for_each_segment() iterates all single bits in the request, not dma
> segments. The "easiest" way to do this is to call blk_rq_map_sg() and
> then iterate the mapped sg list. That will give you what you are
> looking for.

> Here's a test patch, compiles but otherwise untested. I spent more
> time figuring out how to enable XEN than to code it up, so YMMV!
> Probably the sg list wants to be put inside the ring and only
> initialized on allocation, then you can get rid of the sg on stack and
> sg_init_table() loop call in the function. I'll leave that, and the
> testing, to you.

[Moved sg array into info structure, and initialize once. -J]

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2009-02-26 10:45:48 +01:00
..
2009-02-18 10:32:01 +01:00
2008-10-21 07:47:44 -04:00
2005-04-16 15:20:36 -07:00
2008-10-21 07:47:36 -04:00
2008-10-10 22:39:21 +02:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2009-02-11 14:25:37 -08:00
2005-04-16 15:20:36 -07:00
2008-10-21 07:48:03 -04:00
2008-10-21 07:48:07 -04:00
2008-10-21 07:48:11 -04:00
2008-10-21 07:48:11 -04:00
2008-10-21 07:48:17 -04:00