All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shreyansh Jain <shreyansh.jain@nxp.com>
To: <david.marchand@6wind.com>
Cc: <dev@dpdk.org>, <thomas.monjalon@6wind.com>,
	Shreyansh Jain <shreyansh.jain@nxp.com>
Subject: [PATCH v6 0/8] Introducing EAL Bus-Device-Driver Model
Date: Mon, 16 Jan 2017 21:08:19 +0530	[thread overview]
Message-ID: <1484581107-2025-1-git-send-email-shreyansh.jain@nxp.com> (raw)

Link to v5: [15]

:: Introduction ::

DPDK has been inherently a PCI inclined framework. Because of this, the
design of device tree (or list) within DPDK is also PCI inclined. A
non-PCI device doesn't have a way of being expressed without using hooks
started from EAL to PMD.

(Check 'Version Changes' section for changes)

:: Overview of the Proposed Changes ::

Assuming the below graph for a computing node:

        device A1
          |
  +==.===='==============.============+ Bus A.
     |                    `--> driver A11     \
  device A2                `-> driver A12      \______
                                                |CPU |
                                                /`````
        device B1                              /
          |                                   /
  +==.===='==============.============+ Bus B`
     |                    `--> driver B11
  device B2                `-> driver B12


 - One or more buses are connected to a CPU (or core)
 - One or more devices are conneted to a Bus
 - Drivers are running instances which manage one or more devices
 - Bus is responsible for identifying devices (and interrupt propogation)
 - Driver is responsible for initializing the device

In [15], model assumes that rte_bus would be the base class using which
all the bus implementations would instantiate the objects. This patches
takes a much more basic approach, on the same lines of rte_device/
rte_driver and rte_pci_device/rte_pci_driver.
This is based on various review comments as well as offline (IRC)
discussions.

 - rte_bus is an abstract class which includes basic methods supported by
   all buses.
 - specific implementation, for example for PCI rte_pci_bus, would extend
   this class to form their own buses, with their own bus specific device
   and driver list.
 - 

 +-----------------+
 |rte_pci_bus      |
 |+---------------+|
 ||rte_bus        ||
 |+---------------+|
 +-----------------+

And example implementation would look like:

  .--------------->+-------------------+
  |                |rte_pci_bus        |
  |                | +----------------+|
  |                | |rte_bus         <------.
  |                | | name           ||     |
  |                | | scan           ||     |
  |                | | probe          ||     |
  |                | | attach         ||     |
  |                | | detach         ||     |
  |                | +----------------+|     |
  |                | pci_driver_list   |     |
  |  .-------------->pci_device_list   |     |
  |  |             | ...               |     |
  |  |             +-------------------+     |
  |  |                                       |
  |  +-------------------+                   |
  |  |rte_pci_device     |                   |
  '----bus               |                   |
     | +----------------+|                   |
     | |rte_device      ||                   |
     | | bus --------------------------------'
     | | ...            ||
     | +----------------+|
     | ...               |
     +-------------------+


:: Brief about Patch Layout ::

0001~0002: Introducing the basic Bus model and associated test case
0003     : Split the PCI match into a separate function
0004~0005: Introduce bus->scan APIs and integrate with EAL
0006     : Update the Bus and PCI test cases for scanning/probing
0007     : Enable PCI bus and remove code for direct PCI scan/probe from
           EAL
0008     : Add device hotplugging over the bus and introduce PCI helpers


:: Pending Changes/Caveats ::

1. This patchset only moves the PCI into a bus. And, that movement is also
   currently part of the EAL (lib/librte_eal/linux)
   Eventual aim is the PCI bus reside in driver/bus/pci

2. Though the implementation for bus is common for Linux and BSD, the PCI
   bus implementation has been done/tested only for Linux.

3. RTE_REGISTER_BUS has been declared with contructor priority of 101
    It is important that Bus is registered *before* drivers are registered.
    Only way I could find to assure that was via 
    __attribute(contructor(priority)) of GCC. I am not sure how it would
    behave on other compilers. Any suggestions?
    - One suggestion from David Marchand was to use global bus object
      handles, which I have not implemented for now. If that is common
      choice, I will change in v3.

:: ToDo list ::

 - Bump to librte_eal version
 - Documentation continues to have references to some _old_ PCI symbols

:: References ::

[1] http://dpdk.org/ml/archives/dev/2016-November/050186.html
[2] http://dpdk.org/ml/archives/dev/2016-November/050622.html
[3] http://dpdk.org/ml/archives/dev/2016-November/050416.html
[4] http://dpdk.org/ml/archives/dev/2016-November/050567.html
[5] http://dpdk.org/ml/archives/dev/2016-November/050628.html
[6] http://dpdk.org/ml/archives/dev/2016-November/050415.html
[7] http://dpdk.org/ml/archives/dev/2016-November/050443.html
[8] http://dpdk.org/ml/archives/dev/2016-November/050624.html
[9] http://dpdk.org/ml/archives/dev/2016-November/050296.html
[10] http://dpdk.org/ml/archives/dev/2016-December/051349.html
[12] http://dpdk.org/ml/archives/dev/2016-December/052092.html
[13] http://dpdk.org/ml/archives/dev/2016-December/052381.html
[14] http://dpdk.org/ml/archives/dev/2016-December/053302.html
[15] http://dpdk.org/ml/archives/dev/2016-December/053315.html

:: Version Changes ::
v6:
 - Rearchitecture to bring bus object parallel to rte_device/driver
   This majorly includes:
   -- rte_pci_bus class and pci_bus as its object for PCI
   -- bus->attach/detach (hotplugging)
   -- removing bus->match as that is local to an implementation
 - rename symbols rte_eal_bus_* to rte_bus_*
 - restructuring patches (order) for simplicity
 - update to test_pci

v5:
 - Fix checkpatch error in Patch 0003

v4:
 - rebase over master (eac901ce)
 - Fix a bug in test_bus while setup and cleanup
 - rename rte_eal_get_bus to rte_eal_bus_get
 - Add helper (iterator) macros for easy bus,device,driver traversal
 - removed 0001 patch as it is already merged in master
 - fix missing rte_eal_bus_insert_device symbol in map file

v3:
 - rebase over master (c431384c8f)
 - revert patch 0001 changes for checkpatch (container_of macro)
 - qat/rte_qat_cryptodev update for rte_driver->probe
 - test_pci update for using a test_pci_bus for verification
 - some bug fixes based on internal testing.
 -- rte_eal_dev_attach not handling devargs
 -- blacklisting not working

v2:
 - No more bus->probe()
   Now, rte_eal_bus_probe() calls rte_driver->probe based on match output
 - new functions, rte_eal_pci_probe and rte_eal_pci_remove have been
   added as glue code between PCI PMDs and PCI Bus
   `-> PMDs are updated to use these new functions as callbacks for
       rte_driver
 - 'default' keyword has been removed from match and scan
 - Fix for incorrect changes in mlx* and nicvf*
 - Checkpatch fixes
 - Some variable checks have been removed from internal functions;
   functions which are externally visible continue to have such checks
 - Some rearrangement of patches:
   -- changes to drivers have been separated from EAL changes (but this
      does make PCI PMDs non-working for a particular patch)

Shreyansh Jain (8):
  eal/bus: introduce bus abstraction
  test: add basic bus infrastructure tests
  pci: split match and probe function
  eal/bus: support for scanning of bus
  eal: introduce bus scan and probe in EAL
  test: update bus and pci unit test cases
  eal: enable PCI bus
  eal: enable hotplugging of devices on bus

 app/test/Makefile                               |   2 +-
 app/test/test.h                                 |   2 +
 app/test/test_bus.c                             | 686 ++++++++++++++++++++++++
 app/test/test_pci.c                             | 164 ++++--
 lib/librte_eal/bsdapp/eal/Makefile              |   1 +
 lib/librte_eal/bsdapp/eal/eal.c                 |  13 +-
 lib/librte_eal/bsdapp/eal/eal_pci.c             |  13 +
 lib/librte_eal/bsdapp/eal/rte_eal_version.map   |  15 +-
 lib/librte_eal/common/Makefile                  |   2 +-
 lib/librte_eal/common/eal_common_bus.c          | 140 +++++
 lib/librte_eal/common/eal_common_dev.c          |  56 +-
 lib/librte_eal/common/eal_common_pci.c          | 330 ++++++++----
 lib/librte_eal/common/eal_private.h             |  10 -
 lib/librte_eal/common/include/rte_bus.h         | 206 +++++++
 lib/librte_eal/common/include/rte_dev.h         |   1 +
 lib/librte_eal/common/include/rte_pci.h         | 161 +++++-
 lib/librte_eal/linuxapp/eal/Makefile            |   1 +
 lib/librte_eal/linuxapp/eal/eal.c               |  13 +-
 lib/librte_eal/linuxapp/eal/eal_pci.c           |  53 +-
 lib/librte_eal/linuxapp/eal/rte_eal_version.map |  15 +-
 20 files changed, 1646 insertions(+), 238 deletions(-)
 create mode 100644 app/test/test_bus.c
 create mode 100644 lib/librte_eal/common/eal_common_bus.c
 create mode 100644 lib/librte_eal/common/include/rte_bus.h

-- 
2.7.4

             reply	other threads:[~2017-01-16 15:35 UTC|newest]

Thread overview: 146+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-16 15:38 Shreyansh Jain [this message]
2017-01-16 15:38 ` [PATCH v6 1/8] eal/bus: introduce bus abstraction Shreyansh Jain
2017-01-16 15:38 ` [PATCH v6 2/8] test: add basic bus infrastructure tests Shreyansh Jain
2017-01-16 15:38 ` [PATCH v6 3/8] pci: split match and probe function Shreyansh Jain
2017-01-16 18:24   ` Stephen Hemminger
2017-01-17 10:10     ` Shreyansh Jain
2017-01-16 19:53   ` Ferruh Yigit
2017-01-17  4:54     ` Shreyansh Jain
2017-01-17  9:58       ` Ferruh Yigit
2017-01-17 10:14         ` Shreyansh Jain
2017-01-16 15:38 ` [PATCH v6 4/8] eal/bus: support for scanning of bus Shreyansh Jain
2017-01-16 15:38 ` [PATCH v6 5/8] eal: introduce bus scan and probe in EAL Shreyansh Jain
2017-01-16 19:58   ` Ferruh Yigit
2017-01-17  5:03     ` Shreyansh Jain
2017-01-17 23:04       ` Thomas Monjalon
2017-01-17 10:13     ` Shreyansh Jain
2017-01-16 15:38 ` [PATCH v6 6/8] test: update bus and pci unit test cases Shreyansh Jain
2017-01-16 15:38 ` [PATCH v6 7/8] eal: enable PCI bus Shreyansh Jain
2017-01-16 19:58   ` Ferruh Yigit
2017-01-17  5:04     ` Shreyansh Jain
2017-01-17 10:11     ` Shreyansh Jain
2017-01-16 15:38 ` [PATCH v6 8/8] eal: enable hotplugging of devices on bus Shreyansh Jain
2017-01-17  7:24   ` Shreyansh Jain
2017-01-16 18:27 ` [PATCH v6 0/8] Introducing EAL Bus-Device-Driver Model Stephen Hemminger
2017-01-17  5:08   ` Shreyansh Jain
2017-01-17  5:09   ` Shreyansh Jain
2017-01-17 10:09 ` [PATCH v7 0/9] " Shreyansh Jain
2017-01-17 10:09   ` [PATCH v7 1/9] eal/bus: introduce bus abstraction Shreyansh Jain
2017-01-17 10:09   ` [PATCH v7 2/9] test: add basic bus infrastructure tests Shreyansh Jain
2017-01-17 10:09   ` [PATCH v7 3/9] pci: split match and probe function Shreyansh Jain
2017-01-17 10:09   ` [PATCH v7 4/9] eal/bus: support for scanning of bus Shreyansh Jain
2017-01-17 10:09   ` [PATCH v7 5/9] eal/bus: introduce support for bus probing Shreyansh Jain
2017-01-17 10:09   ` [PATCH v7 6/9] eal: integrate bus scan and probe with EAL Shreyansh Jain
2017-01-17 10:09   ` [PATCH v7 7/9] test: update bus and pci unit test cases Shreyansh Jain
2017-01-17 10:09   ` [PATCH v7 8/9] eal: enable PCI bus Shreyansh Jain
2017-01-17 10:09   ` [PATCH v7 9/9] eal: enable hotplugging of devices on bus Shreyansh Jain
2017-01-17 10:47     ` Ferruh Yigit
2017-01-17 11:04       ` Shreyansh Jain
2017-01-17 13:40         ` Shreyansh Jain
2017-01-17 10:50   ` [PATCH v7 0/9] Introducing EAL Bus-Device-Driver Model Ferruh Yigit
2017-01-17 13:37   ` [PATCH v8 " Shreyansh Jain
2017-01-17 13:37     ` [PATCH v8 1/9] eal/bus: introduce bus abstraction Shreyansh Jain
2017-01-17 23:19       ` Thomas Monjalon
2017-01-18  5:12         ` Shreyansh Jain
2017-01-17 13:37     ` [PATCH v8 2/9] test: add basic bus infrastructure tests Shreyansh Jain
2017-01-17 23:23       ` Thomas Monjalon
2017-01-18  5:13         ` Shreyansh Jain
2017-01-18  6:56           ` Shreyansh Jain
2017-01-18  7:28             ` Thomas Monjalon
2017-01-18  8:42               ` Shreyansh Jain
2017-01-17 13:37     ` [PATCH v8 3/9] pci: split match and probe function Shreyansh Jain
2017-01-17 23:31       ` Thomas Monjalon
2017-01-18  6:17         ` Shreyansh Jain
2017-01-18  7:31           ` Thomas Monjalon
2017-01-17 13:37     ` [PATCH v8 4/9] eal/bus: support for scanning of bus Shreyansh Jain
2017-01-17 23:37       ` Thomas Monjalon
2017-01-18  5:15         ` Shreyansh Jain
2017-01-18  7:32           ` Thomas Monjalon
2017-01-17 13:37     ` [PATCH v8 5/9] eal/bus: introduce support for bus probing Shreyansh Jain
2017-01-17 23:38       ` Thomas Monjalon
2017-01-17 13:37     ` [PATCH v8 6/9] eal: integrate bus scan and probe with EAL Shreyansh Jain
2017-01-17 23:44       ` Thomas Monjalon
2017-01-17 13:37     ` [PATCH v8 7/9] test: update bus and pci unit test cases Shreyansh Jain
2017-01-17 23:46       ` Thomas Monjalon
2017-01-17 13:37     ` [PATCH v8 8/9] eal: enable PCI bus Shreyansh Jain
2017-01-17 23:57       ` Thomas Monjalon
2017-01-17 13:37     ` [PATCH v8 9/9] eal: enable hotplugging of devices on bus Shreyansh Jain
2017-01-17 15:17       ` Ferruh Yigit
2017-01-18 10:37     ` [PATCH v9 00/12] Introducing EAL Bus-Device-Driver Model Shreyansh Jain
2017-01-18 10:37       ` [PATCH v9 01/12] eal/bus: introduce bus abstraction Shreyansh Jain
2017-01-18 10:46         ` Thomas Monjalon
2017-01-18 10:52           ` Shreyansh Jain
2017-01-18 10:37       ` [PATCH v9 02/12] test: add basic bus infrastructure tests Shreyansh Jain
2017-01-18 10:37       ` [PATCH v9 03/12] pci: split match and probe function Shreyansh Jain
2017-01-18 10:37       ` [PATCH v9 04/12] eal: remove loop over drivers in device detach Shreyansh Jain
2017-01-18 10:41         ` Shreyansh Jain
2017-01-18 11:12         ` Thomas Monjalon
2017-01-18 12:15           ` Shreyansh Jain
2017-01-18 10:37       ` [PATCH v9 05/12] eal/bus: support for scanning of bus Shreyansh Jain
2017-01-18 10:37       ` [PATCH v9 06/12] eal/bus: introduce support for bus probing Shreyansh Jain
2017-01-18 10:37       ` [PATCH v9 07/12] eal: integrate bus scan and probe with EAL Shreyansh Jain
2017-01-18 10:37       ` [PATCH v9 08/12] eal/pci: add support for PCI bus Shreyansh Jain
2017-01-18 10:37       ` [PATCH v9 09/12] test: add test cases for scan and probe on BUS Shreyansh Jain
2017-01-18 10:37       ` [PATCH v9 10/12] test: add Bus based scan and probe test cases for PCI Shreyansh Jain
2017-01-18 10:37       ` [PATCH v9 11/12] eal: enable PCI bus Shreyansh Jain
2017-01-18 10:38       ` [PATCH v9 12/12] eal: enable hotplugging of devices on bus Shreyansh Jain
2017-01-18 11:10       ` [PATCH v9 00/12] Introducing EAL Bus-Device-Driver Model Thomas Monjalon
2017-01-18 14:05       ` [PATCH v10 00/13] " Shreyansh Jain
2017-01-18 14:05         ` [PATCH v10 01/13] eal/bus: introduce bus abstraction Shreyansh Jain
2017-01-18 14:05         ` [PATCH v10 02/13] test: add basic bus infrastructure tests Shreyansh Jain
2017-01-18 14:05         ` [PATCH v10 03/13] pci: split match and probe function Shreyansh Jain
2017-01-18 14:05         ` [PATCH v10 04/13] eal: remove loop over drivers in device detach Shreyansh Jain
2017-01-18 14:05         ` [PATCH v10 05/13] eal/bus: support for scanning of bus Shreyansh Jain
2017-01-18 14:05         ` [PATCH v10 06/13] eal/bus: introduce support for bus probing Shreyansh Jain
2017-01-18 14:05         ` [PATCH v10 07/13] eal: integrate bus scan and probe with EAL Shreyansh Jain
2017-01-18 14:05         ` [PATCH v10 08/13] eal/pci: add support for PCI bus Shreyansh Jain
2017-01-18 14:05         ` [PATCH v10 09/13] test: add test cases for scan and probe on BUS Shreyansh Jain
2017-01-18 14:05         ` [PATCH v10 10/13] test: add Bus based scan and probe test cases for PCI Shreyansh Jain
2017-01-18 14:05         ` [PATCH v10 11/13] eal: enable PCI bus Shreyansh Jain
2017-01-18 14:05         ` [PATCH v10 12/13] eal: enable hotplugging of devices on bus Shreyansh Jain
2017-01-18 14:05         ` [PATCH v10 13/13] doc: remove deprecation notice for rte_bus Shreyansh Jain
2017-01-19  4:45         ` [PATCH v11 00/13] rte_bus + rte_pci_bus Thomas Monjalon
2017-01-19  4:45           ` [PATCH v11 01/13] bus: introduce bus abstraction Thomas Monjalon
2017-01-19  4:45           ` [PATCH v11 02/13] bus: add scanning Thomas Monjalon
2017-01-19  4:45           ` [PATCH v11 03/13] bus: add probing Thomas Monjalon
2017-01-19  4:45           ` [PATCH v11 04/13] app/test: check bus registration Thomas Monjalon
2017-01-19  4:45           ` [PATCH v11 05/13] app/test: check bus scan Thomas Monjalon
2017-01-19  4:45           ` [PATCH v11 06/13] app/test: check bus probe Thomas Monjalon
2017-01-19  4:45           ` [PATCH v11 07/13] pci: split match and probe Thomas Monjalon
2017-02-15 10:45             ` Jan Blunck
2017-02-15 11:22               ` Thomas Monjalon
2017-02-15 11:52                 ` Shreyansh Jain
2017-02-15 11:30               ` Shreyansh Jain
2017-01-19  4:45           ` [PATCH v11 08/13] pci: remove loop over drivers in device detach Thomas Monjalon
2017-01-19  4:45           ` [PATCH v11 09/13] pci: add bus driver Thomas Monjalon
2017-02-15 10:42             ` Jan Blunck
2017-02-15 11:20               ` Thomas Monjalon
2017-01-19  4:45           ` [PATCH v11 10/13] app/test: add PCI " Thomas Monjalon
2017-01-19  4:45           ` [PATCH v11 11/13] pci: use bus driver for scan/probe Thomas Monjalon
2017-01-19  4:45           ` [PATCH v11 12/13] pci: use bus driver for attach/detach Thomas Monjalon
2017-02-15 11:08             ` Jan Blunck
2017-02-15 11:26               ` Thomas Monjalon
2017-02-15 11:39                 ` Jan Blunck
2017-02-15 14:04                   ` [RFC] eal: use busname and devargs to attach devices Jan Blunck
2017-01-19  4:45           ` [PATCH v11 13/13] doc: remove deprecation notice for rte_bus Thomas Monjalon
2017-01-19 17:40             ` Mcnamara, John
2017-01-19  4:50           ` [PATCH v11 00/13] rte_bus + rte_pci_bus Thomas Monjalon
2017-04-07 15:28           ` [PATCH v12 0/5] rte_bus_pci Gaetan Rivet
2017-04-07 15:28             ` [PATCH v12 1/5] pci: split match and probe Gaetan Rivet
2017-04-07 15:28             ` [PATCH v12 2/5] pci: remove loop over drivers in device detach Gaetan Rivet
2017-04-07 15:28             ` [PATCH v12 3/5] pci: add bus driver Gaetan Rivet
2017-04-07 15:28             ` [PATCH v12 4/5] pci: use bus driver for scan/probe Gaetan Rivet
2017-04-07 15:28             ` [PATCH v12 5/5] test: remove pci tests Gaetan Rivet
2017-04-11 11:07             ` [PATCH v13 0/7] rte_bus_pci Gaetan Rivet
2017-04-11 11:07               ` [PATCH v13 1/7] test: remove pci tests Gaetan Rivet
2017-04-11 11:07               ` [PATCH v13 2/7] pci: split match and probe Gaetan Rivet
2017-04-11 11:07               ` [PATCH v13 3/7] pci: remove loop over drivers in device detach Gaetan Rivet
2017-04-11 11:07               ` [PATCH v13 4/7] pci: add bus driver Gaetan Rivet
2017-04-11 11:07               ` [PATCH v13 5/7] pci: use bus driver for scan/probe Gaetan Rivet
2017-04-11 11:07               ` [PATCH v13 6/7] pci: use bus driver for attach/detach Gaetan Rivet
2017-04-14  8:43                 ` Thomas Monjalon
2017-04-11 11:07               ` [PATCH v13 7/7] doc: remove deprecation notice for rte_bus Gaetan Rivet
2017-04-11 11:32                 ` Shreyansh Jain
2017-04-11 11:54                   ` Gaëtan Rivet
2017-04-12 16:09               ` [PATCH v13 0/7] rte_bus_pci Stephen Hemminger
2017-04-14 12:16                 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1484581107-2025-1-git-send-email-shreyansh.jain@nxp.com \
    --to=shreyansh.jain@nxp.com \
    --cc=david.marchand@6wind.com \
    --cc=dev@dpdk.org \
    --cc=thomas.monjalon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.