[dpdk-dev] [RFC 0/7] Support non-PCI devices

Jan Viktorin viktorin at rehivetech.com
Fri Jan 1 22:05:19 CET 2016


Hello DPDK community,

I am proposing an RFC patch series that tries to add support for non-PCI
devices into DPDK. At the moment, the only way how to support such devices is
to utilize the virtual devices. As there are SoCs with integrated Ethernet MACs
(and other devices) that can be controled by DPDK, such infrastructure can be
helpful to write PMD for them. This is mostly the case of ARM SoCs. The ARMv7
SoCs have always an integrated EMAC (if any), the ARM+FPGA provides ways how
to put a custom EMACs into the SoC, and for ARM 64 there is the X-Gene board
with integrated 10G EMACs.

The patch set contains a simple self-test showing that this approach works. It
is possible to test it on any platform as it provides a fake sysfs and device
tree hierarchy.

I am introducing the pair rte_soc_device + rte_soc_driver and the probing code
for Linux. It is based on searching the /sys/bus/platform/devices and the
device-tree (for PMDs). No testing PMD is provided, just a simple test case
in app/test/test_soc.c.

I am unsure about the naming - rte_soc_*, however, it's the best one I've
devised so far.

I am aware of several code-issues and missing comments and moreover, there is
some infrastructure copied from the PCI code base. I will fix those in future
versions of the patch set if it is approved to the upstream. I'd be happy to
get some suggestions how to refactor the common code out from the PCI infra.

I am unaware of any other attempt to extend DPDK in this way so if there is
some work similar to this, I'd like to have a look at it.

Please, consider one important thing. There is no Linux Kernel driver that is
suitable for this kind of devices. Such driver must be PCI-independent, must
(should?) support no-IOMMU access to the device, must provide access to the
device memory specified in the device-tree's reg property, must give a way how
to perform DMA transfers, should be able to deliver interrupts, etc.

See the commits for more details...

Happy New Year!

Regards
Jan Viktorin

Jan Viktorin (7):
  eal/common: define rte_soc_* related common interface
  eal: introduce --no-soc option
  eal: add common part of the SoC infra
  eal/linuxapp: support SoC infra in linuxapp
  eal: init SoC infra on rte_eal_init
  eal/soc: make SoC infra testable on any platform
  app/test: add SoC infra probe/detach test

 app/test/Makefile                           |   3 +
 app/test/soc_test_init.sh                   |  61 +++++
 app/test/test_soc.c                         | 249 +++++++++++++++++
 lib/librte_eal/common/Makefile              |   2 +-
 lib/librte_eal/common/eal_common_devargs.c  |   6 +
 lib/librte_eal/common/eal_common_options.c  |   5 +
 lib/librte_eal/common/eal_common_soc.c      | 367 +++++++++++++++++++++++++
 lib/librte_eal/common/eal_internal_cfg.h    |   1 +
 lib/librte_eal/common/eal_options.h         |   2 +
 lib/librte_eal/common/eal_private.h         |  12 +
 lib/librte_eal/common/include/rte_devargs.h |   7 +
 lib/librte_eal/common/include/rte_soc.h     | 212 ++++++++++++++
 lib/librte_eal/linuxapp/eal/Makefile        |   3 +
 lib/librte_eal/linuxapp/eal/eal.c           |   4 +
 lib/librte_eal/linuxapp/eal/eal_soc.c       | 409 ++++++++++++++++++++++++++++
 15 files changed, 1342 insertions(+), 1 deletion(-)
 create mode 100755 app/test/soc_test_init.sh
 create mode 100644 app/test/test_soc.c
 create mode 100644 lib/librte_eal/common/eal_common_soc.c
 create mode 100644 lib/librte_eal/common/include/rte_soc.h
 create mode 100644 lib/librte_eal/linuxapp/eal/eal_soc.c

-- 
2.6.3



More information about the dev mailing list