[dpdk-dev] [PATCH v2 0/4] rework ioport access for virtio

David Marchand david.marchand at 6wind.com
Sun Feb 7 08:48:33 CET 2016


Introduce a new pci ioport api in eal to mask all arch / kernel driver
specifics.

- rte_eal_pci_ioport_map is responsible for initialising an rte_pci_ioport
  object that is used in subsequent calls, this function must be tweaked per
  architecture and per kernel driver,
- rte_eal_pci_ioport_read / rte_eal_pci_ioport_write uses a rte_pci_ioport
  object to read / write those resources,
- rte_eal_pci_ioport_unmap releases resources used by a rte_pci_ioport
  object if necessary.

There is still some more work to ensure intr handle are properly initialized
and released when used in conjonction with rte_eal_map_device() api calls.

BSD code has been neither run nor compiled, please can someone confirm I did
not break too much stuff ?

virtio legacy code has been updated accordingly.
With this, virtio code should be ready for other archs now.

So in the end, all that is missing on linux is some vfio update for support
of all architectures that have vfio.

Changes since v1:
- dropped rte_ioport and removed the arch headers, if performance is an
  issue, we will see how to enhance this in later patches


Regards, 
-- 
David Marchand

David Marchand (4):
  virtio/bsd: fix typo
  virtio: fix incorrect check when mapping pci resources
  eal: introduce pci ioport api
  virtio: use pci ioport api

 drivers/net/virtio/virtio_pci.c                 | 343 ++++--------------------
 drivers/net/virtio/virtio_pci.h                 |  38 +--
 lib/librte_eal/bsdapp/eal/eal_pci.c             | 135 ++++++++++
 lib/librte_eal/bsdapp/eal/rte_eal_version.map   |   4 +
 lib/librte_eal/common/include/rte_pci.h         |  67 +++++
 lib/librte_eal/linuxapp/eal/eal_pci.c           | 170 ++++++++++++
 lib/librte_eal/linuxapp/eal/eal_pci_init.h      |  16 ++
 lib/librte_eal/linuxapp/eal/eal_pci_uio.c       | 132 ++++++++-
 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c      |  37 +++
 lib/librte_eal/linuxapp/eal/rte_eal_version.map |   4 +
 10 files changed, 619 insertions(+), 327 deletions(-)

-- 
1.9.1



More information about the dev mailing list