All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] RTDM and user space hardware drivers
@ 2007-03-12 10:01 M. Koehrer
  2007-03-12 11:33 ` Stéphane ANCELOT
  2007-03-18 10:34 ` Jan Kiszka
  0 siblings, 2 replies; 3+ messages in thread
From: M. Koehrer @ 2007-03-12 10:01 UTC (permalink / raw)
  To: xenomai

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?

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.

Thanks for any ideas or hints on that!

Regards

Mathias


-- 
Mathias Koehrer
mathias_koehrer@domain.hid


Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren
ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor: günstig
und schnell mit DSL - das All-Inclusive-Paket für clevere Doppel-Sparer,
nur  39,85 €  inkl. DSL- und ISDN-Grundgebühr!
http://www.arcor.de/rd/emf-dsl-2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Xenomai-help] RTDM and user space hardware drivers
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Stéphane ANCELOT @ 2007-03-12 11:33 UTC (permalink / raw)
  To: M. Koehrer; +Cc: xenomai

Hi,

I think you need only a standard kernel driver that mmaps the memory 
area of your pci board.

Thus, from user space program , you mmap it and can do whatever you want 
in userspace world

Best Regards
steph



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?
> 
> 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.
> 
> Thanks for any ideas or hints on that!
> 
> Regards
> 
> Mathias
> 
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Xenomai-help] RTDM and user space hardware drivers
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Kiszka @ 2007-03-18 10:34 UTC (permalink / raw)
  To: M. Koehrer; +Cc: xenomai

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-03-18 10:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.