#include <stdbool.h>
#include <rte_pci.h>
#include "rte_vhost.h"
Go to the source code of this file.
Detailed Description
Device specific vhost lib
Definition in file rte_vdpa.h.
Function Documentation
- Warning
- EXPERIMENTAL: this API may change without prior notice
Register a vdpa device
- Parameters
-
addr | the vdpa device address |
ops | the vdpa device operations |
- Returns
- device id on success, -1 on failure
int __rte_experimental rte_vdpa_unregister_device |
( |
int |
did | ) |
|
- Warning
- EXPERIMENTAL: this API may change without prior notice
Unregister a vdpa device
- Parameters
-
- Returns
- device id on success, -1 on failure
- Warning
- EXPERIMENTAL: this API may change without prior notice
Find the device id of a vdpa device
- Parameters
-
addr | the vdpa device address |
- Returns
- device id on success, -1 on failure
- Examples:
- examples/vdpa/main.c.
- Warning
- EXPERIMENTAL: this API may change without prior notice
Find a vdpa device based on device id
- Parameters
-
- Returns
- rte_vdpa_device on success, NULL on failure
- Examples:
- examples/vdpa/main.c.
int __rte_experimental 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.
int __rte_experimental 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
-
vid | vhost device id |
enable | true for host notifier map, false for host notifier unmap |
- Returns
- 0 on success, -1 on failure
int __rte_experimental rte_vdpa_relay_vring_avail |
( |
int |
vid, |
|
|
uint16_t |
qid, |
|
|
void * |
vring_m |
|
) |
| |
- Warning
- EXPERIMENTAL: this API may change without prior notice
Synchronize the available ring from guest to mediated ring, help to check desc validity to protect against malicious guest driver.
- Parameters
-
vid | vhost device id |
qid | vhost queue id |
vring_m | mediated virtio ring pointer |
- Returns
- number of synced available entries on success, -1 on failure
int __rte_experimental 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
-
vid | vhost device id |
qid | vhost queue id |
vring_m | mediated virtio ring pointer |
- Returns
- number of synced used entries on success, -1 on failure