vhost_net.h 1019 字节
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 16 17
    NetClientState *net_backend;
    void *opaque;
    bool force;
} VhostNetOptions;

struct vhost_net *vhost_net_init(VhostNetOptions *options);
M
Michael S. Tsirkin 已提交
18

19
bool vhost_net_query(VHostNetState *net, VirtIODevice *dev);
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
VHostNetState *get_vhost_net(NetClientState *nc);
M
Michael S. Tsirkin 已提交
32
#endif