netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Duyck <alexander.h.duyck@intel.com>
To: ratheesh kannoth <ratheesh.ksz@gmail.com>
Cc: e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org
Subject: Re: [E1000-devel] dma_map_page and dma_map_single
Date: Thu, 25 Oct 2012 09:21:54 -0700	[thread overview]
Message-ID: <50896722.1050307@intel.com> (raw)
In-Reply-To: <CAGZFCEGLhEp7+sD98-HjQFwbkVo70M2OWh29Y+yG5xwbm82obw@mail.gmail.com>

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
>

      reply	other threads:[~2012-10-25 16:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25  8:58 dma_map_page and dma_map_single ratheesh kannoth
2012-10-25 16:21 ` Alexander Duyck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50896722.1050307@intel.com \
    --to=alexander.h.duyck@intel.com \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=netdev@vger.kernel.org \
    --cc=ratheesh.ksz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).