On Oct 9, 2008, at 6:28 PM, FUJITA Tomonori wrote:
On Thu, 9 Oct 2008 11:08:37 -0700
Seokmann Ju <seokmann.ju@xxxxxxxxxx> wrote:
I've got a quick question on the blk_rq_map_sg() API usage.
In an efforts of implementing pass through support on FC transport
layer, the transport would call blk_rq_map_sg() API to map the pages
in the bio structure so that the LLD could DMA to/from the mapped
addresses - as specified in the section 2.2 of the ~/Documentation/
block/biodoc.txt.
To me, it seems like a right way to do..., could anyone comment on
this approach?
Sounds reasonable for me.
fc transport calls blk_rq_map_sg() and then llds easily call
dma_map_sg and do DMA transfer.
Yes, figured out that it needs to call dma_map_sg() after the
blk_rq_map_sg().
Also, I couldn't find symmetric counter-part for the API (i.e.,
blk_rq_unmap_sg() or similar).
Does this means that we don't need to unmap those addresses?
There is no symmetric counterpart for blk_rq_unmap_sg. All you need to
do is to free scatter lists. dma_map_sg maps addresses in scatter
lists to DMA-capable addresses. So you need to call its symmetric
counterpart, dma_unmap_sg after the completion of DMA transfer.
OK. Thanks for the clarification.
Seokmann
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html