mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Leon Woestenberg <leon.woestenberg@gmail.com>
To: Steve Rottinger <steve@pentek.com>
Cc: Jens Axboe <jens.axboe@oracle.com>, linux-kernel@vger.kernel.org
Subject: Re: splice methods in character device driver
Date: Wed, 3 Jun 2009 23:32:56 +0200	[thread overview]
Message-ID: <c384c5ea0906031432x2675c5a4xcc940a567ca408b8@mail.gmail.com> (raw)
In-Reply-To: <4A0AFC62.3090002@pentek.com>

Hello all,

On Wed, May 13, 2009 at 6:59 PM, Steve Rottinger <steve@pentek.com> wrote:
> is passing in the pages into splice_to_pipe.  The pages are associated
> with a PCI BAR, not main memory.  I'm wondering if this could be a problem?
>
Good question; my newbie answer would be the pages need to be mapped
in kernel space.

I have a similar use case but with memory being DMA'd to host main
memory (instead of the data sitting in your PCI device) in a character
device driver. The driver is a complete rewrite from scratch from
what's currently sitting-butt-ugly in staging/altpcichdma.c
so-please-don't-look-there.

I have already implemented zero-latency overlapping transfers in the
DMA engine (i.e. it never sits idle if async I/O is performed through
threads), now it would be really cool to add zero-copy.

What is it my driver is expected to do?

.splice_read:

- Allocate a bunch of single pages
- Create a scatter-gather list
- "stuff the data pages in question into a struct page *pages[]." a la
"fs/splice.c:vmsplice_to_pipe()"
- Start the DMA from the device to the pages (i.e. the transfer)
- Return.

.splice_write:

- Create a scatter-gather list

interrupt handler / DMA service routine:
- device book keeping
- wake_up_interruptible(transfer_queue)

.confirm():

"then you need to provide a suitable ->confirm() hook that can wait on
this IO to complete if needed."
- wait_on_event_interruptibe(transfer_queue)

.release():

- release the pages

.steal():

unsure

.map

unsure

Regards,
-- 
Leon

  reply	other threads:[~2009-06-03 21:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-11 14:40 Steve Rottinger
2009-05-11 19:22 ` Jens Axboe
2009-05-13 16:59   ` Steve Rottinger
2009-06-03 21:32     ` Leon Woestenberg [this message]
2009-06-04  7:32       ` Jens Axboe
2009-06-04 13:20         ` Steve Rottinger
2009-06-12 19:21           ` Leon Woestenberg
2009-06-12 19:59             ` Jens Axboe
2009-06-12 20:45             ` Steve Rottinger
2009-06-16 11:59               ` Jens Axboe
2009-06-16 15:06                 ` Steve Rottinger
2009-06-16 18:24                   ` [RFC][PATCH] add support for shrinking/growing a pipe (Was "Re: splice methods in character device driver") Jens Axboe
2009-06-16 18:28                   ` splice methods in character device driver Jens Axboe
2009-06-06 21:25   ` Leon Woestenberg
2009-06-08  7:05     ` Jens Axboe
2009-06-12 22:05       ` Leon Woestenberg
2009-06-13  7:26         ` Jens Axboe
2009-06-13 20:04           ` Leon Woestenberg
2009-06-16 11:57             ` Jens Axboe

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=c384c5ea0906031432x2675c5a4xcc940a567ca408b8@mail.gmail.com \
    --to=leon.woestenberg@gmail.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=steve@pentek.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

all inboxes | Powered by JetHome®