---
name: "rte_gpu_mem_register"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_gpudev.h"
---

# rte\_gpu\_mem\_register(3)

Part of [rte\_gpudev.h(3)](/rte_gpudev.h/3.md).

## NAME

rte\_gpudev.h

## SYNOPSIS

`#include <stddef.h>`\
 `#include <stdint.h>`\
 `#include <stdbool.h>`\
 `#include <rte_mbuf.h>`\
 `#include <rte_bitops.h>`\
 `#include <rte_compat.h>`\

### Data Structures

struct **rte\_gpu\_info**\
 struct **rte\_gpu\_comm\_flag**\
 struct **rte\_gpu\_comm\_pkt**\
 struct **rte\_gpu\_comm\_list**\

### Macros

\#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)\

### Typedefs

**typedef** void() **rte\_gpu\_callback\_t**(int16\_t dev\_id, enum **rte\_gpu\_event** event, void \*user\_data)\

### Enumerations

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** }\

### Functions

\_\_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)\

## Detailed Description

Generic library to interact with GPU computing device.

The API is not thread-safe. Device management must be done by a single thread.

**Warning**

**EXPERIMENTAL:** this API may change without prior notice.

Definition in file **rte\_gpudev.h**.

## Macro Definition Documentation

### #define RTE\_GPU\_DEFAULT\_MAX 32

Maximum number of devices if **rte\_gpu\_init()** is not called.

Definition at line **32** of file **rte\_gpudev.h**.

### #define RTE\_GPU\_ID\_NONE -1

Empty device ID.

Definition at line **35** of file **rte\_gpudev.h**.

### #define RTE\_GPU\_ID\_ANY INT16\_MIN

Catch-all device ID.

Definition at line **37** of file **rte\_gpudev.h**.

### #define RTE\_GPU\_CALLBACK\_ANY\_DATA ((void \*)-1)

Catch-all callback data.

Definition at line **40** of file **rte\_gpudev.h**.

### #define RTE\_GPU\_VOLATILE(x) (\*(volatile typeof(x) \*)&(x))

Access variable as volatile.

Definition at line **43** of file **rte\_gpudev.h**.

### #define RTE\_GPU\_COMM\_LIST\_PKTS\_MAX 1024

Max number of packets per communication list.

Definition at line **46** of file **rte\_gpudev.h**.

### #define RTE\_GPU\_FOREACH(dev\_id) RTE\_GPU\_FOREACH\_CHILD(dev\_id, RTE\_GPU\_ID\_ANY)

**Warning**

**EXPERIMENTAL:** this API may change without prior notice.

Macro to iterate over all valid GPU devices.

**Parameters**

*dev\_id* The ID of the next possible valid device, usually 0 to iterate all.

Definition at line **238** of file **rte\_gpudev.h**.

### #define RTE\_GPU\_FOREACH\_PARENT(dev\_id) RTE\_GPU\_FOREACH\_CHILD(dev\_id, RTE\_GPU\_ID\_NONE)

**Warning**

**EXPERIMENTAL:** this API may change without prior notice.

Macro to iterate over all valid computing devices having no parent.

**Parameters**

*dev\_id* The ID of the next possible valid device, usually 0 to iterate all.

Definition at line **250** of file **rte\_gpudev.h**.

### #define RTE\_GPU\_FOREACH\_CHILD(dev\_id, parent)

**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**

**EXPERIMENTAL:** this API may change without prior notice.

Macro to iterate over all valid children of a computing device parent.

**Parameters**

*dev\_id* The ID of the next possible valid device, usually 0 to iterate all. \
 *parent* The device ID of the parent.

Definition at line **264** of file **rte\_gpudev.h**.

## Typedef Documentation

### typedef void() rte\_gpu\_callback\_t(int16\_t dev\_id, enum rte\_gpu\_event event, void \*user\_data)

Prototype of event callback function.

Definition at line **77** of file **rte\_gpudev.h**.

## Enumeration Type Documentation

### enum rte\_gpu\_event

Flags passed in notification callback.

**Enumerator**

- *RTE\_GPU\_EVENT\_NEW*

  *Device is just initialized.*

- *RTE\_GPU\_EVENT\_DEL*

  *Device is going to be released.*

*Definition at line* **69** *of file* **rte\_gpudev.h***.*

### enum rte\_gpu\_comm\_flag\_type

*Memory where communication flag is allocated.*

**Enumerator**

- *RTE\_GPU\_COMM\_FLAG\_CPU*

  *Allocate flag on CPU memory visible from device.*

*Definition at line* **81** *of file* **rte\_gpudev.h***.*

### enum rte\_gpu\_comm\_list\_status

*Possible status for the list of packets shared among CPU and device.*

**Enumerator**

- *RTE\_GPU\_COMM\_LIST\_FREE*

  *Packet list can be filled with new mbufs, no one is using it.*

- *RTE\_GPU\_COMM\_LIST\_READY*

  *Packet list has been filled with new mbufs and it's ready to be used .*

- *RTE\_GPU\_COMM\_LIST\_DONE*

  *Packet list has been processed, it's ready to be freed.*

- *RTE\_GPU\_COMM\_LIST\_ERROR*

  *Some error occurred during packet list processing.*

*Definition at line* **105** *of file* **rte\_gpudev.h***.*

## Function Documentation

### \_\_rte\_experimental int rte\_gpu\_init (size\_t dev\_max)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Initialize the device array before probing devices. If not called, the maximum of probed devices is RTE\_GPU\_DEFAULT\_MAX.*

**Parameters**

*dev\_max Maximum number of devices.*

**Returns**

*0 on success, -rte\_errno otherwise:*

- •

  *ENOMEM if out of memory*

- •

  *EINVAL if 0 size*

- •

  *EBUSY if already initialized*

### \_\_rte\_experimental uint16\_t rte\_gpu\_count\_avail (void)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Return the number of GPU detected and associated to DPDK.*

**Returns**

*The number of available computing devices.*

### \_\_rte\_experimental bool rte\_gpu\_is\_valid (int16\_t dev\_id)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Check if the device is valid and initialized in DPDK.*

**Parameters**

*dev\_id The input device ID.*

**Returns**

- •

  *True if dev\_id is a valid and initialized computing device.*

- •

  *False otherwise.*

### \_\_rte\_experimental int16\_t rte\_gpu\_add\_child (const char \* name, int16\_t parent, uint64\_t child\_context)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Create a virtual device representing a context in the parent device.*

**Parameters**

*name Unique string to identify the device.* \
 *parent Device ID of the parent.* \
 *child\_context Opaque context handler.*

**Returns**

*Device ID of the new created child, -rte\_errno otherwise:*

- •

  *EINVAL if empty name*

- •

  *ENAMETOOLONG if long name*

- •

  *EEXIST if existing device name*

- •

  *ENODEV if invalid parent*

- •

  *EPERM if secondary process*

- •

  *ENOENT if too many devices*

- •

  *ENOMEM if out of space*

### \_\_rte\_experimental int16\_t rte\_gpu\_find\_next (int16\_t dev\_id, int16\_t parent)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Get the ID of the next valid GPU initialized in DPDK.*

**Parameters**

*dev\_id The initial device ID to start the research.* \
 *parent The device ID of the parent. RTE\_GPU\_ID\_NONE means no parent. RTE\_GPU\_ID\_ANY means no or any parent.*

**Returns**

*Next device ID corresponding to a valid and initialized computing device, RTE\_GPU\_ID\_NONE if there is none.*

### \_\_rte\_experimental int rte\_gpu\_close (int16\_t dev\_id)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Close device or child context. All resources are released.*

**Parameters**

*dev\_id Device ID to close.*

**Returns**

*0 on success, -rte\_errno otherwise:*

- •

  *ENODEV if invalid dev\_id*

- •

  *EPERM if driver error*

### \_\_rte\_experimental int rte\_gpu\_callback\_register (int16\_t dev\_id, enum rte\_gpu\_event event, rte\_gpu\_callback\_t \* function, void \* user\_data)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Register a function as event callback. A function may be registered multiple times for different events.*

**Parameters**

*dev\_id Device ID to get notified about. RTE\_GPU\_ID\_ANY means all devices.* \
 *event Device event to be registered for.* \
 *function Callback function to be called on event.* \
 *user\_data Optional parameter passed in the callback.*

**Returns**

*0 on success, -rte\_errno otherwise:*

- •

  *ENODEV if invalid dev\_id*

- •

  *EINVAL if NULL function*

- •

  *ENOMEM if out of memory*

### \_\_rte\_experimental int rte\_gpu\_callback\_unregister (int16\_t dev\_id, enum rte\_gpu\_event event, rte\_gpu\_callback\_t \* function, void \* user\_data)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Unregister for an event.*

**Parameters**

*dev\_id Device ID to be silenced. RTE\_GPU\_ID\_ANY means all devices.* \
 *event Registered event.* \
 *function Registered function.* \
 *user\_data Optional parameter as registered. RTE\_GPU\_CALLBACK\_ANY\_DATA is a catch-all.*

**Returns**

*0 on success, -rte\_errno otherwise:*

- •

  *ENODEV if invalid dev\_id*

- •

  *EINVAL if NULL function*

### \_\_rte\_experimental int rte\_gpu\_info\_get (int16\_t dev\_id, struct rte\_gpu\_info \* info)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Return device specific info.*

**Parameters**

*dev\_id Device ID to get info.* \
 *info Memory structure to fill with the info.*

**Returns**

*0 on success, -rte\_errno otherwise:*

- •

  *ENODEV if invalid dev\_id*

- •

  *EINVAL if NULL info*

- •

  *EPERM if driver error*

### \_\_rte\_experimental void \* rte\_gpu\_mem\_alloc (int16\_t dev\_id, size\_t size, unsigned int align)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Allocate a chunk of memory in the device.*

**Parameters**

*dev\_id Device ID requiring allocated memory.* \
 *size Number of bytes to allocate. Requesting 0 will do nothing.* \
 *align If 0, the return is a pointer that is suitably aligned for any kind of variable (in the same manner as malloc()). Otherwise, the return is a pointer that is a multiple of align. In this case, it must obviously be a power of two.*

**Returns**

*A pointer to the allocated memory, otherwise NULL and rte\_errno is set:*

- •

  *ENODEV if invalid dev\_id*

- •

  *EINVAL if align is not a power of two*

- •

  *ENOTSUP if operation not supported by the driver*

- •

  *E2BIG if size is higher than limit*

- •

  *ENOMEM if out of space*

- •

  *EPERM if driver error*

### \_\_rte\_experimental int rte\_gpu\_mem\_free (int16\_t dev\_id, void \* ptr)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Deallocate a chunk of memory allocated with* **rte\_gpu\_mem\_alloc()***.*

**Parameters**

*dev\_id Reference device ID.* \
 *ptr Pointer to the memory area to be deallocated. NULL is a no-op accepted value.*

**Returns**

*0 on success, -rte\_errno otherwise:*

- •

  *ENODEV if invalid dev\_id*

- •

  *ENOTSUP if operation not supported by the driver*

- •

  *EPERM if driver error*

### \_\_rte\_experimental int rte\_gpu\_mem\_register (int16\_t dev\_id, size\_t size, void \* ptr)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Register a chunk of memory on the CPU usable by the device.*

**Parameters**

*dev\_id Device ID requiring allocated memory.* \
 *size Number of bytes to allocate. Requesting 0 will do nothing.* \
 *ptr Pointer to the memory area to be registered. NULL is a no-op accepted value.*

**Returns**

*A pointer to the allocated memory, otherwise NULL and rte\_errno is set:*

- •

  *ENODEV if invalid dev\_id*

- •

  *EINVAL if reserved flags*

- •

  *ENOTSUP if operation not supported by the driver*

- •

  *E2BIG if size is higher than limit*

- •

  *ENOMEM if out of space*

- •

  *EPERM if driver error*

### \_\_rte\_experimental int rte\_gpu\_mem\_unregister (int16\_t dev\_id, void \* ptr)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Deregister a chunk of memory previously registered with* **rte\_gpu\_mem\_register()**

**Parameters**

*dev\_id Reference device ID.* \
 *ptr Pointer to the memory area to be unregistered. NULL is a no-op accepted value.*

**Returns**

*0 on success, -rte\_errno otherwise:*

- •

  *ENODEV if invalid dev\_id*

- •

  *ENOTSUP if operation not supported by the driver*

- •

  *EPERM if driver error*

### \_\_rte\_experimental void \* rte\_gpu\_mem\_cpu\_map (int16\_t dev\_id, size\_t size, void \* ptr)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*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**

*dev\_id Device ID requiring mapped memory.* \
 *size Number of bytes to map. Requesting 0 will do nothing.* \
 *ptr Pointer to the GPU memory area to be mapped. NULL is a no-op accepted value.*

**Returns**

*A pointer to the mapped GPU memory usable by the CPU, otherwise NULL and rte\_errno is set:*

- •

  *ENODEV if invalid dev\_id*

- •

  *ENOTSUP if operation not supported by the driver*

- •

  *E2BIG if size is higher than limit*

- •

  *ENOMEM if out of space*

- •

  *EPERM if driver error*

### \_\_rte\_experimental int rte\_gpu\_mem\_cpu\_unmap (int16\_t dev\_id, void \* ptr)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Unmap a chunk of GPU memory previously mapped with* **rte\_gpu\_mem\_cpu\_map()**

**Parameters**

*dev\_id Reference device ID.* \
 *ptr Pointer to the GPU memory area to be unmapped. NULL is a no-op accepted value.*

**Returns**

*0 on success, -rte\_errno otherwise:*

- •

  *ENODEV if invalid dev\_id*

- •

  *ENOTSUP if operation not supported by the driver*

- •

  *EPERM if driver error*

### \_\_rte\_experimental int rte\_gpu\_wmb (int16\_t dev\_id)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Enforce a GPU write memory barrier.*

**Parameters**

*dev\_id Reference device ID.*

**Returns**

*0 on success, -rte\_errno otherwise:*

- •

  *ENODEV if invalid dev\_id*

- •

  *ENOTSUP if operation not supported by the driver*

- •

  *EPERM if driver error*

### \_\_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)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*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**

*dev\_id Reference device ID.* \
 *devflag Pointer to the memory area of the devflag structure.* \
 *mtype Type of memory to allocate the communication flag.*

**Returns**

*0 on success, -rte\_errno otherwise:*

- •

  *ENODEV if invalid dev\_id*

- •

  *EINVAL if invalid inputs*

- •

  *ENOTSUP if operation not supported by the driver*

- •

  *ENOMEM if out of space*

- •

  *EPERM if driver error*

### \_\_rte\_experimental int rte\_gpu\_comm\_destroy\_flag (struct rte\_gpu\_comm\_flag \* devflag)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Deallocate a communication flag.*

**Parameters**

*devflag Pointer to the memory area of the devflag structure.*

**Returns**

*0 on success, -rte\_errno otherwise:*

- •

  *ENODEV if invalid dev\_id*

- •

  *EINVAL if NULL devflag*

- •

  *ENOTSUP if operation not supported by the driver*

- •

  *EPERM if driver error*

### \_\_rte\_experimental int rte\_gpu\_comm\_set\_flag (struct rte\_gpu\_comm\_flag \* devflag, uint32\_t val)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*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**

*devflag Pointer to the memory area of the devflag structure.* \
 *val Value to set in the flag.*

**Returns**

*0 on success, -rte\_errno otherwise:*

- •

  *EINVAL if invalid input params*

### \_\_rte\_experimental int rte\_gpu\_comm\_get\_flag\_value (struct rte\_gpu\_comm\_flag \* devflag, uint32\_t \* val)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*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**

*devflag Pointer to the memory area of the devflag structure.* \
 *val Flag output value.*

**Returns**

*0 on success, -rte\_errno otherwise:*

- •

  *EINVAL if invalid input params*

### \_\_rte\_experimental struct rte\_gpu\_comm\_list \* rte\_gpu\_comm\_create\_list (uint16\_t dev\_id, uint32\_t num\_comm\_items)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Create a communication list that can be used to share packets between CPU and device. Each element of the list contains:*

- •

  *a packet list of RTE\_GPU\_COMM\_LIST\_PKTS\_MAX elements*

- •

  *number of packets in the list*

- •

  *a status flag to communicate if the packet list is FREE, READY to be processed, DONE with processing.*

*The list is allocated in CPU-visible memory. At creation time, every list is in FREE state.*

**Parameters**

*dev\_id Reference device ID.* \
 *num\_comm\_items Number of items in the communication list.*

**Returns**

*A pointer to the allocated list, otherwise NULL and rte\_errno is set:*

- •

  *EINVAL if invalid input params*

### \_\_rte\_experimental int rte\_gpu\_comm\_destroy\_list (struct rte\_gpu\_comm\_list \* comm\_list, uint32\_t num\_comm\_items)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Destroy a communication list.*

**Parameters**

*comm\_list Communication list to be destroyed.* \
 *num\_comm\_items Number of items in the communication list.*

**Returns**

*0 on success, -rte\_errno otherwise:*

- •

  *EINVAL if invalid input params*

### \_\_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)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*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**

*comm\_list\_item Communication list item to fill.* \
 *mbufs List of mbufs.* \
 *num\_mbufs Number of mbufs.*

**Returns**

*0 on success, -rte\_errno otherwise:*

- •

  *EINVAL if invalid input params*

- •

  *ENOTSUP if mbufs are chained (multiple segments)*

### \_\_rte\_experimental int rte\_gpu\_comm\_set\_status (struct rte\_gpu\_comm\_list \* comm\_list\_item, enum rte\_gpu\_comm\_list\_status status)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Set status flag value of a communication list item.*

**Parameters**

*comm\_list\_item Communication list item to query.* \
 *status Status value to set.*

**Returns**

*0 on success, -rte\_errno otherwise:*

- •

  *EINVAL if invalid input params*

### \_\_rte\_experimental int rte\_gpu\_comm\_get\_status (struct rte\_gpu\_comm\_list \* comm\_list\_item, enum rte\_gpu\_comm\_list\_status \* status)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Get status flag value of a communication list item.*

**Parameters**

*comm\_list\_item Communication list item to query. Input parameter.* \
 *status Communication list item status flag value. Output parameter.*

**Returns**

*0 on success, -rte\_errno otherwise:*

- •

  *EINVAL if invalid input params*

### \_\_rte\_experimental int rte\_gpu\_comm\_cleanup\_list (struct rte\_gpu\_comm\_list \* comm\_list\_item)

**Warning**

**EXPERIMENTAL:** *this API may change without prior notice.*

*Reset a communication list item to the original state. The status flag set to FREE and mbufs are returned to the pool.*

**Parameters**

*comm\_list\_item Communication list item to reset.*

**Returns**

*0 on success, -rte\_errno otherwise:*

- •

  *EINVAL if invalid input params*

## Author

*Generated automatically by Doxygen for DPDK from the source code.*
