All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: "M. Koehrer" <mathias_koehrer@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] RTDM and user space hardware drivers
Date: Sun, 18 Mar 2007 11:34:37 +0100	[thread overview]
Message-ID: <45FD15BD.8000702@domain.hid> (raw)
In-Reply-To: <17648569.1173693688643.JavaMail.ngmail@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 1841 bytes --]

M. Koehrer wrote:
> Hi everybody,
> 
> the RTDM API is really very good as API for drivers. 
> I have a real time (Xenomai) application in user space that has to access PCI boards.
> The "classical" approach is now to use a kernel driver and to use RTDM as interface
> between the user space application an the kernel space driver.
> However, for performance issues, I prefer to write a pure user mode driver.
> As the memory of the PCI board can be accesses from user space (using /dev/mem) 
> I want to write a pure user space driver  as this seems to me more efficient (and easier to debug) than
> a kernel driver.
> Also, only one application is accessing the driver at a time, I can link the driver directly to my application.
> 
> My questions are now:
> 1. Is it possible to use the RTDM API also for pure user space drivers?

There is no RTDM driver API exported to user space yet, it's still just
a plan for the future.

> 
> 2. Is there any experience concerning the performance of a user space driver versus a kernel space
> driver?
> In my use case, I have to write and read about 60 byte (each direction) of (block) data to/from the PCI I/O system.

User space drivers can improve performance if you transfer a lot of data
and save potential user/kernel copy-steps this way (though, zero-copy
can also be realised with kernel drivers) or if you do a lot of driver
calls and the call-overhead becomes noticeable. This works fairly well
for exclusive devices (only one user process at a time). But once you
have to share/multiplex a devices, performance quickly becomes worse.

When going for a user space driver design, make sure you keep a clean
separation between driver and application. [It will be one major goal of
an RTDM for user space to support driver writers in this regard.]

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

      parent reply	other threads:[~2007-03-18 10:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-12 10:01 [Xenomai-help] RTDM and user space hardware drivers M. Koehrer
2007-03-12 11:33 ` Stéphane ANCELOT
2007-03-18 10:34 ` Jan Kiszka [this message]

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=45FD15BD.8000702@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=mathias_koehrer@domain.hid \
    --cc=xenomai@xenomai.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 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.