DPDK  20.05.0
Data Structures | Functions
rte_vdpa.h File Reference
#include <stdbool.h>
#include <rte_pci.h>
#include "rte_vhost.h"

Go to the source code of this file.

Data Structures

struct  rte_vdpa_dev_addr
 
struct  rte_vdpa_dev_ops
 
struct  rte_vdpa_device
 

Functions

__rte_experimental int rte_vdpa_register_device (struct rte_vdpa_dev_addr *addr, struct rte_vdpa_dev_ops *ops)
 
__rte_experimental int rte_vdpa_unregister_device (int did)
 
__rte_experimental int rte_vdpa_find_device_id (struct rte_vdpa_dev_addr *addr)
 
__rte_experimental struct rte_vdpa_devicerte_vdpa_get_device (int did)
 
__rte_experimental int rte_vdpa_get_device_num (void)
 
__rte_experimental int rte_vhost_host_notifier_ctrl (int vid, bool enable)
 
__rte_experimental int rte_vdpa_relay_vring_used (int vid, uint16_t qid, void *vring_m)
 

Detailed Description

Device specific vhost lib

Definition in file rte_vdpa.h.

Function Documentation

__rte_experimental int rte_vdpa_register_device ( struct rte_vdpa_dev_addr addr,
struct rte_vdpa_dev_ops ops 
)
Warning
EXPERIMENTAL: this API may change without prior notice

Register a vdpa device

Parameters
addrthe vdpa device address
opsthe vdpa device operations
Returns
device id on success, -1 on failure
__rte_experimental int rte_vdpa_unregister_device ( int  did)
Warning
EXPERIMENTAL: this API may change without prior notice

Unregister a vdpa device

Parameters
didvdpa device id
Returns
device id on success, -1 on failure
__rte_experimental int rte_vdpa_find_device_id ( struct rte_vdpa_dev_addr addr)
Warning
EXPERIMENTAL: this API may change without prior notice

Find the device id of a vdpa device

Parameters
addrthe vdpa device address
Returns
device id on success, -1 on failure
Examples:
examples/vdpa/main.c.
__rte_experimental struct rte_vdpa_device* rte_vdpa_get_device ( int  did)
Warning
EXPERIMENTAL: this API may change without prior notice

Find a vdpa device based on device id

Parameters
diddevice id
Returns
rte_vdpa_device on success, NULL on failure
Examples:
examples/vdpa/main.c.
__rte_experimental int rte_vdpa_get_device_num ( void  )
Warning
EXPERIMENTAL: this API may change without prior notice

Get current available vdpa device number

Returns
available vdpa device number
Examples:
examples/vdpa/main.c.
__rte_experimental int rte_vhost_host_notifier_ctrl ( int  vid,
bool  enable 
)
Warning
EXPERIMENTAL: this API may change without prior notice

Enable/Disable host notifier mapping for a vdpa port.

Parameters
vidvhost device id
enabletrue for host notifier map, false for host notifier unmap
Returns
0 on success, -1 on failure
__rte_experimental int rte_vdpa_relay_vring_used ( int  vid,
uint16_t  qid,
void *  vring_m 
)
Warning
EXPERIMENTAL: this API may change without prior notice

Synchronize the used ring from mediated ring to guest, log dirty page for each writeable buffer, caller should handle the used ring logging before device stop.

Parameters
vidvhost device id
qidvhost queue id
vring_mmediated virtio ring pointer
Returns
number of synced used entries on success, -1 on failure