xref: /qemu/include/net/vhost_net.h (revision 81647a655fa4ff99fd5748363a174edd87a40950)
1d5970055SMichael S. Tsirkin #ifndef VHOST_NET_H
2d5970055SMichael S. Tsirkin #define VHOST_NET_H
3d5970055SMichael S. Tsirkin 
41422e32dSPaolo Bonzini #include "net/net.h"
5d5970055SMichael S. Tsirkin 
6d5970055SMichael S. Tsirkin struct vhost_net;
7d5970055SMichael S. Tsirkin typedef struct vhost_net VHostNetState;
8d5970055SMichael S. Tsirkin 
9*81647a65SNikolay Nikolaev typedef struct VhostNetOptions {
10*81647a65SNikolay Nikolaev     NetClientState *net_backend;
11*81647a65SNikolay Nikolaev     void *opaque;
12*81647a65SNikolay Nikolaev     bool force;
13*81647a65SNikolay Nikolaev } VhostNetOptions;
14*81647a65SNikolay Nikolaev 
15*81647a65SNikolay Nikolaev struct vhost_net *vhost_net_init(VhostNetOptions *options);
16d5970055SMichael S. Tsirkin 
175430a28fSmst@redhat.com bool vhost_net_query(VHostNetState *net, VirtIODevice *dev);
18a9f98bb5SJason Wang int vhost_net_start(VirtIODevice *dev, NetClientState *ncs, int total_queues);
19a9f98bb5SJason Wang void vhost_net_stop(VirtIODevice *dev, NetClientState *ncs, int total_queues);
20d5970055SMichael S. Tsirkin 
21d5970055SMichael S. Tsirkin void vhost_net_cleanup(VHostNetState *net);
22d5970055SMichael S. Tsirkin 
23d5970055SMichael S. Tsirkin unsigned vhost_net_get_features(VHostNetState *net, unsigned features);
24d5970055SMichael S. Tsirkin void vhost_net_ack_features(VHostNetState *net, unsigned features);
25d5970055SMichael S. Tsirkin 
26f56a1247SMichael S. Tsirkin bool vhost_net_virtqueue_pending(VHostNetState *net, int n);
27f56a1247SMichael S. Tsirkin void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev,
28f56a1247SMichael S. Tsirkin                               int idx, bool mask);
29ed8b4afeSNikolay Nikolaev VHostNetState *get_vhost_net(NetClientState *nc);
30d5970055SMichael S. Tsirkin #endif
31