[dpdk-dev] [PATCH 00/14] Step towards PCI independency

Jan Viktorin viktorin at rehivetech.com
Mon Jan 4 21:08:12 CET 2016


Hello DPDK community,

A few days ago, I've proposed an RFC of a new infrastructure that allows to
detect non-PCI devices present on SoC systems. It is, however, the easier part
of the story. To bring support of non-PCI devices, it is necessary to do much
deeper changes in DPDK. In this patch series, I am proposing changes that shows
a possible way how to do it.

I extended the rte_pci_{device,driver} with a member .magic. This member holds
a magic number unique to the PCI-infra. Another one (SoC-infra) would get a
different set of magics. This allows to define unions of bus-specific devices
and drivers while not loosing information about the original data type. It can
also add some type-safety into the system. It solves the problem of a missing
'type' member in the eth_driver structure.

Those extensions are then used to generalize the librte_ether library that
seems (to me) to be independent on the PCI now. What is important, the API
stays backwards compatible at the moment. From the point of ABI, I am afraid
that the .magic member breaks it anyway...

The code builds successfully for both x86_64 and ARMv7. I didn't test it in
runtime as the tests are not very suitable for this.

This patch set is independent on the previous one (which was adding the SoC
infra), however, if it is approved I expect them to be joined or to make them
dependent on each other in some way.

Regards
Jan
---
Jan Viktorin (14):
  eal/common: introduce RTE_PCI_DRV_MAGIC
  eal/common: introduce RTE_PCI_DEVICE_MAGIC
  eal/common: introduce union rte_device and related
  eal/common: introduce function to_pci_driver
  eal/common: introduce function to_pci_device
  Include rte_dev.h instead of rte_pci.h
  lib/ether: generalize rte_eth_dev_init/uninit
  eal/common: introduce rte_bus_addr
  lib/ether: generalize attach/detach of devices
  lib/ether: copy the rte_device union instead of rte_pci_device
  lib/ether: extract function rte_device_get_intr_handle
  lib/ether: check magic before naming a zone
  lib/ether: check magic in rte_eth_copy_pci_info
  lib/ether: introduce rte_eth_copy_dev_info

 app/test-pipeline/config.c                         |   2 +-
 app/test-pipeline/init.c                           |   2 +-
 app/test-pipeline/main.c                           |   2 +-
 app/test-pipeline/runtime.c                        |   2 +-
 app/test-pmd/cmdline.c                             |   2 +-
 app/test-pmd/config.c                              |   2 +-
 app/test-pmd/csumonly.c                            |   2 +-
 app/test-pmd/flowgen.c                             |   2 +-
 app/test-pmd/iofwd.c                               |   2 +-
 app/test-pmd/macfwd-retry.c                        |   2 +-
 app/test-pmd/macfwd.c                              |   2 +-
 app/test-pmd/macswap.c                             |   2 +-
 app/test-pmd/parameters.c                          |   2 +-
 app/test-pmd/rxonly.c                              |   2 +-
 app/test-pmd/testpmd.c                             |   2 +-
 app/test-pmd/txonly.c                              |   2 +-
 app/test/test_pci.c                                |   2 +-
 drivers/net/bnx2x/bnx2x_ethdev.c                   |   2 +
 drivers/net/bnx2x/bnx2x_ethdev.h                   |   2 +-
 drivers/net/cxgbe/base/t4_hw.c                     |   2 +-
 drivers/net/cxgbe/cxgbe_ethdev.c                   |   3 +-
 drivers/net/cxgbe/cxgbe_main.c                     |   2 +-
 drivers/net/cxgbe/sge.c                            |   2 +-
 drivers/net/e1000/em_ethdev.c                      |   3 +-
 drivers/net/e1000/em_rxtx.c                        |   2 +-
 drivers/net/e1000/igb_ethdev.c                     |   4 +-
 drivers/net/e1000/igb_rxtx.c                       |   2 +-
 drivers/net/enic/base/vnic_dev.h                   |   2 +-
 drivers/net/enic/enic_ethdev.c                     |   2 +-
 drivers/net/enic/enic_main.c                       |   2 +-
 drivers/net/fm10k/fm10k_ethdev.c                   |   1 +
 drivers/net/i40e/i40e_ethdev.c                     |   3 +-
 drivers/net/i40e/i40e_ethdev_vf.c                  |   3 +-
 drivers/net/i40e/i40e_pf.c                         |   2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c                   |   4 +-
 drivers/net/ixgbe/ixgbe_fdir.c                     |   2 +-
 drivers/net/ixgbe/ixgbe_rxtx.c                     |   2 +-
 drivers/net/mlx4/mlx4.c                            |   1 +
 drivers/net/mlx5/mlx5.c                            |   3 +-
 drivers/net/virtio/virtio_ethdev.c                 |   3 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c               |   3 +-
 drivers/net/vmxnet3/vmxnet3_rxtx.c                 |   2 +-
 examples/bond/main.c                               |   2 +-
 examples/dpdk_qat/main.c                           |   2 +-
 examples/exception_path/main.c                     |   2 +-
 examples/ip_fragmentation/main.c                   |   2 +-
 examples/ip_reassembly/main.c                      |   2 +-
 examples/ipv4_multicast/main.c                     |   2 +-
 examples/kni/main.c                                |   2 +-
 examples/l2fwd-crypto/main.c                       |   2 +-
 examples/l2fwd-ivshmem/guest/guest.c               |   2 +-
 examples/l2fwd-jobstats/main.c                     |   2 +-
 examples/l2fwd-keepalive/main.c                    |   2 +-
 examples/l2fwd/main.c                              |   2 +-
 examples/l3fwd-acl/main.c                          |   2 +-
 examples/l3fwd-power/main.c                        |   2 +-
 examples/l3fwd-vf/main.c                           |   2 +-
 examples/l3fwd/main.c                              |   2 +-
 examples/link_status_interrupt/main.c              |   2 +-
 examples/load_balancer/config.c                    |   2 +-
 examples/load_balancer/init.c                      |   2 +-
 examples/load_balancer/main.c                      |   2 +-
 examples/load_balancer/runtime.c                   |   2 +-
 .../client_server_mp/mp_client/client.c            |   2 +-
 .../client_server_mp/mp_server/init.c              |   2 +-
 .../client_server_mp/mp_server/main.c              |   2 +-
 examples/multi_process/l2fwd_fork/flib.c           |   2 +-
 examples/multi_process/l2fwd_fork/main.c           |   2 +-
 examples/multi_process/symmetric_mp/main.c         |   2 +-
 examples/performance-thread/l3fwd-thread/main.c    |   2 +-
 examples/vmdq/main.c                               |   2 +-
 examples/vmdq_dcb/main.c                           |   2 +-
 lib/librte_cryptodev/rte_cryptodev.c               |   4 +-
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |   1 -
 lib/librte_eal/bsdapp/eal/eal.c                    |   1 -
 lib/librte_eal/bsdapp/eal/eal_pci.c                |   2 +-
 lib/librte_eal/common/eal_common_devargs.c         |   2 +-
 lib/librte_eal/common/eal_common_pci.c             |   2 +-
 lib/librte_eal/common/eal_private.h                |   2 +-
 lib/librte_eal/common/include/rte_dev.h            |  44 ++++
 lib/librte_eal/common/include/rte_devargs.h        |   2 +-
 lib/librte_eal/common/include/rte_pci.h            |  27 +++
 lib/librte_eal/linuxapp/eal/eal.c                  |   2 +-
 lib/librte_eal/linuxapp/eal/eal_interrupts.c       |   2 +-
 lib/librte_eal/linuxapp/eal/eal_ivshmem.c          |   2 +-
 lib/librte_ether/rte_ethdev.c                      | 224 +++++++++++++++------
 lib/librte_ether/rte_ethdev.h                      |  25 ++-
 87 files changed, 351 insertions(+), 144 deletions(-)

-- 
2.6.3



More information about the dev mailing list