DPDK  21.08.0
Data Structures | Macros | Typedefs | Functions
rte_bus_vdev.h File Reference
#include <sys/queue.h>
#include <rte_dev.h>
#include <rte_devargs.h>

Go to the source code of this file.

Data Structures

struct  rte_vdev_driver
 

Macros

#define RTE_VDEV_DRV_NEED_IOVA_AS_VA   0x0001
 

Typedefs

typedef int() rte_vdev_probe_t(struct rte_vdev_device *dev)
 
typedef int() rte_vdev_remove_t(struct rte_vdev_device *dev)
 
typedef int() rte_vdev_dma_map_t(struct rte_vdev_device *dev, void *addr, uint64_t iova, size_t len)
 
typedef int() rte_vdev_dma_unmap_t(struct rte_vdev_device *dev, void *addr, uint64_t iova, size_t len)
 

Functions

 TAILQ_HEAD (vdev_driver_list, rte_vdev_driver)
 
void rte_vdev_register (struct rte_vdev_driver *driver)
 
void rte_vdev_unregister (struct rte_vdev_driver *driver)
 
int rte_vdev_add_custom_scan (rte_vdev_scan_callback callback, void *user_arg)
 
int rte_vdev_remove_custom_scan (rte_vdev_scan_callback callback, void *user_arg)
 
int rte_vdev_init (const char *name, const char *args)
 
int rte_vdev_uninit (const char *name)
 

Detailed Description

RTE virtual bus API

Definition in file rte_bus_vdev.h.

Macro Definition Documentation

◆ RTE_VDEV_DRV_NEED_IOVA_AS_VA

#define RTE_VDEV_DRV_NEED_IOVA_AS_VA   0x0001

Device driver needs IOVA as VA and cannot work with IOVA as PA

Definition at line 120 of file rte_bus_vdev.h.

Typedef Documentation

◆ rte_vdev_probe_t

typedef int() rte_vdev_probe_t(struct rte_vdev_device *dev)

Probe function called for each virtual device driver once.

Definition at line 61 of file rte_bus_vdev.h.

◆ rte_vdev_remove_t

typedef int() rte_vdev_remove_t(struct rte_vdev_device *dev)

Remove function called for each virtual device driver once.

Definition at line 66 of file rte_bus_vdev.h.

◆ rte_vdev_dma_map_t

typedef int() rte_vdev_dma_map_t(struct rte_vdev_device *dev, void *addr, uint64_t iova, size_t len)

Driver-specific DMA mapping. After a successful call the device will be able to read/write from/to this segment.

Parameters
devPointer to the Virtual device.
addrStarting virtual address of memory to be mapped.
iovaStarting IOVA address of memory to be mapped.
lenLength of memory segment being mapped.
Returns
  • 0 On success.
  • Negative value and rte_errno is set otherwise.

Definition at line 84 of file rte_bus_vdev.h.

◆ rte_vdev_dma_unmap_t

typedef int() rte_vdev_dma_unmap_t(struct rte_vdev_device *dev, void *addr, uint64_t iova, size_t len)

Driver-specific DMA un-mapping. After a successful call the device will not be able to read/write from/to this segment.

Parameters
devPointer to the Virtual device.
addrStarting virtual address of memory to be unmapped.
iovaStarting IOVA address of memory to be unmapped.
lenLength of memory segment being unmapped.
Returns
  • 0 On success.
  • Negative value and rte_errno is set otherwise.

Definition at line 103 of file rte_bus_vdev.h.

Function Documentation

◆ TAILQ_HEAD()

TAILQ_HEAD ( vdev_driver_list  ,
rte_vdev_driver   
)

Double linked list of virtual device drivers.

Examples:
examples/pipeline/obj.c.

◆ rte_vdev_register()

void rte_vdev_register ( struct rte_vdev_driver driver)

Register a virtual device driver.

Parameters
driverA pointer to a rte_vdev_driver structure describing the driver to be registered.

◆ rte_vdev_unregister()

void rte_vdev_unregister ( struct rte_vdev_driver driver)

Unregister a virtual device driver.

Parameters
driverA pointer to a rte_vdev_driver structure describing the driver to be unregistered.

◆ rte_vdev_add_custom_scan()

int rte_vdev_add_custom_scan ( rte_vdev_scan_callback  callback,
void *  user_arg 
)

Add a callback to be called on vdev scan before reading the devargs list.

This function cannot be called in a scan callback because of deadlock.

Parameters
callbackThe function to be called which can update the devargs list.
user_argAn opaque pointer passed to callback.
Returns
0 on success, negative on error

◆ rte_vdev_remove_custom_scan()

int rte_vdev_remove_custom_scan ( rte_vdev_scan_callback  callback,
void *  user_arg 
)

Remove a registered scan callback.

This function cannot be called in a scan callback because of deadlock.

Parameters
callbackThe registered function to be removed.
user_argThe associated opaque pointer or (void*)-1 for any.
Returns
0 on success

◆ rte_vdev_init()

int rte_vdev_init ( const char *  name,
const char *  args 
)

Initialize a driver specified by name.

Parameters
nameThe pointer to a driver name to be initialized.
argsThe pointer to arguments used by driver initialization.
Returns
0 on success, negative on error

◆ rte_vdev_uninit()

int rte_vdev_uninit ( const char *  name)

Uninitalize a driver specified by name.

Parameters
nameThe pointer to a driver name to be uninitialized.
Returns
0 on success, negative on error