]> git.proxmox.com Git - mirror_qemu.git/blame - include/net/vhost_net.h
ppc/spapr: load and store l2 state with helper functions
[mirror_qemu.git] / include / net / vhost_net.h
CommitLineData
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
10struct vhost_net;
11typedef struct vhost_net VHostNetState;
12
81647a65 13typedef struct VhostNetOptions {
1a1bfac9 14 VhostBackendType backend_type;
81647a65 15 NetClientState *net_backend;
69e87b32 16 uint32_t busyloop_timeout;
6a756d14 17 unsigned int nvqs;
81647a65 18 void *opaque;
81647a65
NN
19} VhostNetOptions;
20
e2051e9e 21uint64_t vhost_net_get_max_queues(VHostNetState *net);
81647a65 22struct vhost_net *vhost_net_init(VhostNetOptions *options);
d5970055 23
05ba3f63
JW
24int vhost_net_start(VirtIODevice *dev, NetClientState *ncs,
25 int data_queue_pairs, int cvq);
26void vhost_net_stop(VirtIODevice *dev, NetClientState *ncs,
27 int data_queue_pairs, int cvq);
d5970055
MT
28
29void vhost_net_cleanup(VHostNetState *net);
30
9a2ba823
CH
31uint64_t vhost_net_get_features(VHostNetState *net, uint64_t features);
32void vhost_net_ack_features(VHostNetState *net, uint64_t features);
d5970055 33
38140cc4
CL
34int vhost_net_get_config(struct vhost_net *net, uint8_t *config,
35 uint32_t config_len);
36
37int vhost_net_set_config(struct vhost_net *net, const uint8_t *data,
38 uint32_t offset, uint32_t size, uint32_t flags);
f56a1247
MT
39bool vhost_net_virtqueue_pending(VHostNetState *net, int n);
40void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev,
41 int idx, bool mask);
8aab0d1d
CL
42bool vhost_net_config_pending(VHostNetState *net);
43void vhost_net_config_mask(VHostNetState *net, VirtIODevice *dev, bool mask);
3e866365 44int vhost_net_notify_migration_done(VHostNetState *net, char* mac_addr);
ed8b4afe 45VHostNetState *get_vhost_net(NetClientState *nc);
7263a0ad
CO
46
47int vhost_set_vring_enable(NetClientState * nc, int enable);
a463215b
MAL
48
49uint64_t vhost_net_get_acked_features(VHostNetState *net);
50
45a368ad
MC
51int vhost_net_set_mtu(struct vhost_net *net, uint16_t mtu);
52
c2daa08e
KX
53void vhost_net_virtqueue_reset(VirtIODevice *vdev, NetClientState *nc,
54 int vq_index);
10f8a115
KX
55int vhost_net_virtqueue_restart(VirtIODevice *vdev, NetClientState *nc,
56 int vq_index);
c9bdc449
HH
57
58void vhost_net_save_acked_features(NetClientState *nc);
d5970055 59#endif