---
name: "rte_vhost_device_ops"
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_vhost_device_ops"
---

# rte\_vhost\_device\_ops(3)

## NAME

rte\_vhost\_device\_ops

## SYNOPSIS

`#include <rte_vhost.h>`

### Data Fields

int(\* **new\_device** )(int vid)\
 void(\* **destroy\_device** )(int vid)\
 int(\* **vring\_state\_changed** )(int vid, uint16\_t queue\_id, int enable)\
 int(\* **features\_changed** )(int vid, uint64\_t features)\
 void(\* **guest\_notified** )(int vid)\
 bool(\* **guest\_notify** )(int vid, uint16\_t queue\_id)\

## Detailed Description

Device and vring operations.

Definition at line **277** of file **rte\_vhost.h**.

## Field Documentation

### int(\* new\_device) (int vid)

Add device.

Definition at line **278** of file **rte\_vhost.h**.

### void(\* destroy\_device) (int vid)

Remove device.

Definition at line **279** of file **rte\_vhost.h**.

### int(\* vring\_state\_changed) (int vid, uint16\_t queue\_id, int enable)

triggered when a vring is enabled or disabled

Definition at line **281** of file **rte\_vhost.h**.

### int(\* features\_changed) (int vid, uint64\_t features)

Features could be changed after the feature negotiation. For example, VHOST\_F\_LOG\_ALL will be set/cleared at the start/end of live migration, respectively. This callback is used to inform the application on such change.

Definition at line **289** of file **rte\_vhost.h**.

### void(\* guest\_notified) (int vid)

This callback gets called each time a guest gets notified about waiting packets. This is the interrupt handling through the eventfd\_write(callfd), which can be used for counting these 'slow' syscalls.

Definition at line **300** of file **rte\_vhost.h**.

### bool(\* guest\_notify) (int vid, uint16\_t queue\_id)

If this callback is registered, notification to the guest can be handled by the front-end calling **rte\_vhost\_notify\_guest()**. If it's not handled, 'false' should be returned. This can be used to remove the 'slow' eventfd\_write() syscall from the datapath.

Definition at line **308** of file **rte\_vhost.h**.

## Author

Generated automatically by Doxygen for DPDK from the source code.
