Skip to content

Commit

Permalink
dmadev: introduce DMA device library
Browse files Browse the repository at this point in the history
The 'dmadev' is a generic type of DMA device.

This patch introduce the 'dmadev' device allocation functions.

The infrastructure is prepared to welcome drivers in drivers/dma/

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
  • Loading branch information
fengchengwen authored and tmonjalo committed Oct 17, 2021
1 parent e9123c4 commit b36970f
Show file tree
Hide file tree
Showing 17 changed files with 868 additions and 0 deletions.
5 changes: 5 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@ F: app/test-regex/
F: doc/guides/prog_guide/regexdev.rst
F: doc/guides/regexdevs/features/default.ini

DMA device API - EXPERIMENTAL
M: Chengwen Feng <fengchengwen@huawei.com>
F: lib/dmadev/
F: doc/guides/prog_guide/dmadev.rst

Eventdev API
M: Jerin Jacob <jerinj@marvell.com>
T: git://dpdk.org/next/dpdk-next-eventdev
Expand Down
1 change: 1 addition & 0 deletions doc/api/doxy-api-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The public API headers are grouped by topics:
[compressdev] (@ref rte_compressdev.h),
[compress] (@ref rte_comp.h),
[regexdev] (@ref rte_regexdev.h),
[dmadev] (@ref rte_dmadev.h),
[eventdev] (@ref rte_eventdev.h),
[event_eth_rx_adapter] (@ref rte_event_eth_rx_adapter.h),
[event_eth_tx_adapter] (@ref rte_event_eth_tx_adapter.h),
Expand Down
1 change: 1 addition & 0 deletions doc/api/doxy-api.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ INPUT = @TOPDIR@/doc/api/doxy-api-index.md \
@TOPDIR@/lib/compressdev \
@TOPDIR@/lib/cryptodev \
@TOPDIR@/lib/distributor \
@TOPDIR@/lib/dmadev \
@TOPDIR@/lib/efd \
@TOPDIR@/lib/ethdev \
@TOPDIR@/lib/eventdev \
Expand Down
12 changes: 12 additions & 0 deletions doc/guides/dmadevs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. SPDX-License-Identifier: BSD-3-Clause
Copyright 2021 HiSilicon Limited
DMA Device Drivers
==================

The following are a list of DMA device drivers, which can be used from
an application through DMA API.

.. toctree::
:maxdepth: 2
:numbered:
1 change: 1 addition & 0 deletions doc/guides/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ DPDK documentation
compressdevs/index
vdpadevs/index
regexdevs/index
dmadevs/index
eventdevs/index
rawdevs/index
mempool/index
Expand Down
58 changes: 58 additions & 0 deletions doc/guides/prog_guide/dmadev.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
.. SPDX-License-Identifier: BSD-3-Clause
Copyright 2021 HiSilicon Limited
DMA Device Library
==================

The DMA library provides a DMA device framework for management and provisioning
of hardware and software DMA poll mode drivers, defining generic API which
support a number of different DMA operations.


Design Principles
-----------------

The DMA framework provides a generic DMA device framework which supports both
physical (hardware) and virtual (software) DMA devices, as well as a generic DMA
API which allows DMA devices to be managed and configured, and supports DMA
operations to be provisioned on DMA poll mode driver.

.. _figure_dmadev:

.. figure:: img/dmadev.*

The above figure shows the model on which the DMA framework is built on:

* The DMA controller could have multiple hardware DMA channels (aka. hardware
DMA queues), each hardware DMA channel should be represented by a dmadev.
* The dmadev could create multiple virtual DMA channels, each virtual DMA
channel represents a different transfer context.
* The DMA operation request must be submitted to the virtual DMA channel.


Device Management
-----------------

Device Creation
~~~~~~~~~~~~~~~

Physical DMA controllers are discovered during the PCI probe/enumeration of the
EAL function which is executed at DPDK initialization, this is based on their
PCI BDF (bus/bridge, device, function). Specific physical DMA controllers, like
other physical devices in DPDK can be listed using the EAL command line options.

The dmadevs are dynamically allocated by using the function
``rte_dma_pmd_allocate`` based on the number of hardware DMA channels.


Device Identification
~~~~~~~~~~~~~~~~~~~~~

Each DMA device, whether physical or virtual is uniquely designated by two
identifiers:

- A unique device index used to designate the DMA device in all functions
exported by the DMA API.

- A device name used to designate the DMA device in console messages, for
administration or debugging purposes.
283 changes: 283 additions & 0 deletions doc/guides/prog_guide/img/dmadev.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions doc/guides/prog_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Programmer's Guide
cryptodev_lib
compressdev
regexdev
dmadev
rte_security
rawdev
link_bonding_poll_mode_drv_lib
Expand Down
Loading

0 comments on commit b36970f

Please sign in to comment.