diff options
author | Zhang Chen <zhangchen.fnst@cn.fujitsu.com> | 2017-07-04 14:53:46 +0800 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2017-07-17 20:02:11 +0800 |
commit | 3cde5ea211ead04997e2ecd7f8bdc831f84700e6 (patch) | |
tree | e63da97b2e530ad8f580643e69b618adff446f14 /include/net/net.h | |
parent | d6b732e953673e4e1f4b36868c206a08213b6708 (diff) |
net/net.c: Add vnet_hdr support in SocketReadState
We add a flag to decide whether net_fill_rstate() need read
the vnet_hdr_len or not.
Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Suggested-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'include/net/net.h')
-rw-r--r-- | include/net/net.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/net/net.h b/include/net/net.h index 9a92c704ea..1c55a93588 100644 --- a/include/net/net.h +++ b/include/net/net.h @@ -112,9 +112,13 @@ typedef struct NICState { } NICState; struct SocketReadState { - int state; /* 0 = getting length, 1 = getting data */ + /* 0 = getting length, 1 = getting vnet header length, 2 = getting data */ + int state; + /* This flag decide whether to read the vnet_hdr_len field */ + bool vnet_hdr; uint32_t index; uint32_t packet_len; + uint32_t vnet_hdr_len; uint8_t buf[NET_BUFSIZE]; SocketReadStateFinalize *finalize; }; @@ -177,7 +181,8 @@ ssize_t qemu_deliver_packet_iov(NetClientState *sender, void print_net_client(Monitor *mon, NetClientState *nc); void hmp_info_network(Monitor *mon, const QDict *qdict); void net_socket_rs_init(SocketReadState *rs, - SocketReadStateFinalize *finalize); + SocketReadStateFinalize *finalize, + bool vnet_hdr); /* NIC info */ |