Skip to content

RFC Generalize rte_eth_dev model

Stephen Hemminger dpdk-dev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest13 patches 11 repliesIn review
  2. v12 patches 5 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13ethdev: increase length ethernet device internal namedoc/guides/rel_notes/deprecation.rst lib/librte_ether/rte_ethdev.h+8 -12 replies
2/13rte_device: make driver pointer constlib/librte_eal/common/include/rte_dev.h+1 -11 reply
3/13eal: define container_of macrolib/librte_eal/common/include/rte_common.h+20 -00 replies
4/13eal: introduce driver typelib/librte_eal/common/include/rte_dev.h lib/librte_eal/common/include/rte_pci.h lib/librte_eal/common/include/rte_vdev.h+14 -35 replies
5/13pmd: remove useless reset of dev_info->dev_pciapp/test/virtual_pmd.c drivers/net/af_packet/rte_eth_af_packet.c drivers/net/bonding/rte_eth_bond_pmd.c +4 more+0 -71 reply
6/13ethdev: make dev_info generic (not just PCI)app/test-pmd/config.c app/test-pmd/testpmd.c app/test-pmd/testpmd.h +4 more+96 -331 reply
7/13e1000: localize mapping from eth_dev to pcidrivers/net/e1000/e1000_ethdev.h drivers/net/e1000/em_ethdev.c drivers/net/e1000/igb_ethdev.c +1 more+87 -680 replies
8/13ixgbe: localize mapping from eth_dev to pci_devicedrivers/net/ixgbe/ixgbe_ethdev.c drivers/net/ixgbe/ixgbe_ethdev.h drivers/net/ixgbe/ixgbe_pf.c+74 -530 replies
9/13i40e: localize mapping of eth_dev to pcidrivers/net/i40e/i40e_ethdev.c drivers/net/i40e/i40e_ethdev.h drivers/net/i40e/i40e_ethdev_vf.c+83 -550 replies
10/13virtio: localize mapping from rte_eth to pcidrivers/net/virtio/virtio_ethdev.c+63 -270 replies
11/13broadcom: localize mapping from eth_dev to pcidrivers/net/bnxt/bnxt_ethdev.c drivers/net/bnxt/bnxt_ring.c+19 -190 replies
12/13ethdev: change pci_dev to generic deviceapp/test/virtual_pmd.c drivers/net/bnxt/bnxt_ethdev.c drivers/net/bonding/rte_eth_bond_args.c +17 more+123 -810 replies
13/13hyperv: VMBUS support infrastucturelib/librte_eal/common/Makefile lib/librte_eal/common/eal_common_devargs.c lib/librte_eal/common/eal_common_options.c +9 more+196 -30 replies

Reviews trailers per patch

2 of 13 patches have a Reviewed-by or Acked-by.

PatchJan Blunck
1/13
2/13A-b
3/13
4/13
5/13A-b
6/13
7/13
8/13
9/13
10/13
11/13
12/13
13/13

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [RFC v2 00/13] Generalize rte_eth_dev model

This set of patches generalize the ethernet device model sufficently to support virtual, pci, and vmbus devices.

All this is based on the XP principal of only building what is necessary and no more than that. The rationale is NOT to rework the DPDK to have same level of bus and parent information as the Linux device model. This would be unnecessary, fragile and unnecessarily OS dependent.

Instead, this set of patches does the simple change of refactoring so that the object relationship between ethernet (rte_eth_dev), PCI (rte_pci_device) and generic (rte_device) is properly broken apart.

It does make the simplifying assumption that the device driver knows what type of bus it is on. For a future case where a device has to be able to handle different bus families; then the device driver can have multiple device drivers in one code base (like ixgbe PF/VF).

Jan Blunck (1):
eal: define container_of macro

Stephen Hemminger (12):
ethdev: increase length ethernet device internal name
rte_device: make driver pointer const
eal: introduce driver type
pmd: remove useless reset of dev_info->dev_pci
ethdev: make dev_info generic (not just PCI)
e1000: localize mapping from eth_dev to pci
ixgbe: localize mapping from eth_dev to pci_device
i40e: localize mapping of eth_dev to pci
virtio: localize mapping from rte_eth to pci
broadcom: localize mapping from eth_dev to pci
ethdev: change pci_dev to generic device
hyperv: VMBUS support infrastucture

 app/test-pmd/config.c                       |  32 +++++++-
 app/test-pmd/testpmd.c                      |  11 ++-
 app/test-pmd/testpmd.h                      |  32 ++++----
 app/test/test_kni.c                         |  39 +++++++--
 app/test/virtual_pmd.c                      |   4 +-
 doc/guides/rel_notes/deprecation.rst        |   3 +
 doc/guides/rel_notes/release_17_02.rst      |  10 +--
 drivers/net/af_packet/rte_eth_af_packet.c   |   1 -
 drivers/net/bnxt/bnxt_ethdev.c              |  24 +++---
 drivers/net/bnxt/bnxt_ring.c                |  16 ++--
 drivers/net/bonding/rte_eth_bond_args.c     |  12 ++-
 drivers/net/bonding/rte_eth_bond_pmd.c      |   1 -
 drivers/net/cxgbe/cxgbe_ethdev.c            |   2 +-
 drivers/net/cxgbe/cxgbe_main.c              |   5 +-
 drivers/net/e1000/e1000_ethdev.h            |   2 +
 drivers/net/e1000/em_ethdev.c               |  50 +++++++-----
 drivers/net/e1000/igb_ethdev.c              |  99 ++++++++++++-----------
 drivers/net/e1000/igb_pf.c                  |   4 +-
 drivers/net/ena/ena_ethdev.c                |   2 +-
 drivers/net/enic/enic_ethdev.c              |   2 +-
 drivers/net/enic/enic_rxtx.c                |   2 -
 drivers/net/fm10k/fm10k_ethdev.c            |  90 +++++++++++++--------
 drivers/net/i40e/i40e_ethdev.c              |  77 +++++++++++-------
 drivers/net/i40e/i40e_ethdev.h              |   3 +
 drivers/net/i40e/i40e_ethdev_vf.c           |  59 ++++++++------
 drivers/net/ixgbe/ixgbe_ethdev.c            | 120 ++++++++++++++++------------
 drivers/net/ixgbe/ixgbe_ethdev.h            |   3 +
 drivers/net/ixgbe/ixgbe_pf.c                |   4 +-
 drivers/net/null/rte_eth_null.c             |   1 -
 drivers/net/pcap/rte_eth_pcap.c             |   1 -
 drivers/net/qede/qede_ethdev.c              |  24 +++---
 drivers/net/qede/qede_ethdev.h              |   4 +
 drivers/net/ring/rte_eth_ring.c             |   1 -
 drivers/net/virtio/virtio_ethdev.c          |  95 +++++++++++++++-------
 drivers/net/virtio/virtio_user_ethdev.c     |   2 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c        |   3 +-
 drivers/net/xenvirt/rte_eth_xenvirt.c       |   1 -
 lib/librte_eal/common/Makefile              |   2 +-
 lib/librte_eal/common/eal_common_devargs.c  |   7 ++
 lib/librte_eal/common/eal_common_options.c  |  38 +++++++++
 lib/librte_eal/common/eal_internal_cfg.h    |   3 +-
 lib/librte_eal/common/eal_options.h         |   6 ++
 lib/librte_eal/common/eal_private.h         |   5 ++
 lib/librte_eal/common/include/rte_common.h  |  20 +++++
 lib/librte_eal/common/include/rte_dev.h     |  17 +++-
 lib/librte_eal/common/include/rte_devargs.h |   8 ++
 lib/librte_eal/common/include/rte_pci.h     |   1 +
 lib/librte_eal/common/include/rte_vdev.h    |   1 +
 lib/librte_eal/linuxapp/eal/Makefile        |   6 ++
 lib/librte_eal/linuxapp/eal/eal.c           |  11 +++
 lib/librte_ether/rte_ethdev.c               | 114 ++++++++++++++++++++++++--
 lib/librte_ether/rte_ethdev.h               |  38 +++++++--
 mk/rte.app.mk                               |   1 +
 53 files changed, 776 insertions(+), 343 deletions(-)
Signature · 1 line
2.11.0