starts an infinite loop, therefore it should be called in a dedicated
thread.
-* ``rte_vhost_driver_callback_register(path, virtio_net_device_ops)``
+* ``rte_vhost_driver_callback_register(path, vhost_device_ops)``
This function registers a set of callbacks, to let DPDK applications take
the appropriate action when some events happen. The following events are
* ``linux/if.h``
* ``rte_ether.h``
+ * The vhost struct ``virtio_net_device_ops`` is renamed to
+ ``vhost_device_ops``
+
ABI Changes
-----------
return 0;
}
-static struct virtio_net_device_ops vhost_ops = {
+static struct vhost_device_ops vhost_ops = {
.new_device = new_device,
.destroy_device = destroy_device,
.vring_state_changed = vring_state_changed,
* These callback allow devices to be added to the data core when configuration
* has been fully complete.
*/
-static const struct virtio_net_device_ops virtio_net_device_ops = {
+static const struct vhost_device_ops virtio_net_device_ops = {
.new_device = new_device,
.destroy_device = destroy_device,
};
* These callback allow devices to be added to the data core when configuration
* has been fully complete.
*/
-static const struct virtio_net_device_ops virtio_net_device_ops =
+static const struct vhost_device_ops virtio_net_device_ops =
{
.new_device = new_device,
.destroy_device = destroy_device,
EXPORT_MAP := rte_vhost_version.map
-LIBABIVER := 3
+LIBABIVER := 4
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64
CFLAGS += -I vhost_user
/**
* Device and vring operations.
*/
-struct virtio_net_device_ops {
+struct vhost_device_ops {
int (*new_device)(int vid); /**< Add device. */
void (*destroy_device)(int vid); /**< Remove device. */
/* Register callbacks. */
int rte_vhost_driver_callback_register(const char *path,
- struct virtio_net_device_ops const * const ops);
+ struct vhost_device_ops const * const ops);
/* Start vhost driver session blocking loop. */
int rte_vhost_driver_session_start(void);
uint64_t supported_features;
uint64_t features;
- struct virtio_net_device_ops const *notify_ops;
+ struct vhost_device_ops const *notify_ops;
};
struct vhost_user_connection {
*/
int
rte_vhost_driver_callback_register(const char *path,
- struct virtio_net_device_ops const * const ops)
+ struct vhost_device_ops const * const ops)
{
struct vhost_user_socket *vsocket;
return vsocket ? 0 : -1;
}
-struct virtio_net_device_ops const *
+struct vhost_device_ops const *
vhost_driver_callback_get(const char *path)
{
struct vhost_user_socket *vsocket;
struct ether_addr mac;
uint16_t mtu;
- struct virtio_net_device_ops const *notify_ops;
+ struct vhost_device_ops const *notify_ops;
uint32_t nr_guest_pages;
uint32_t max_guest_pages;
void vhost_set_ifname(int, const char *if_name, unsigned int if_len);
void vhost_enable_dequeue_zero_copy(int vid);
-struct virtio_net_device_ops const *vhost_driver_callback_get(const char *path);
+struct vhost_device_ops const *vhost_driver_callback_get(const char *path);
/*
* Backend-specific cleanup.