vhost_net.h 1.1 KB
Newer Older
M
Michael S. Tsirkin 已提交
1 2 3
#ifndef VHOST_NET_H
#define VHOST_NET_H

P
Paolo Bonzini 已提交
4
#include "net/net.h"
5
#include "hw/virtio/vhost-backend.h"
M
Michael S. Tsirkin 已提交
6 7 8 9

struct vhost_net;
typedef struct vhost_net VHostNetState;

10
typedef struct VhostNetOptions {
11
    VhostBackendType backend_type;
12 13 14 15
    NetClientState *net_backend;
    void *opaque;
} VhostNetOptions;

16
uint64_t vhost_net_get_max_queues(VHostNetState *net);
17
struct vhost_net *vhost_net_init(VhostNetOptions *options);
M
Michael S. Tsirkin 已提交
18

J
Jason Wang 已提交
19 20
int vhost_net_start(VirtIODevice *dev, NetClientState *ncs, int total_queues);
void vhost_net_stop(VirtIODevice *dev, NetClientState *ncs, int total_queues);
M
Michael S. Tsirkin 已提交
21 22 23

void vhost_net_cleanup(VHostNetState *net);

C
Cornelia Huck 已提交
24 25
uint64_t vhost_net_get_features(VHostNetState *net, uint64_t features);
void vhost_net_ack_features(VHostNetState *net, uint64_t features);
M
Michael S. Tsirkin 已提交
26

27 28 29
bool vhost_net_virtqueue_pending(VHostNetState *net, int n);
void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev,
                              int idx, bool mask);
30
int vhost_net_notify_migration_done(VHostNetState *net, char* mac_addr);
31
VHostNetState *get_vhost_net(NetClientState *nc);
32 33

int vhost_set_vring_enable(NetClientState * nc, int enable);
M
Michael S. Tsirkin 已提交
34
#endif