Merge remote-tracking branch 'qemu/master'
[qemu/ar7.git] / include / net / vhost_net.h
blobafc1499eb9986238fb3b5e987240fff786b22c63
1 #ifndef VHOST_NET_H
2 #define VHOST_NET_H
4 #include "net/net.h"
5 #include "hw/virtio/vhost-backend.h"
7 struct vhost_net;
8 typedef struct vhost_net VHostNetState;
10 typedef struct VhostNetOptions {
11 VhostBackendType backend_type;
12 NetClientState *net_backend;
13 uint32_t busyloop_timeout;
14 void *opaque;
15 } VhostNetOptions;
17 uint64_t vhost_net_get_max_queues(VHostNetState *net);
18 struct vhost_net *vhost_net_init(VhostNetOptions *options);
20 int vhost_net_start(VirtIODevice *dev, NetClientState *ncs, int total_queues);
21 void vhost_net_stop(VirtIODevice *dev, NetClientState *ncs, int total_queues);
23 void vhost_net_cleanup(VHostNetState *net);
25 uint64_t vhost_net_get_features(VHostNetState *net, uint64_t features);
26 void vhost_net_ack_features(VHostNetState *net, uint64_t features);
28 bool vhost_net_virtqueue_pending(VHostNetState *net, int n);
29 void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev,
30 int idx, bool mask);
31 int vhost_net_notify_migration_done(VHostNetState *net, char* mac_addr);
32 VHostNetState *get_vhost_net(NetClientState *nc);
34 int vhost_set_vring_enable(NetClientState * nc, int enable);
36 uint64_t vhost_net_get_acked_features(VHostNetState *net);
38 int vhost_net_set_mtu(struct vhost_net *net, uint16_t mtu);
40 #endif