DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Please stop using iopl() in DPDK
@ 2019-10-25  4:45 Andy Lutomirski
  2019-10-25  6:42 ` Willy Tarreau
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Andy Lutomirski @ 2019-10-25  4:45 UTC (permalink / raw)
  To: dev, Thomas Gleixner, Peter Zijlstra, LKML

Hi all-

Supporting iopl() in the Linux kernel is becoming a maintainability
problem.  As far as I know, DPDK is the only major modern user of
iopl().

After doing some research, DPDK uses direct io port access for only a
single purpose: accessing legacy virtio configuration structures.
These structures are mapped in IO space in BAR 0 on legacy virtio
devices.

There are at least three ways you could avoid using iopl().  Here they
are in rough order of quality in my opinion:

1. Change pci_uio_ioport_read() and pci_uio_ioport_write() to use
read() and write() on resource0 in sysfs.

2. Use the alternative access mechanism in the virtio legacy spec:
there is a way to access all of these structures via configuration
space.

3. Use ioperm() instead of iopl().


We are considering changes to the kernel that will potentially harm
the performance of any program that uses iopl(3) -- in particular,
context switches will become more expensive, and the scheduler might
need to explicitly penalize such programs to ensure fairness.  Using
ioperm() already hurts performance, and the proposed changes to iopl()
will make it even worse.  Alternatively, the kernel could drop iopl()
support entirely.  I will certainly make a change to allow
distributions to remove iopl() support entirely from their kernels,
and I expect that distributions will do this.

Please fix DPDK.

Thanks,
Andy

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

end of thread, other threads:[~2019-10-30 10:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-25  4:45 [dpdk-dev] Please stop using iopl() in DPDK Andy Lutomirski
2019-10-25  6:42 ` Willy Tarreau
2019-10-25 14:45   ` Andy Lutomirski
2019-10-25 15:03     ` Willy Tarreau
2019-10-27 23:44     ` Maciej W. Rozycki
2019-10-28 16:42   ` Stephen Hemminger
2019-10-28 18:00     ` Andy Lutomirski
2019-10-28 20:13     ` Willy Tarreau
2019-10-25  7:22 ` David Marchand
2019-10-25 16:13 ` Stephen Hemminger
2019-10-25 20:43   ` Thomas Gleixner
2019-10-26  0:27   ` Andy Lutomirski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).