| rte_gpudev.h(3) | Library Functions Manual | rte_gpudev.h(3) |
rte_gpudev.h
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <rte_mbuf.h>
#include <rte_bitops.h>
#include <rte_compat.h>
struct rte_gpu_info
struct rte_gpu_comm_flag
struct rte_gpu_comm_pkt
struct rte_gpu_comm_list
#define RTE_GPU_DEFAULT_MAX 32
#define RTE_GPU_ID_NONE -1
#define RTE_GPU_ID_ANY INT16_MIN
#define RTE_GPU_CALLBACK_ANY_DATA ((void *)-1)
#define RTE_GPU_VOLATILE(x) (*(volatile typeof(x) *)&(x))
#define RTE_GPU_COMM_LIST_PKTS_MAX 1024
#define RTE_GPU_FOREACH(dev_id) RTE_GPU_FOREACH_CHILD(dev_id,
RTE_GPU_ID_ANY)
#define RTE_GPU_FOREACH_PARENT(dev_id)
RTE_GPU_FOREACH_CHILD(dev_id, RTE_GPU_ID_NONE)
#define RTE_GPU_FOREACH_CHILD(dev_id, parent)
typedef void() rte_gpu_callback_t(int16_t dev_id,
enum rte_gpu_event event, void *user_data)
enum rte_gpu_event { RTE_GPU_EVENT_NEW,
RTE_GPU_EVENT_DEL }
enum rte_gpu_comm_flag_type { RTE_GPU_COMM_FLAG_CPU = 0 }
enum rte_gpu_comm_list_status { RTE_GPU_COMM_LIST_FREE = 0,
RTE_GPU_COMM_LIST_READY, RTE_GPU_COMM_LIST_DONE,
RTE_GPU_COMM_LIST_ERROR }
__rte_experimental int rte_gpu_init (size_t dev_max)
__rte_experimental uint16_t rte_gpu_count_avail (void)
__rte_experimental bool rte_gpu_is_valid (int16_t dev_id)
__rte_experimental int16_t rte_gpu_add_child (const char *name, int16_t
parent, uint64_t child_context)
__rte_experimental int16_t rte_gpu_find_next (int16_t dev_id, int16_t
parent)
__rte_experimental int rte_gpu_close (int16_t dev_id)
__rte_experimental int rte_gpu_callback_register (int16_t dev_id, enum
rte_gpu_event event, rte_gpu_callback_t *function, void
*user_data)
__rte_experimental int rte_gpu_callback_unregister (int16_t dev_id,
enum rte_gpu_event event, rte_gpu_callback_t *function, void
*user_data)
__rte_experimental int rte_gpu_info_get (int16_t dev_id, struct
rte_gpu_info *info)
__rte_experimental void * rte_gpu_mem_alloc (int16_t dev_id, size_t
size, unsigned int align) __rte_alloc_size(2)
__rte_experimental int rte_gpu_mem_free (int16_t dev_id, void *ptr)
__rte_experimental int rte_gpu_mem_register (int16_t dev_id, size_t
size, void *ptr)
__rte_experimental int rte_gpu_mem_unregister (int16_t dev_id, void
*ptr)
__rte_experimental void * rte_gpu_mem_cpu_map (int16_t dev_id, size_t
size, void *ptr)
__rte_experimental int rte_gpu_mem_cpu_unmap (int16_t dev_id, void
*ptr)
__rte_experimental int rte_gpu_wmb (int16_t dev_id)
__rte_experimental int rte_gpu_comm_create_flag (uint16_t dev_id,
struct rte_gpu_comm_flag *devflag, enum rte_gpu_comm_flag_type
mtype)
__rte_experimental int rte_gpu_comm_destroy_flag (struct
rte_gpu_comm_flag *devflag)
__rte_experimental int rte_gpu_comm_set_flag (struct
rte_gpu_comm_flag *devflag, uint32_t val)
__rte_experimental int rte_gpu_comm_get_flag_value (struct
rte_gpu_comm_flag *devflag, uint32_t *val)
__rte_experimental struct rte_gpu_comm_list *
rte_gpu_comm_create_list (uint16_t dev_id, uint32_t num_comm_items)
__rte_experimental int rte_gpu_comm_destroy_list (struct
rte_gpu_comm_list *comm_list, uint32_t num_comm_items)
__rte_experimental int rte_gpu_comm_populate_list_pkts (struct
rte_gpu_comm_list *comm_list_item, struct rte_mbuf **mbufs,
uint32_t num_mbufs)
__rte_experimental int rte_gpu_comm_set_status (struct
rte_gpu_comm_list *comm_list_item, enum
rte_gpu_comm_list_status status)
__rte_experimental int rte_gpu_comm_get_status (struct
rte_gpu_comm_list *comm_list_item, enum
rte_gpu_comm_list_status *status)
__rte_experimental int rte_gpu_comm_cleanup_list (struct
rte_gpu_comm_list *comm_list_item)
Generic library to interact with GPU computing device.
The API is not thread-safe. Device management must be done by a single thread.
Warning
Definition in file rte_gpudev.h.
Maximum number of devices if rte_gpu_init() is not called.
Definition at line 32 of file rte_gpudev.h.
Empty device ID.
Definition at line 35 of file rte_gpudev.h.
Catch-all device ID.
Definition at line 37 of file rte_gpudev.h.
Catch-all callback data.
Definition at line 40 of file rte_gpudev.h.
Access variable as volatile.
Definition at line 43 of file rte_gpudev.h.
Max number of packets per communication list.
Definition at line 46 of file rte_gpudev.h.
Warning
Macro to iterate over all valid GPU devices.
Parameters
Definition at line 238 of file rte_gpudev.h.
Warning
Macro to iterate over all valid computing devices having no parent.
Parameters
Definition at line 250 of file rte_gpudev.h.
Value:.PP
for (dev_id = rte_gpu_find_next(0, parent); \
dev_id >= 0; \
dev_id = rte_gpu_find_next(dev_id + 1, parent))
Warning
Macro to iterate over all valid children of a computing device parent.
Parameters
Definition at line 264 of file rte_gpudev.h.
Prototype of event callback function.
Definition at line 77 of file rte_gpudev.h.
Flags passed in notification callback.
Enumerator
Definition at line 69 of file rte_gpudev.h.
Memory where communication flag is allocated.
Enumerator
Definition at line 81 of file rte_gpudev.h.
Possible status for the list of packets shared among CPU and device.
Enumerator
Definition at line 105 of file rte_gpudev.h.
Warning
Initialize the device array before probing devices. If not called, the maximum of probed devices is RTE_GPU_DEFAULT_MAX.
Parameters
Returns
Warning
Return the number of GPU detected and associated to DPDK.
Returns
Warning
Check if the device is valid and initialized in DPDK.
Parameters
Returns
Warning
Create a virtual device representing a context in the parent device.
Parameters
Returns
Warning
Get the ID of the next valid GPU initialized in DPDK.
Parameters
Returns
Warning
Close device or child context. All resources are released.
Parameters
Returns
Warning
Register a function as event callback. A function may be registered multiple times for different events.
Parameters
Returns
Warning
Unregister for an event.
Parameters
Returns
Warning
Return device specific info.
Parameters
Returns
Warning
Allocate a chunk of memory in the device.
Parameters
Returns
Warning
Deallocate a chunk of memory allocated with rte_gpu_mem_alloc().
Parameters
Returns
Warning
Register a chunk of memory on the CPU usable by the device.
Parameters
Returns
Warning
Deregister a chunk of memory previously registered with rte_gpu_mem_register()
Parameters
Returns
Warning
Map a chunk of GPU memory to make it accessible from the CPU using the memory pointer returned by the function. GPU memory has to be allocated via rte_gpu_mem_alloc().
Parameters
Returns
Warning
Unmap a chunk of GPU memory previously mapped with rte_gpu_mem_cpu_map()
Parameters
Returns
Warning
Enforce a GPU write memory barrier.
Parameters
Returns
Warning
Create a communication flag that can be shared between CPU threads and device workload to exchange some status info (e.g. work is done, processing can start, etc..).
Parameters
Returns
Warning
Deallocate a communication flag.
Parameters
Returns
Warning
Set the value of a communication flag as the input value. Flag memory area is treated as volatile. The flag must have been allocated with RTE_GPU_COMM_FLAG_CPU.
Parameters
Returns
Warning
Get the value of the communication flag. Flag memory area is treated as volatile. The flag must have been allocated with RTE_GPU_COMM_FLAG_CPU.
Parameters
Returns
Warning
Create a communication list that can be used to share packets between CPU and device. Each element of the list contains:
The list is allocated in CPU-visible memory. At creation time, every list is in FREE state.
Parameters
Returns
Warning
Destroy a communication list.
Parameters
Returns
Warning
Populate the packets list of the communication item with info from a list of mbufs. Status flag of that packet list is set to READY.
Parameters
Returns
Warning
Set status flag value of a communication list item.
Parameters
Returns
Warning
Get status flag value of a communication list item.
Parameters
Returns
Warning
Reset a communication list item to the original state. The status flag set to FREE and mbufs are returned to the pool.
Parameters
Returns
Generated automatically by Doxygen for DPDK from the source code.
| Version 24.11.3 | DPDK |