rte_vhost_device_ops(3)

πŸ’– rte_vhost_device_ops(3) πŸ’–

okay bestie, welcome to the manual page for rte_vhost_device_ops β€” that's the Library Functions Manual one, and yes we're doing the whole thing, every field, no skips, periodt. ✨


🌸 NAME 🌸

rte_vhost_device_ops β€” the struct that holds all your device and vring ops, and she is iconic.

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <rte_vhost.h>

✨ Data Fields ✨

  • int(* new_device )(int vid) β€” add device πŸ’…
  • void(* destroy_device )(int vid) β€” remove device, bye bestie 😭
  • int(* vring_state_changed )(int vid, uint16_t queue_id, int enable) β€” fired when a vring gets enabled or disabled
  • int(* features_changed )(int vid, uint64_t features) β€” fired when features change
  • void(* guest_notified )(int vid) β€” called every time the guest gets notified about waiting packets
  • bool(* guest_notify )(int vid, uint16_t queue_id) β€” if you register this, notification to the guest can be handled by the front-end calling rte_vhost_notify_guest()

πŸ‘‘ Detailed Description πŸ‘‘

Device and vring operations.

Definition at line 277 of file rte_vhost.h.


πŸŽ€ Field Documentation πŸŽ€

int(* new_device) (int vid)

Add device. like, welcome to the function pointer family 🫢

Definition at line 278 of file rte_vhost.h.

void(* destroy_device) (int vid)

Remove device. she's leaving the group chat πŸ™ˆ

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 β€” lowkey the vibe check for your queue πŸ”₯

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. so basically: features can shift under you, and this is how you get told, no cap ✨

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. counting the slow ones is such a main character move tbh πŸ’€

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. like, get that syscall out of the datapath, she does NOT belong there πŸ’…

Definition at line 308 of file rte_vhost.h.


🌈 Author 🌈

Generated automatically by Doxygen for DPDK from the source code. (not me writing prose for once, the robot did it πŸ€–βœ¨)


that's the whole page bestie, every field, every line number, every word β€” nothing dropped, nothing invented. ate and left no crumbs. πŸ“

and that's a wrap on rte_vhost_device_ops(3) from DPDK, Version 25.11.3 πŸ’– mwah, go write some callbacks πŸ‘‘

πŸ“¦ where this page comes from