From: David Muench <davemuench@gmail.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: ivtv-devel@lists.sourceforge.net, xen-devel@lists.xensource.com
Subject: Re: [ivtv-devel] Problems loading ivtv in Xen - DMA issues?
Date: Thu, 7 Jul 2005 12:07:26 -0400 [thread overview]
Message-ID: <bc0c36d30507070907307b7a8e@mail.gmail.com> (raw)
In-Reply-To: <1120750950.1556.24.camel@mud>
Hi Keir,
I recieved this reply to my request for help with ivtv on Xen on the
ivtv-devel list. I don't feel very well qualified to respond to
Andrew. Can I ask what your thoughts are? Am I just out of luck?
Thanks,
Dave
On 7/7/05, Andrew May <acmay@acmay.homeip.net> wrote:
> On Wed, 2005-07-06 at 10:20 -0400, David Muench wrote:
> > "I think the ivtv driver is probably not calculating dma addresses in
> > the way that xen requires. On native Linux, if you allocate a
> > multi-page chunk of physical memory, you can pass the start address of
> > that buffer to hardware and it can dma the entire buffer given just
> > that address. In Xen, because we give guests 'pseudo-physical' memory,
> > that physical buffer may not be really physically contiguous. So we
> > need drivers to dma_alloc_coherent or pci_alloc_consistent the memory
> > they will use for dma --- we modified those functions to ensure they
> > return suitable contiguous physical memory."
>
> The Xen people seem to be a bit off here. You may want to look at
> linux/Documentation/DMA-mapping.txt.
>
> But alloc_coherent and alloc_consistent are for uncached mem for DMA and
> that is very different than normal mem for DMA. That could really slow
> things down when getting the data out of buffers latter.
>
> pci_map_single is correct for doing bulk dma to normal kmalloc data.
>
> The coherent/consistent mem doesn't make much sense on x86 stuff, but
> for other archs like some PPC ones without cache snooping mem it becomes
> a big issue. The CPU and the DMA device cannot write to the same
> cacheline of data without causing havoc. The CPU would work with
> the data in cache, but the DMA would go directly to DRAM. When the
> cache flush does happen it would overwrite half the work done.
>
> This only comes into play on a smaller ring of descriptors for most HW.
>
> If the bulk of the data is only touched by one device at a time, then
> the map_single function just needs to do a cache flush before the
> transfer happens along with the other work.
>
> I am much more familar with network drivers where it is common for one
> consistent set of mem for the descriptors, but all the packets do just
> the map_single(). But since jumbo frames aren't typical yet, the packets
> all fit in one page.
>
> So it looks like the Xen people have some work to do if they really want
> to support any type of DMA device.
>
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> ivtv-devel mailing list
> ivtv-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ivtv-devel
>
--
David Muench - davemuench@gmail.com
Jabber ID: dave@jabber.wasteland.org
next parent reply other threads:[~2005-07-07 16:07 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bc0c36d305070607205e82ea14@mail.gmail.com>
[not found] ` <1120750950.1556.24.camel@mud>
2005-07-07 16:07 ` David Muench [this message]
2005-07-07 17:22 ` [ivtv-devel] Problems loading ivtv in Xen - DMA issues? Keir Fraser
2005-07-07 17:34 ` David Muench
2005-07-08 4:01 ` Andrew May
2005-07-08 13:05 ` Keir Fraser
2005-07-08 15:38 ` David Muench
2005-07-08 16:50 ` Keir Fraser
2005-07-11 10:10 ` Keir Fraser
2005-07-11 13:08 ` David Muench
2005-07-11 13:20 ` Keir Fraser
2005-07-13 19:51 ` David Muench
2005-07-13 22:06 ` Keir Fraser
2005-07-15 12:43 ` David Muench
2005-07-15 12:50 ` Keir Fraser
2005-07-15 12:57 ` David Muench
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=bc0c36d30507070907307b7a8e@mail.gmail.com \
--to=davemuench@gmail.com \
--cc=Keir.Fraser@cl.cam.ac.uk \
--cc=ivtv-devel@lists.sourceforge.net \
--cc=xen-devel@lists.xensource.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.