DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shreyansh Jain <shreyansh.jain@nxp.com>
To: <fiona.trahe@intel.com>, <thomas@monjalon.net>
Cc: <dev@dpdk.org>, <hemant.agrawal@nxp.com>, <rosen.xu@intel.com>,
	Shreyansh Jain <shreyansh.jain@nxp.com>
Subject: [dpdk-dev] [PATCH v2 00/10] Introduce generic 'rawdevice' support
Date: Tue, 23 Jan 2018 19:29:00 +0530	[thread overview]
Message-ID: <20180123135910.10755-1-shreyansh.jain@nxp.com> (raw)
In-Reply-To: <20180102125749.2379-1-shreyansh.jain@nxp.com>

Change History
~~~~~~~~~~~~~~
v2:
 - restructure comments to prefix model
 - split patches pivoted on APIs introduced in library
 - moved test into drivers/rawdev/skeleton from test/test
 - removed unused RTE_MAX_RAWDEVPORTS and RTE_MAX_RAWDEVS
 - merge patch configurations
 - checkpatch fixes

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

RFC [1]
v1: [2]

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.

** following RST files would be added in v3 **
- doc/guides/rawdevs/skeleton_rawdev.rst
- doc/guides/prog_guide/rawdev.rst

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

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

Shreyansh Jain (10):
  rawdev: introduce raw device library support
  rawdev: add attribute get and set support
  rawdev: add buffer stream IO support
  rawdev: support for extended stats
  rawdev: support for firmware management
  rawdev: add self test support
  drivers/raw: introduce skeleton rawdev driver
  drivers/raw: support for rawdev testcases
  test: enable rawdev skeleton test
  maintainers: claim ownership of rawdev

 MAINTAINERS                                        |   6 +
 config/common_base                                 |   8 +
 drivers/Makefile                                   |   2 +
 drivers/raw/Makefile                               |   9 +
 drivers/raw/skeleton_rawdev/Makefile               |  26 +
 .../rte_pmd_skeleton_rawdev_version.map            |   4 +
 drivers/raw/skeleton_rawdev/skeleton_rawdev.c      | 754 +++++++++++++++++++++
 drivers/raw/skeleton_rawdev/skeleton_rawdev.h      | 136 ++++
 drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c | 431 ++++++++++++
 lib/Makefile                                       |   3 +
 lib/librte_rawdev/Makefile                         |  27 +
 lib/librte_rawdev/rte_rawdev.c                     | 545 +++++++++++++++
 lib/librte_rawdev/rte_rawdev.h                     | 596 ++++++++++++++++
 lib/librte_rawdev/rte_rawdev_pmd.h                 | 605 +++++++++++++++++
 lib/librte_rawdev/rte_rawdev_version.map           |  34 +
 mk/rte.app.mk                                      |   5 +
 test/test/Makefile                                 |   4 +
 test/test/test_rawdev.c                            |  27 +
 18 files changed, 3222 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 drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
 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

  parent reply	other threads:[~2018-01-23 14:24 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-02 12:57 [dpdk-dev] [PATCH v1 0/5] " 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 ` Shreyansh Jain [this message]
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

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=20180123135910.10755-1-shreyansh.jain@nxp.com \
    --to=shreyansh.jain@nxp.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=rosen.xu@intel.com \
    --cc=thomas@monjalon.net \
    /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 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).