Commit Graph

92 Commits

Author SHA1 Message Date
Gagandeep Singh
453d8273d4 dma/dpaa: support basic operations
This patch support basic DMA operations which includes
device capability and channel setup.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
2021-11-10 13:48:38 +01:00
Gagandeep Singh
cc166b51c3 dma/dpaa: add device probing
This patch add device initialisation functionality.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
2021-11-10 13:48:38 +01:00
Gagandeep Singh
583f373297 dma/dpaa: introduce DPAA DMA driver skeleton
The DPAA DMA  driver is an implementation of the dmadev APIs,
that provide means to initiate a DMA transaction from CPU.
The initiated DMA is performed without CPU being involved
in the actual DMA transaction. This is achieved via using
the QDMA controller of DPAA SoC.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
2021-11-10 13:48:38 +01:00
Radha Mohan Chintakuntla
ebc539271e dma/cnxk: add statistics
Add the stats function to get the DMA statistics.

Signed-off-by: Radha Mohan Chintakuntla <radhac@marvell.com>
2021-11-08 00:08:45 +01:00
Radha Mohan Chintakuntla
3340c3e227 dma/cnxk: add scatter-gather copy
Add the copy_sg function that will do the multiple DMA transfers of
different sizes and different source/destination as well.

Signed-off-by: Radha Mohan Chintakuntla <radhac@marvell.com>
2021-11-08 00:08:45 +01:00
Radha Mohan Chintakuntla
b56f1e2dad dma/cnxk: add channel operations
Add functions for the dmadev vchan setup and DMA operations.

Signed-off-by: Radha Mohan Chintakuntla <radhac@marvell.com>
2021-11-08 00:08:45 +01:00
Radha Mohan Chintakuntla
53f6d7328b dma/cnxk: create and initialize device on PCI probing
This patch creates and initializes a dmadev device on pci probe.

Signed-off-by: Radha Mohan Chintakuntla <radhac@marvell.com>
2021-11-08 00:08:45 +01:00
Chengwen Feng
569e850b4b dma/hisilicon: support multi-process
This patch add multi-process support for Kunpeng DMA devices.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
2021-11-07 20:02:27 +01:00
Chengwen Feng
2db4f0b823 dma/hisilicon: add data path
This patch add data path functions for Kunpeng DMA devices.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
2021-11-07 20:02:27 +01:00
Chengwen Feng
3c5f5f03a0 dma/hisilicon: add control path
This patch add control path functions for Kunpeng DMA devices.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
2021-11-07 20:02:24 +01:00
Chengwen Feng
9e16317a38 dma/hisilicon: add probing
This patch add dmadev instances create during the PCI probe, and
destroy them during the PCI remove. Internal structures and HW
definitions was also included.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
2021-11-07 20:01:52 +01:00
Chengwen Feng
4d0d4cf327 dma/hisilicon: introduce driver skeleton
Add the basic device probe and remove functions and initial
documentation for new hisilicon DMA drivers.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
2021-11-07 19:54:19 +01:00
Kevin Laatz
452c1916b0 dma/idxd: fix truncated error code in status check
When checking if the DMA device is active, the result of the operand will
always be zero since the err_code is truncated to 8 bits which makes
checking the 31st bit impossible.

This is fixed by changing the type of err_code to uint32_t so that it is
not truncated.

Coverity issue: 373657
Fixes: 9449330a84 ("dma/idxd: create dmadev instances on PCI probe")

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2021-10-27 17:01:56 +02:00
David Marchand
6353ff43a7 dma/idxd: fix build on Windows
Windows compilation gives us a splat:
In file included from ../drivers/dma/idxd/idxd_pci.c:10:
In file included from ..\drivers\dma\idxd/idxd_internal.h:11:
..\drivers\dma\idxd/idxd_hw_defs.h:46:21: error: expected member name or
 ';' after declaration specifiers
        uint16_t __reserved[13];
        ~~~~~~~~           ^
1 error generated.

Ironically, __reserved is probably a reserved token.
Some drivers that build fine on Windows have structs with a "reserved"
field, let's go with this.

Fixes: 82147042d0 ("dma/idxd: add datapath structures")

Signed-off-by: David Marchand <david.marchand@redhat.com>
2021-10-23 08:52:25 +02:00
Bruce Richardson
fed600889d dmadev: enable build on Windows
The dmadev library was not added to the list of libraries built on
Windows, meaning it was skipped in those builds and also that none of
the drivers were being considered for build. Adding dmadev to the list
fixes this, and also enables the skeleton dmadev driver to be built -
all-be-it with a small fix necessary.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
Tested-by: Conor Walsh <conor.walsh@intel.com>
2021-10-22 22:40:59 +02:00
Conor Walsh
96d7833393 dma/ioat: add burst capacity
Adds the ability to find the remaining space in the IOAT ring.

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2021-10-22 22:40:59 +02:00
Conor Walsh
912c204424 dma/ioat: add vchan status
Add support for the rte_dmadev_vchan_status API call.

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2021-10-22 22:40:59 +02:00
Conor Walsh
f526394174 dma/ioat: add statistics
Add statistic tracking for operations in IOAT.

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2021-10-22 22:40:59 +02:00
Conor Walsh
9f46de12c4 dma/ioat: add data path completion
Add the data path functions for gathering completed operations
from IOAT devices.

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2021-10-22 22:40:59 +02:00
Conor Walsh
3d4b027324 dma/ioat: add data path job submission
Add data path functions for enqueuing and submitting operations to
IOAT devices.

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
2021-10-22 22:40:59 +02:00
Conor Walsh
583f046dd4 dma/ioat: add start and stop
Add start, stop and recover functions for IOAT devices.

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
2021-10-22 22:40:59 +02:00
Conor Walsh
a19a2dceda dma/ioat: add configuration
Add functions for device configuration. The info_get and close functions
are included here also. info_get can be useful for checking successful
configuration and close is used by the dmadev api when releasing a
configured device.

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
2021-10-22 22:40:59 +02:00
Conor Walsh
4ffd224742 dma/ioat: add datapath structures
Add data structures required for the data path of IOAT devices.

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
2021-10-22 22:40:59 +02:00
Conor Walsh
13859ab773 dma/ioat: create dmadev instances on PCI probe
When a suitable device is found during the PCI probe, create a dmadev
instance for each channel. Internal structures and HW definitions required
for device creation are also included.

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
2021-10-22 22:40:59 +02:00
Conor Walsh
866e46bcd8 dma/ioat: add device probing and removal
Add the basic device probe/remove skeleton code and initial documentation
for new IOAT DMA driver. Maintainers update is also included in this
patch.

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
2021-10-22 22:40:59 +02:00
Conor Walsh
8bedc51583 dma/idxd: move config script from raw driver
Move the example script for configuring IDXD devices bound to the IDXD
kernel driver from raw to dma, and create a symlink to still allow use from
raw.

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2021-10-22 22:40:59 +02:00
Kevin Laatz
9459de4edc dma/idxd: add burst capacity
Add support for the burst capacity API. This API will provide the calling
application with the remaining capacity of the current burst (limited by
max HW batch size).

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
2021-10-22 22:40:59 +02:00
Kevin Laatz
5a23df349a dma/idxd: add vchan status
When testing dmadev drivers, it is useful to have the HW device in a known
state. This patch adds the implementation of the function which will wait
for the device to be idle (all jobs completed) before proceeding.

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2021-10-22 22:40:59 +02:00
Kevin Laatz
280c3ca02c dma/idxd: add operation statistic tracking
Add statistic tracking for DSA devices.

The dmadev library documentation is also updated to add a generic section
for using the library's statistics APIs.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
2021-10-22 22:40:59 +02:00
Kevin Laatz
97aeed5637 dma/idxd: add data path job completion
Add the data path functions for gathering completed operations.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2021-10-22 22:40:59 +02:00
Kevin Laatz
3d36a0a1c7 dma/idxd: add data path job submission
Add data path functions for enqueuing and submitting operations to DSA
devices.

Documentation updates are included for dmadev library and IDXD driver docs
as appropriate.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
2021-10-22 22:40:59 +02:00
Kevin Laatz
a42ac7e31e dma/idxd: add start and stop for PCI devices
Add device start/stop functions for DSA devices bound to vfio. For devices
bound to the IDXD kernel driver, these are not required since the IDXD
kernel driver takes care of this.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2021-10-22 22:40:59 +02:00
Kevin Laatz
2f7d42c6e1 dma/idxd: add configure and info
Add functions for device configuration. The info_get function is included
here since it can be useful for checking successful configuration.

Documentation is also updated to add device configuration usage info.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
2021-10-22 22:40:59 +02:00
Kevin Laatz
82147042d0 dma/idxd: add datapath structures
Add data structures required for the data path for IDXD devices.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
2021-10-22 22:40:59 +02:00
Kevin Laatz
9449330a84 dma/idxd: create dmadev instances on PCI probe
When a suitable device is found during the PCI probe, create a dmadev
instance for each HW queue. HW definitions required are also included.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2021-10-22 22:40:59 +02:00
Kevin Laatz
55dc0f6096 dma/idxd: create dmadev instances on bus probe
When a suitable device is found during the bus scan/probe, create a dmadev
instance for each HW queue. Internal structures required for device
creation are also added.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2021-10-22 22:40:58 +02:00
Kevin Laatz
e888bb1278 dma/idxd: add bus device probing
Add the basic device probing for DSA devices bound to the IDXD kernel
driver. These devices can be configured via sysfs and made available to
DPDK if they are found during bus scan. Relevant documentation is included.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2021-10-22 22:40:58 +02:00
Kevin Laatz
e33ad06eae dma/idxd: add skeleton for VFIO based DSA device
Add the basic device probe/remove skeleton code for DSA device bound to
the vfio pci driver. Relevant documentation and MAINTAINERS update also
included.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2021-10-22 22:40:58 +02:00
Kevin Laatz
ea8cf0f853 dmadev: add burst capacity API
Add a burst capacity check API to the dmadev library. This API is useful to
applications which need to how many descriptors can be enqueued in the
current batch. For example, it could be used to determine whether all
segments of a multi-segment packet can be enqueued in the same batch or not
(to avoid half-offload of the packet).

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2021-10-18 11:17:30 +02:00
Bruce Richardson
5e0f859127 dmadev: add channel status check for testing use
Add in a function to check if a device or vchan has completed all jobs
assigned to it, without gathering in the results. This is primarily for
use in testing, to allow the hardware to be in a known-state prior to
gathering completions.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
2021-10-18 11:17:21 +02:00
Chengwen Feng
05d5fc66a2 dma/skeleton: introduce skeleton driver
Skeleton dmadevice driver, on the lines of rawdev skeleton, is for
showcasing of the dmadev library.

Design of skeleton involves a virtual device which is plugged into VDEV
bus on initialization.

Also, enable compilation of dmadev skeleton drivers.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2021-10-17 20:49:58 +02:00
Chengwen Feng
b36970f2e1 dmadev: introduce DMA device library
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>
2021-10-17 20:49:57 +02:00