public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alon Ziv <alon@nolaviz.org>
To: linux-kernel@vger.kernel.org
Subject: Preferred kernel API/ABI for accelerator hardware device driver
Date: Sun, 31 May 2009 14:15:41 +0300	[thread overview]
Message-ID: <001401c9e1e1$2a68eb20$7f3ac160$@org> (raw)

Hi

I am looking for advice on the proper design of an API for a device driver
for hardware acceleration (e.g. a JPEG decoder or a cryptographic function
accelerator).  These hardware modules don’t appear to map properly to the
standard device-driver paradigm (i.e., a “device file” that communicates
with userspace using read()/write() system calls), as we need to pass input
data into the kernel and receive transformed output directly. The only way I
see to use standard IO operations on such drivers is by copying the data
into temporary kernel buffers, which is (a) a pain and (b) horribly
inefficient.

Currently the only way I see around this limitation is to implement all
communications with such a driver using ioctl() operations, but this isn’t a
very satisfactory solution—for example, it does not provide a way to do
something similar to “writev()” (gathering several buffers for a single
processing operation).

Should I just take the plunge and implement a new “iov(fd, iov_in,
iovcnt_in, iov_out, iovcnt_out)” system call?
Does anyone have a better idea for an interface that will allow zero-copy
interfacing to a transformation driver from userspace?

                -az




                 reply	other threads:[~2009-05-31 11:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='001401c9e1e1$2a68eb20$7f3ac160$@org' \
    --to=alon@nolaviz.org \
    --cc=linux-kernel@vger.kernel.org \
    /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