From: "Ira W. Snyder" <iws@ovro•caltech.edu>
To: Andre Schwarz <andre.schwarz@matrix-vision•de>
Cc: LinuxPPC List <linuxppc-dev@ozlabs•org>
Subject: Re: PCI DMA to user mem on mpc83xx
Date: Mon, 23 May 2011 10:27:27 -0700 [thread overview]
Message-ID: <20110523172727.GA21717@ovro.caltech.edu> (raw)
In-Reply-To: <4DDA2509.6070702@matrix-vision.de>
On Mon, May 23, 2011 at 11:12:41AM +0200, Andre Schwarz wrote:
> Ira,
>
> we have a pretty old PCI device driver here that needs some basic rework
> running on 2.6.27 on several MPC83xx.
> It's a simple char-device with "give me some data" implemented using
> read() resulting in zero-copy DMA to user mem.
>
> There's get_user_pages() working under the hood along with
> SetPageDirty() and page_cache_release().
>
> Main goal is to prepare a sg-list that gets fed into a DMA controller.
>
> I wonder if there's a more up-to-date/efficient and future proof scheme
> of creating the mapping.
>
>
> Could you provide some pointers or would you stick to the current scheme ?
>
This scheme is the best you'll come up with for zero-copy IO. I used
get_user_pages_fast(), but otherwise my implementation was the same.
These interfaces should be fairly future proof.
In the end, I realized that most of my transfers were 4 bytes in length,
and zero copy IO was a waste of effort. I decided to use mmap instead.
Ira
next prev parent reply other threads:[~2011-05-23 17:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-23 9:12 PCI DMA to user mem on mpc83xx Andre Schwarz
2011-05-23 17:27 ` Ira W. Snyder [this message]
2011-05-24 9:47 ` Andre Schwarz
2011-05-24 8:15 ` David Laight
2011-05-24 10:02 ` Andre Schwarz
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=20110523172727.GA21717@ovro.caltech.edu \
--to=iws@ovro$(echo .)caltech.edu \
--cc=andre.schwarz@matrix-vision$(echo .)de \
--cc=linuxppc-dev@ozlabs$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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