]>
Commit | Line | Data |
---|---|---|
d5970055 MT |
1 | #ifndef VHOST_NET_H |
2 | #define VHOST_NET_H | |
3 | ||
1422e32d | 4 | #include "net/net.h" |
1a1bfac9 | 5 | #include "hw/virtio/vhost-backend.h" |
d5970055 | 6 | |
46d4d36d JZ |
7 | #define VHOST_NET_INIT_FAILED \ |
8 | "vhost-net requested but could not be initialized" | |
9 | ||
d5970055 MT |
10 | struct vhost_net; |
11 | typedef struct vhost_net VHostNetState; | |
12 | ||
81647a65 | 13 | typedef struct VhostNetOptions { |
1a1bfac9 | 14 | VhostBackendType backend_type; |
81647a65 | 15 | NetClientState *net_backend; |
69e87b32 | 16 | uint32_t busyloop_timeout; |
81647a65 | 17 | void *opaque; |
81647a65 NN |
18 | } VhostNetOptions; |
19 | ||
e2051e9e | 20 | uint64_t vhost_net_get_max_queues(VHostNetState *net); |
81647a65 | 21 | struct vhost_net *vhost_net_init(VhostNetOptions *options); |
d5970055 | 22 | |
a9f98bb5 JW |
23 | int vhost_net_start(VirtIODevice *dev, NetClientState *ncs, int total_queues); |
24 | void vhost_net_stop(VirtIODevice *dev, NetClientState *ncs, int total_queues); | |
d5970055 MT |
25 | |
26 | void vhost_net_cleanup(VHostNetState *net); | |
27 | ||
9a2ba823 CH |
28 | uint64_t vhost_net_get_features(VHostNetState *net, uint64_t features); |
29 | void vhost_net_ack_features(VHostNetState *net, uint64_t features); | |
d5970055 | 30 | |
f56a1247 MT |
31 | bool vhost_net_virtqueue_pending(VHostNetState *net, int n); |
32 | void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev, | |
33 | int idx, bool mask); | |
3e866365 | 34 | int vhost_net_notify_migration_done(VHostNetState *net, char* mac_addr); |
ed8b4afe | 35 | VHostNetState *get_vhost_net(NetClientState *nc); |
7263a0ad CO |
36 | |
37 | int vhost_set_vring_enable(NetClientState * nc, int enable); | |
a463215b MAL |
38 | |
39 | uint64_t vhost_net_get_acked_features(VHostNetState *net); | |
40 | ||
45a368ad MC |
41 | int vhost_net_set_mtu(struct vhost_net *net, uint16_t mtu); |
42 | ||
d5970055 | 43 | #endif |