From: Stefani Seibold <stefani@seibold.net>
To: "Ira W. Snyder" <iws@ovro.caltech.edu>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Andi Kleen <andi@firstfloor.org>,
Greg Kroah-Hartman <gregkh@suse.de>,
Alan Cox <alan@lxorguk.ukuu.org.uk>, Theodore Tso <tytso@mit.edu>
Subject: Re: [PATCH] enhanced reimplemented of the kfifo API
Date: Fri, 15 Jan 2010 23:05:07 +0100 [thread overview]
Message-ID: <1263593107.8935.1.camel@wall-e> (raw)
In-Reply-To: <20100115220153.GE10591@ovro.caltech.edu>
Am Freitag, den 15.01.2010, 14:01 -0800 schrieb Ira W. Snyder:
> On Fri, Jan 15, 2010 at 10:30:01PM +0100, Stefani Seibold wrote:
> >
> > > I'm glad to see this example, it really illustrates how to use the new
> > > DMA functionality of the kfifo API.
> > >
> > > Is there any reason why a very large scatterlist could not be used? I
> > > have a driver that uses a large scatterlist (~4000 entries, allocated as
> > > a struct sg_table). I implemented my own copy_from_user() functionality
> > > into this scatterlist, but I'd love to use the kfifo DMA API instead.
> > > After filling the scatterlist, I use the usual DMA API's to transfer it
> > > to my device.
> > >
> >
> > No, but the API will only return max. two entries.
> >
>
> Ah, I see. __kfifo_alloc() uses kmalloc() internally. The kfifo API will
> not work for my purposes then, since I want to allocate a 16MB chunk of
> memory, and I'm very uncomfortable doing that with kmalloc(). I'll stick
> with my custom scatterlist code, which uses alloc_page() to fill in the
> scatterlist with order-0 allocations.
>
I think you can use vmalloc() instead and assign this buffer with
kfifo_init().
> Another nitpick in the code: I've noticed that you use sgl++ in the
> setup_sgl() function. That should become "sgl = sg_next(sgl);" so that
> this code can work with an struct sg_table as well.
No, its by definition an array. You cannot pass as struct sg_table to
the kfifo_dma_* functions.
Stefani
next prev parent reply other threads:[~2010-01-15 22:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-15 9:06 [PATCH] enhanced reimplemented of the kfifo API Stefani Seibold
2010-01-15 19:20 ` Ira W. Snyder
2010-01-15 21:30 ` Stefani Seibold
2010-01-15 22:01 ` Ira W. Snyder
2010-01-15 22:05 ` Stefani Seibold [this message]
2010-01-15 23:38 ` Ira W. Snyder
2010-01-16 7:25 ` Stefani Seibold
-- strict thread matches above, loose matches on Subject: below --
2010-01-14 16:39 Stefani Seibold
2010-01-06 11:12 Stefani Seibold
2010-01-06 17:03 ` tytso
2010-01-06 17:32 ` Stefani Seibold
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=1263593107.8935.1.camel@wall-e \
--to=stefani@seibold.net \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=andi@firstfloor.org \
--cc=gregkh@suse.de \
--cc=iws@ovro.caltech.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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