DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1 0/5] Introduce generic 'rawdevice' support
@ 2018-01-02 12:57 Shreyansh Jain
  2018-01-02 12:57 ` [dpdk-dev] [PATCH v1 1/5] rawdev: introduce raw device library support Shreyansh Jain
                   ` (6 more replies)
  0 siblings, 7 replies; 67+ messages in thread
From: Shreyansh Jain @ 2018-01-02 12:57 UTC (permalink / raw)
  To: dev; +Cc: hemant.agrawal, fiona.trahe, rosen.xu, Shreyansh Jain

Rawdevice Support in DPDK
-------------------------

RFC [1]: http://dpdk.org/ml/archives/dev/2017-November/081550.html
         (from: hemant.agrawal@nxp.com)

This patchset introduces rawdevices or generic device support in DPDK.

Motivation
==========

In terms of device flavor (type) support, DPDK currently has ethernet
(lib_ether), cryptodev (libcryptodev), eventdev (libeventdev) and vdev
(virtual device) support.

For a new type of device, for example an accelerator, there are not many
options except either of:
1. create another lib/librte_MySpecialDev, driver/MySpecialDrv and use it
   through Bus/PMD model.
2. Or, create a vdev and implement necessary custom APIs which are directly
   exposed from driver layer. However this may still require changes in bus
   code in DPDK.

Either method is unclean (touching lib for specific context) and possibly
non-upstreamable (custom APIs). Applications and customers prefers uniform
device view and programming model.

Scope
=====

The rawdevice implementation is targetted towards various accelerator use cases
which cannot be generalized within existing device models. Aim is to provided a
generalized structure at the cost of portability guarantee. Specific PMDs may
also expose any specific config APIs. Applications built over such devices are
special use-cases involving IP blocks.

The rawdevice may also connect to other standard devices using adapter or other
methods, similar to eventdev adpter for ethernet/crypto devices.

Proposed Solution
=================

Defining a very generic super-set of device type and its device operations that
can be exposed such that any new/upcoming/experimental device can be layered
over it. 'rawdevice' semantic in this patchset represents a device that doesn't
have any flavor/type associated with it which is advertised (like net, crypto
etc).

A *rte_rawdevice* is a raw/generic device without any standard configuration
or input/output method assumption.

Thus, driver for a new accelerator block, which requires operations for
start/stop/enqueue/dequeue, can be quickly strapped over this rawdevice layer.
Thereafter, any appropriate bus can scan for it (assuming device is discoverable
over the Linux interfaces like sysfs) and match it against registered drivers.

Similarly, for a new accelerator or a wireless device, which doesn't fit the eth
type, a driver can be registered with a bus (on which its device would be
scannable) and use this layer for configuring the device.

It can also serve as a staging area for new type of devices till they find some
commonality and can be standardized.

The outline of this proposed library is same as existing ether/crypto devices.

     +-----------------------------------------------------------+
     |                        Application(s)                     |
     +------------------------------.----------------------------+
                                    |
                                    |
     +------------------------------'----------------------------+
     |                     DPDK Framework (APIs)                 |
     +--------------|----|-----------------|---------------------+
                   /      \                 \
            (crypto ops)  (eth ops)      (rawdev ops)        +----+
            /               \                 \              |DrvA|
     +-----'---+        +----`----+        +---'-----+       +----+
     | crypto  |        | ethdev  |        | raw     |
     +--/------+        +---/-----+        +----/----+       +----+
       /\                __/\                  /   ..........|DrvB|
      /  \              /    \                / ../    \     +----+
  +====+ +====+    +====+ +====+            +==/=+      ```Bus Probe 
  |DevA| |DevB|    |DevC| |DevD|            |DevF|
  +====+ +====+    +====+ +====+            +====+
    |      |        |      |                 |    
  ``|``````|````````|``````|`````````````````|````````Bus Scan
   (PCI)   |       (PCI)  (PCI)            (PCI)
         (BusA)

 * It is assumed above that DrvB is a PCI type driver which registers itself
   with PCI Bus
 * Thereafter, when the PCI scan is done, during probe DrvB would match the
   rawdev DevF ID and take control of device
 * Applications can then continue using the device through rawdev API interfaces

Proposed Interfaces
===================

Following broad API categories are exposed by the rawdevice:

1) Device State Operations (start/stop/reset)
2) Communication Channel setup/teardown (queue)
3) Attribute get/set operations (~ioctls)
4) Enqueue/Dequeue Operations (using opaque buffers)
5) Firmware Operations (Load/unload)

Notes:
For (1), other than standard start/stop, reset has been added extra. This is for
cases where device power cycle has various definitions. Semantics of what
stop->start and what reset would mean are still open-ended.

For (2), though currently `queue` has been used a semantic, it would be possible
in implementation to use this with other methods like internally hosted rte_ring.

For (3), applications can pass on an opaque attribute handle/information which
the driver can act upon.

For (4), aim is to allow applications to post buffers (which can be arbit data)
to the device. It is device's responsibility to interpret and handle the buffer.
It can also be expanded to synchronous and async methods of posting buffer.
That would provide broader use-cases.

For (5), Aim is to allow for most basic device firmware management. In this, as
well as other operations, it is expected that those which are not implemneted
would return ENOTSUP allow the application to fail gracefully.

Patchset Information
====================

This patchset includes 5 patches:
* 1~2: Introduce the rawdev library and enable its compilation
* 3~4: Adds a skeleton rawdevice driver, for demonstration purpose.
* 5  : Unittest framewework based on the skeleton driver as backend

Future Work
===========
1. Support for hotplugging and interrupt handling
2. Support for callbacks for enqueue and dequeue of buffers
3. Interfacing with Eth/Crypto/Event type devices for inline offloading

I will be adding a documentation page in v2, shortly.
Maintainers patch would be sent once I have some comments and scope of
getting it IN in 18.02.

References
==========
[1]: http://dpdk.org/ml/archives/dev/2017-November/081550.html

Shreyansh Jain (5):
  rawdev: introduce raw device library support
  config: enable compilation of rawdev library
  drivers/raw: introduce skeleton rawdev driver
  config: enable compilation of rawdev skeleton driver
  test: support for rawdev testcases

 config/common_base                                 |   8 +
 drivers/Makefile                                   |   2 +
 drivers/raw/Makefile                               |   9 +
 drivers/raw/skeleton_rawdev/Makefile               |  25 +
 .../rte_pmd_skeleton_rawdev_version.map            |   4 +
 drivers/raw/skeleton_rawdev/skeleton_rawdev.c      | 668 +++++++++++++++++++++
 drivers/raw/skeleton_rawdev/skeleton_rawdev.h      | 130 ++++
 lib/Makefile                                       |   3 +
 lib/librte_rawdev/Makefile                         |  27 +
 lib/librte_rawdev/rte_rawdev.c                     | 540 +++++++++++++++++
 lib/librte_rawdev/rte_rawdev.h                     | 586 ++++++++++++++++++
 lib/librte_rawdev/rte_rawdev_pmd.h                 | 588 ++++++++++++++++++
 lib/librte_rawdev/rte_rawdev_version.map           |  33 +
 mk/rte.app.mk                                      |   5 +
 test/test/Makefile                                 |   4 +
 test/test/test_rawdev.c                            | 376 ++++++++++++
 16 files changed, 3008 insertions(+)
 create mode 100644 drivers/raw/Makefile
 create mode 100644 drivers/raw/skeleton_rawdev/Makefile
 create mode 100644 drivers/raw/skeleton_rawdev/rte_pmd_skeleton_rawdev_version.map
 create mode 100644 drivers/raw/skeleton_rawdev/skeleton_rawdev.c
 create mode 100644 drivers/raw/skeleton_rawdev/skeleton_rawdev.h
 create mode 100644 lib/librte_rawdev/Makefile
 create mode 100644 lib/librte_rawdev/rte_rawdev.c
 create mode 100644 lib/librte_rawdev/rte_rawdev.h
 create mode 100644 lib/librte_rawdev/rte_rawdev_pmd.h
 create mode 100644 lib/librte_rawdev/rte_rawdev_version.map
 create mode 100644 test/test/test_rawdev.c

-- 
2.14.1

^ permalink raw reply	[flat|nested] 67+ messages in thread

end of thread, other threads:[~2018-01-31 14:46 UTC | newest]

Thread overview: 67+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-02 12:57 [dpdk-dev] [PATCH v1 0/5] Introduce generic 'rawdevice' support Shreyansh Jain
2018-01-02 12:57 ` [dpdk-dev] [PATCH v1 1/5] rawdev: introduce raw device library support Shreyansh Jain
2018-01-06 13:40   ` Trahe, Fiona
2018-01-08 14:09     ` Shreyansh Jain
2018-01-08 14:51       ` Trahe, Fiona
2018-01-12 15:00         ` Shreyansh Jain
2018-01-12 19:35           ` Trahe, Fiona
2018-01-14 22:42   ` Thomas Monjalon
2018-01-14 22:50   ` Thomas Monjalon
2018-01-02 12:57 ` [dpdk-dev] [PATCH v1 2/5] config: enable compilation of rawdev library Shreyansh Jain
2018-01-14 22:50   ` Thomas Monjalon
2018-01-02 12:57 ` [dpdk-dev] [PATCH v1 3/5] drivers/raw: introduce skeleton rawdev driver Shreyansh Jain
2018-01-14 22:54   ` Thomas Monjalon
2018-01-16 10:21     ` Shreyansh Jain
2018-01-16 10:34       ` Thomas Monjalon
2018-01-02 12:57 ` [dpdk-dev] [PATCH v1 4/5] config: enable compilation of rawdev skeleton driver Shreyansh Jain
2018-01-14 22:55   ` Thomas Monjalon
2018-01-02 12:57 ` [dpdk-dev] [PATCH v1 5/5] test: support for rawdev testcases Shreyansh Jain
2018-01-14 22:58   ` Thomas Monjalon
2018-01-16 10:07     ` Shreyansh Jain
2018-01-16 10:32       ` Thomas Monjalon
2018-01-14 23:00 ` [dpdk-dev] [PATCH v1 0/5] Introduce generic 'rawdevice' support Thomas Monjalon
2018-01-15  5:30   ` Shreyansh Jain
2018-01-23 13:59 ` [dpdk-dev] [PATCH v2 00/10] " Shreyansh Jain
2018-01-23 13:59   ` [dpdk-dev] [PATCH v2 01/10] rawdev: introduce raw device library support Shreyansh Jain
2018-01-23 13:59   ` [dpdk-dev] [PATCH v2 02/10] rawdev: add attribute get and set support Shreyansh Jain
2018-01-23 13:59   ` [dpdk-dev] [PATCH v2 03/10] rawdev: add buffer stream IO support Shreyansh Jain
2018-01-23 13:59   ` [dpdk-dev] [PATCH v2 04/10] rawdev: support for extended stats Shreyansh Jain
2018-01-23 13:59   ` [dpdk-dev] [PATCH v2 05/10] rawdev: support for firmware management Shreyansh Jain
2018-01-23 13:59   ` [dpdk-dev] [PATCH v2 06/10] rawdev: add self test support Shreyansh Jain
2018-01-23 13:59   ` [dpdk-dev] [PATCH v2 07/10] drivers/raw: introduce skeleton rawdev driver Shreyansh Jain
2018-01-23 13:59   ` [dpdk-dev] [PATCH v2 08/10] drivers/raw: support for rawdev testcases Shreyansh Jain
2018-01-23 13:59   ` [dpdk-dev] [PATCH v2 09/10] test: enable rawdev skeleton test Shreyansh Jain
2018-01-23 13:59   ` [dpdk-dev] [PATCH v2 10/10] maintainers: claim ownership of rawdev Shreyansh Jain
2018-01-25 22:21   ` [dpdk-dev] [PATCH v2 00/10] Introduce generic 'rawdevice' support Thomas Monjalon
2018-01-29 23:49     ` Thomas Monjalon
2018-01-30  6:31       ` Shreyansh Jain
2018-01-30 14:56   ` [dpdk-dev] [PATCH v3 00/11] " Shreyansh Jain
2018-01-30 14:57     ` [dpdk-dev] [PATCH v3 01/11] rawdev: introduce raw device library support Shreyansh Jain
2018-01-30 14:57     ` [dpdk-dev] [PATCH v3 02/11] rawdev: add attribute get and set support Shreyansh Jain
2018-01-30 14:57     ` [dpdk-dev] [PATCH v3 03/11] rawdev: add buffer stream IO support Shreyansh Jain
2018-01-30 14:57     ` [dpdk-dev] [PATCH v3 04/11] rawdev: support for extended stats Shreyansh Jain
2018-01-30 14:57     ` [dpdk-dev] [PATCH v3 05/11] rawdev: support for firmware management Shreyansh Jain
2018-01-30 14:57     ` [dpdk-dev] [PATCH v3 06/11] rawdev: add self test support Shreyansh Jain
2018-01-30 14:57     ` [dpdk-dev] [PATCH v3 07/11] drivers/raw: introduce skeleton rawdev driver Shreyansh Jain
2018-01-30 16:48       ` Thomas Monjalon
2018-01-30 14:57     ` [dpdk-dev] [PATCH v3 08/11] drivers/raw: support for rawdev testcases Shreyansh Jain
2018-01-30 14:57     ` [dpdk-dev] [PATCH v3 09/11] test: enable rawdev skeleton test Shreyansh Jain
2018-01-30 14:57     ` [dpdk-dev] [PATCH v3 10/11] maintainers: claim ownership of rawdev Shreyansh Jain
2018-01-30 16:50       ` Thomas Monjalon
2018-01-30 14:57     ` [dpdk-dev] [PATCH v3 11/11] doc: add rawdev library page Shreyansh Jain
2018-01-30 16:55     ` [dpdk-dev] [PATCH v3 00/11] Introduce generic 'rawdevice' support Thomas Monjalon
2018-01-31  9:13     ` [dpdk-dev] [PATCH v4 00/10] " Shreyansh Jain
2018-01-31  9:13       ` [dpdk-dev] [PATCH v4 01/10] rawdev: introduce raw device library support Shreyansh Jain
2018-01-31  9:13       ` [dpdk-dev] [PATCH v4 02/10] rawdev: add attribute get and set support Shreyansh Jain
2018-01-31  9:13       ` [dpdk-dev] [PATCH v4 03/10] rawdev: add buffer stream IO support Shreyansh Jain
2018-01-31  9:13       ` [dpdk-dev] [PATCH v4 04/10] rawdev: support for extended stats Shreyansh Jain
2018-01-31  9:13       ` [dpdk-dev] [PATCH v4 05/10] rawdev: support for firmware management Shreyansh Jain
2018-01-31  9:13       ` [dpdk-dev] [PATCH v4 06/10] rawdev: add self test support Shreyansh Jain
2018-01-31  9:13       ` [dpdk-dev] [PATCH v4 07/10] drivers/raw: introduce skeleton rawdev driver Shreyansh Jain
2018-01-31 13:20         ` Thomas Monjalon
2018-01-31 13:31           ` Thomas Monjalon
2018-01-31  9:13       ` [dpdk-dev] [PATCH v4 08/10] drivers/raw: support for rawdev testcases Shreyansh Jain
2018-01-31 14:01         ` Thomas Monjalon
2018-01-31  9:13       ` [dpdk-dev] [PATCH v4 09/10] test: enable rawdev skeleton test Shreyansh Jain
2018-01-31  9:13       ` [dpdk-dev] [PATCH v4 10/10] doc: add rawdev library page and support Doxygen Shreyansh Jain
2018-01-31 14:45       ` [dpdk-dev] [PATCH v4 00/10] Introduce generic 'rawdevice' support Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).