Commit Graph

70 Commits

Author SHA1 Message Date
Bruce Richardson
4b918c1ad9 dma/idxd: fix default for workqueue options
When no --wq-option flag is passed to dpdk_idxd_cfg.py script, the
default value used by argparse is None. This leads to later errors which
are expecting an array value:

	TypeError: 'NoneType' object is not iterable

This is fixed by specifying that the empty array should be the default
if no flags are passed.

Fixes: 94b0f04dc0 ("dma/idxd: add generic option for queue config")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Sunil Pai G <sunil.pai.g@intel.com>
Acked-by: Conor Walsh <conor.walsh@intel.com>
2022-06-21 17:33:30 +02:00
Min Hu (Connor)
7342e61205 dma/hisilicon: fix includes in header file
Header files should be self contained. This patch fixed it.

Fixes: 9e16317a38 ("dma/hisilicon: add probing")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
2022-06-15 16:33:42 +02:00
Sivaprasad Tummala
674c4f2d6c dma/skeleton: support multiple instances
DPDK app can support multiple hardware DMA instances.
With DMA skeleton, only a single instance can be configured.

This patch supports multiple driver instances per device.

Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
Tested-by: Vipin Varghese <vipin.varghese@amd.com>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
Tested-by: Chengwen Feng <fengchengwen@huawei.com>
2022-06-15 16:17:52 +02:00
Chengwen Feng
618a40a0c9 dma/skeleton: fix index returned when no memcpy completed
If no memcopy request is completed, the ring_idx of the last completed
operation need returned by last_idx parameter. This patch fixes it.

Fixes: 05d5fc66a2 ("dma/skeleton: introduce skeleton driver")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
2022-06-15 16:15:07 +02:00
Kevin Laatz
f217dbff20 dma/idxd: fix error code for PCI device commands
When sending a command to an idxd device via PCI BAR, the response from
HW is checked to ensure it was successful. The response was incorrectly
being negated before being returned by the function, meaning error codes
cannot be checked against the HW specification.

This patch fixes the return values of the function by removing the
negation.

Fixes: 9449330a84 ("dma/idxd: create dmadev instances on PCI probe")
Fixes: 452c1916b0 ("dma/idxd: fix truncated error code in status check")
Cc: stable@dpdk.org

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Conor Walsh <conor.walsh@intel.com>
2022-06-08 10:54:02 +02:00
Kevin Laatz
94b0f04dc0 dma/idxd: add generic option for queue config
The device config script currently uses some defaults to configure
devices in a generic way.

With the addition of this option, users have more control over how
queues are configured.

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Sunil Pai G <sunil.pai.g@intel.com>
2022-06-07 12:46:12 +02:00
Chengwen Feng
157e8326e9 dma/hisilicon: support vchan status query
This patch adds support for vchan-status ops.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
2022-06-07 12:41:06 +02:00
Chengwen Feng
e03c601acb dma/hisilicon: enhance CQ scan robustness
The CQ (completion queue) descriptors were updated by hardware, and then
scanned by driver to retrieve hardware completion status.

This patch enhances robustness by following:
1. replace while (true) with a finite loop to avoid potential dead loop.
2. check the csq_head field in CQ descriptor to avoid status array
overflows.

Fixes: 2db4f0b823 ("dma/hisilicon: add data path")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
2022-06-07 12:40:25 +02:00
Chengwen Feng
2301dee970 dma/hisilicon: fix index returned when no DMA completed
If no DMA request is completed, the ring_idx of the last completed
operation need returned by last_idx parameter. This patch fixes it.

Fixes: 2db4f0b823 ("dma/hisilicon: add data path")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
2022-06-07 12:35:38 +02:00
Nipun Gupta
7661b7d33b dma/dpaa2: support statistics
This patch support DMA read and reset statistics operations.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2022-06-01 08:58:27 +02:00
Nipun Gupta
9e2f8ca6c2 dma/dpaa2: support DMA operations
This patch support copy, submit, completed and
completed status functionality of DMA driver.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2022-06-01 08:58:27 +02:00
Nipun Gupta
97f9032f5a dma/dpaa2: add driver-specific configuration API
Add additional PMD APIs for DPAA2 QDMA driver for configuring
RBP, Ultra Short format, and Scatter Gather support

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2022-06-01 08:58:27 +02:00
Nipun Gupta
379206e9b4 dma/dpaa2: support basic operations
This patch support basic DMA operations which includes
device capability and channel setup.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2022-06-01 08:58:27 +02:00
Nipun Gupta
8caf8427f8 dma/dpaa2: introduce driver skeleton
The DPAA2 DMA  driver is an implementation of the dmadev APIs,
that provide means to initiate a DMA transaction from CPU.
Earlier this was part of RAW driver, but with DMA drivers
added as separate flavor of drivers, this driver is being
moved to DMA drivers.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2022-06-01 08:58:27 +02:00
Bruce Richardson
6a87d036a7 dma/idxd: configure maximum batch size to high value
When configuring an Intel DSA instance using the utility script
dpdk_idxd_cfg.py, explicitly set the max supported batch size value to a
high value, to ensure large bursts are supported if so desired. The
default in the linux kernel is now just 32 [1], which may not be
sufficient for all DPDK apps.

[1] https://lore.kernel.org/r/163528473483.3926048.7950067926287180976.stgit@djiang5-desk3.ch.intel.com

Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
2022-02-23 16:45:16 +01:00
Chengwen Feng
033904450b dma/hisilicon: use common PCI device naming
For DMA device 0000:7d:0.0, the original generated dmadev name starts
with the "7d:0.0", which is not expected.
This patch uses rte_pci_device_name API to generates the dmadev name.

Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
2022-02-23 16:27:59 +01:00
Chengwen Feng
410c9bc835 dma/hisilicon: add queue full statistics
This patch adds queue full statistics for HiSilicon DMA PMD.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
2022-02-23 16:26:00 +01:00
Chengwen Feng
dd69081182 dma/hisilicon: support registers dump for Kunpeng 930
This patch supports dump Kunpeng930 DMA registers.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
2022-02-23 16:25:00 +01:00
Chengwen Feng
2265601837 dma/hisilicon: support error handling with Kunpeng 930
The Kunpeng930 DMA supports the capability of handles errors.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
2022-02-23 15:47:47 +01:00
Chengwen Feng
9805175228 dma/hisilicon: support Kunpeng 930
The Kunpeng930 DMA devices have the same PCI device id with Kunpeng920,
but with different PCI revision and register layout. This patch
introduces the basic initialization for Kunpeng930 DMA devices.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
2022-02-23 15:47:21 +01:00
Radu Nicolau
cecf5ed9e4 dma/idxd: support allow/block list
Add support for allow or block list for devices bound
to the kernel driver.
When used the allow or block list applies as an additional
condition to the name prefix.

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
2022-02-13 23:18:01 +01:00
Srikanth Yalavarthi
d91998ff68 dma/cnxk: fix installing internal headers
DMA module internal header files are currently being installed to the
prefix directory. This patch updates DMA meson config file to exclude
internal headers during install stage.

Fixes: 53f6d7328b ("dma/cnxk: create and initialize device on PCI probing")
Cc: stable@dpdk.org

Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
Acked-by: Radha Mohan Chintakuntla <radhac@marvell.com>
2022-01-27 18:11:11 +01:00
Bruce Richardson
63990aeb08 dma/idxd: fix wrap-around in burst capacity calculation
The burst capacity calculation code assumes that the write and read
(i.e. ids_returned) values both wrap at the ring-size, but the read
value instead wraps as UINT16_MAX. Therefore, instead of just adding
ring-size to the write value in case the read is greater, we need to
just always mask the result to ensure a correct, in-range, value.

Fixes: 9459de4edc ("dma/idxd: add burst capacity")
Cc: stable@dpdk.org

Reported-by: Sunil Pai G <sunil.pai.g@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Sunil Pai G <sunil.pai.g@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
2022-01-20 14:05:14 +01:00
Bruce Richardson
3277676319 dma/idxd: fix paths to driver sysfs directory
Recent kernel changes[1][2] mean that we cannot guarantee that the paths
in sysfs used for creating/binding a DSA or workqueue instance will be
as given in the utility script, since they are now "compatibility-mode
only". Update script to support both new paths and compatibility ones.

[1] https://lore.kernel.org/all/162637445139.744545.6008938867943724701.stgit@djiang5-desk3.ch.intel.com/
[2] https://lore.kernel.org/all/162637468705.744545.4399080971745974435.stgit@djiang5-desk3.ch.intel.com/

Fixes: 01863b9d23 ("raw/ioat: include example configuration script")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
2022-01-20 14:04:40 +01:00
Bruce Richardson
a2b43447e9 dma/idxd: fix burst capacity calculation
When the maximum burst size supported by HW is less than the available
ring space, incorrect capacity was returned when there was already some
jobs queued up for submission. This was because the capacity calculation
failed to subtract the number of already-enqueued jobs from the max
burst size. After subtraction is done, ensure that any negative values
(which should never occur if the user respects the reported limits), are
clamped to zero.

Fixes: 9459de4edc ("dma/idxd: add burst capacity")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
Tested-by: Jiayu Hu <jiayu.hu@intel.com>
2022-01-20 13:40:20 +01:00
Josh Soref
7be78d0279 fix spelling in comments and strings
The tool comes from https://github.com/jsoref

Signed-off-by: Josh Soref <jsoref@gmail.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2022-01-11 12:16:53 +01:00
Gagandeep Singh
3344172698 dma/dpaa: support statistics
This patch support DMA read and reset statistics operations.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
2021-11-10 13:48:38 +01:00
Gagandeep Singh
7da29a644c dma/dpaa: support DMA operations
This patch support copy, submit, completed and
completed status functionality of DMA driver.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
2021-11-10 13:48:38 +01:00
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