* dma_map_page and dma_map_single
@ 2012-10-25 8:58 ratheesh kannoth
2012-10-25 16:21 ` [E1000-devel] " Alexander Duyck
0 siblings, 1 reply; 2+ messages in thread
From: ratheesh kannoth @ 2012-10-25 8:58 UTC (permalink / raw)
To: e1000-devel, netdev
Hi ,
I was looking at tx_map ( igb-3.3.6 ) in igb driver. I could see that
dma_map_single is used for first buffer and dma_map_page is used for
the fragments.
What is the real difference between these api ? we can replace
dma_map_single with dma_map_page. then why we used dma_map_single
here ?.
Thanks,
Ratheesh
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [E1000-devel] dma_map_page and dma_map_single
2012-10-25 8:58 dma_map_page and dma_map_single ratheesh kannoth
@ 2012-10-25 16:21 ` Alexander Duyck
0 siblings, 0 replies; 2+ messages in thread
From: Alexander Duyck @ 2012-10-25 16:21 UTC (permalink / raw)
To: ratheesh kannoth; +Cc: e1000-devel, netdev
We use dma_map_single here because we have a virtual pointer and not a
page. If you look in the kernel at the file
include/asm-generic/dma-mapping-common.h you will see that
dma_map_single_attrs which is what ends up being called when we call
dma_map_single will convert the pointer to a page and then call
map_page. This way we don't have to place the overhead for the code
directly in our driver.
Thanks,
Alex
On 10/25/2012 01:58 AM, ratheesh kannoth wrote:
> Hi ,
>
> I was looking at tx_map ( igb-3.3.6 ) in igb driver. I could see that
> dma_map_single is used for first buffer and dma_map_page is used for
> the fragments.
>
> What is the real difference between these api ? we can replace
> dma_map_single with dma_map_page. then why we used dma_map_single
> here ?.
>
> Thanks,
> Ratheesh
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-10-25 16:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-25 8:58 dma_map_page and dma_map_single ratheesh kannoth
2012-10-25 16:21 ` [E1000-devel] " Alexander Duyck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).