vhost_net.h 1.2 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
    NetClientState *net_backend;
J
Jason Wang 已提交
13
    uint32_t busyloop_timeout;
14 15 16
    void *opaque;
} VhostNetOptions;

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

J
Jason Wang 已提交
20 21
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 已提交
22 23 24

void vhost_net_cleanup(VHostNetState *net);

C
Cornelia Huck 已提交
25 26
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 已提交
27

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

int vhost_set_vring_enable(NetClientState * nc, int enable);
35 36 37

uint64_t vhost_net_get_acked_features(VHostNetState *net);

M
Michael S. Tsirkin 已提交
38
#endif