Commit Graph

20 Commits

Author SHA1 Message Date
David Marchand
1acb7f5474 dev: hide driver object
Make rte_driver opaque for non internal users.
This will make extending this object possible without breaking the ABI.

Introduce a new driver header and move rte_driver definition.
Update drivers and library to use the internal header.

Some applications may have been dereferencing rte_driver objects, mark
this object's accessors as stable.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
2022-09-23 16:14:34 +02:00
David Marchand
1f37cb2bb4 bus/pci: make driver-only headers private
The pci bus interface is for drivers only.
Mark as internal and move the header in the driver headers list.

While at it, cleanup the code:
- fix indentation,
- remove unneeded reference to bus specific singleton object,
- remove unneeded list head structure type,
- reorder the definitions and macro manipulating the bus singleton object,
- remove inclusion of rte_bus.h and fix the code that relied on implicit
  inclusion,

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
2022-09-23 16:14:34 +02:00
Thomas Monjalon
40c7e9608b gpu/cuda: fix build
A recent commit removed errno.h from rte_common.h.
It has to be added in various places where it is used,
and was implicitly included via rte_common.h,
but was forgotten in gpu/cuda.

As a result, the compilation is broken:
	drivers/gpu/cuda/gdrcopy.c:116:17: error: ‘ENOTSUP’ undeclared

Note that rte_errno.h does not include errno.h.
The include of errno.h is added.

Fixes: 72b452c5f2 ("eal: remove unneeded includes from a public header")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: David Marchand <david.marchand@redhat.com>
2022-09-23 10:39:36 +02:00
David Marchand
72206323a5 version: 22.11-rc0
Start a new release cycle with empty release notes.

The ABI version becomes 23.0.
The map files are updated to the new ABI major number (23).
The ABI exceptions are dropped and CI ABI checks are disabled because
compatibility is not preserved.
Special handling of removed drivers is also dropped in check-abi.sh and
a note has been added in libabigail.abignore as a reminder.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2022-07-21 12:13:48 +02:00
Elena Agostini
0354e8e860 gpu/cuda: unmap GPU memory while freeing
Enable GPU_REGISTERED flag in gpu/cuda driver in the memory list.
If a GPU memory address CPU mapped is freed before being
unmapped, CUDA driver unmaps it before freeing the memory.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-05-24 23:09:49 +02:00
Elena Agostini
7850d19f3f gpu/cuda: add more NVIDIA devices
Add more NVIDIA GPU devices to the gpu/cuda driver list
compatible with GPUDirect RDMA.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-04-14 10:01:11 +02:00
Elena Agostini
442876b2d8 gpu/cuda: add NVIDIA A30X identifier for DPU
A30X GPU code for DPU.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-04-04 21:02:55 +02:00
Elena Agostini
ca12f5e8a7 gpu/cuda: mark unused GDRCopy functions parameters
Without enabling gdrcopy, DPDK build has warnings about
unused gdrcopy functions input parameters.

This patch set them to __rte_unused .

Fixes: 24c7759 ("gpu/cuda: map GPU memory with GDRCopy")

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-03-10 21:17:34 +01:00
Elena Agostini
1fd3de64ff gpudev: fix page alignment in communication list
Memory allocated for CPU mapping the status flag
in the communication list should be aligned to the
GPU page size, which can be different of CPU page alignment.

The GPU page size is added to the GPU info,
and is used when creating a communication list.

Fixes: 9b8cae4d99 ("gpudev: use CPU mapping in communication list")

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-03-09 00:14:55 +01:00
Elena Agostini
0105d49e7e gpu/cuda: fix dependency loading path
A slash was missing in libcuda.so path for dlopen.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-03-07 22:42:36 +01:00
Elena Agostini
24c77594e0 gpu/cuda: map GPU memory with GDRCopy
To enable the gpudev rte_gpu_mem_cpu_map feature to expose
GPU memory to the CPU, the GPU CUDA driver library needs
the GDRCopy library and driver.

If DPDK is built without GDRCopy, the GPU CUDA driver returns
error if the is invoked rte_gpu_mem_cpu_map.

All the others GPU CUDA driver functionalities are not affected by
the absence of GDRCopy, thus this is an optional functionality
that can be enabled in the GPU CUDA driver.

CUDA driver documentation has been updated accordingly.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-02-27 18:16:20 +01:00
Elena Agostini
56b5bb509f gpu/cuda: differentiate V100 32GB GPU IDs
Differentiate between GPU V100 32GB SMX2 device id
and V100 32GB PCIe device id.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-02-10 16:14:24 +01:00
Elena Agostini
d69bb47d21 gpudev: expose GPU memory to CPU
Enable the possibility to expose a GPU memory area and make it
accessible from the CPU.

GPU memory has to be allocated via rte_gpu_mem_alloc().

This patch allows the gpudev library to map (and unmap),
through the GPU driver, a chunk of GPU memory and to return
a memory pointer usable by the CPU to access the GPU memory area.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-02-10 10:06:56 +01:00
Elena Agostini
c8557ed434 gpudev: add alignment for memory allocation
Similarly to rte_malloc, rte_gpu_mem_alloc accepts as
input the memory alignment size.

GPU driver should return GPU memory address aligned
with the input value.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-01-21 11:33:25 +01:00
Elena Agostini
65ac1464ff gpu/cuda: add NVIDIA GPU A100 identifier for DPU
Adding a new NVIDIA GPU identifier to let
driver recognize the A100 on a DPU card.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-01-20 14:22:37 +01:00
Elena Agostini
98ddd04c6a gpu/cuda: fix memory list cleanup
Memory list cleanup (called by cuda_mem_free)
was not properly set the new head of the list
when deleting an entry.

Fixes: 1306a73b19 ("gpu/cuda: introduce CUDA driver")
Cc: stable@dpdk.org

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-01-20 14:17:00 +01:00
Elena Agostini
94220b3977 gpu/cuda: set rte_errno
Set correct rte_errno variable in CUDA driver
and return -rte_errno in case of error.

rte_errno values are compliant with the gpudev library documentation.

Fixes: 1306a73b19 ("gpu/cuda: introduce CUDA driver")

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2021-11-24 12:00:42 +01:00
Elena Agostini
1674c56dc3 gpudev: manage null parameters in memory functions
The gpudev functions free, register and unregister
return gracefully if input pointer is NULL or size 0,
as API doc was indicating no-op accepted values.

CUDA driver checks are removed because redundant
with the checks added in gpudev library.

Fixes: e818c4e2bf ("gpudev: add memory API")

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2021-11-24 09:38:43 +01:00
Elena Agostini
1306a73b19 gpu/cuda: introduce CUDA driver
This is the CUDA implementation of the gpudev library.
Functionalities implemented through CUDA Driver API are:
- Device probe and remove
- Manage device memory allocations
- Register/unregister external CPU memory in the device memory area

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2021-11-16 17:47:52 +01:00
Elena Agostini
8b8036a66e gpudev: introduce GPU device class library
In heterogeneous computing system, processing is not only in the CPU.
Some tasks can be delegated to devices working in parallel.

The new library gpudev is for dealing with GPGPU computing devices
from a DPDK application running on the CPU.

The infrastructure is prepared to welcome drivers in drivers/gpu/.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2021-11-08 17:20:52 +01:00