aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2014-10-07 10:39:48 -0400
committerMichael S. Tsirkin <mst@redhat.com>2014-12-09 05:05:26 -0500
commitfdd819b21576c361bf0dcdd9522df4ccabf7aaa8 (patch)
tree39c8178b2f4d6d399665dbd449ebfad8f46955ec /include/uapi/linux
parentb3bb62d11950eb6ac87403cacd667f84fa9495bc (diff)
virtio_net: v1.0 endianness
Based on patches by Rusty Russell, Cornelia Huck. Note: more code changes are needed for 1.0 support (due to different header size). So we don't advertize support for 1.0 yet. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/virtio_net.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h
index 172a7f00780c..b5f1677b291c 100644
--- a/include/uapi/linux/virtio_net.h
+++ b/include/uapi/linux/virtio_net.h
@@ -28,6 +28,7 @@
28#include <linux/types.h> 28#include <linux/types.h>
29#include <linux/virtio_ids.h> 29#include <linux/virtio_ids.h>
30#include <linux/virtio_config.h> 30#include <linux/virtio_config.h>
31#include <linux/virtio_types.h>
31#include <linux/if_ether.h> 32#include <linux/if_ether.h>
32 33
33/* The feature bitmap for virtio net */ 34/* The feature bitmap for virtio net */
@@ -84,17 +85,17 @@ struct virtio_net_hdr {
84#define VIRTIO_NET_HDR_GSO_TCPV6 4 // GSO frame, IPv6 TCP 85#define VIRTIO_NET_HDR_GSO_TCPV6 4 // GSO frame, IPv6 TCP
85#define VIRTIO_NET_HDR_GSO_ECN 0x80 // TCP has ECN set 86#define VIRTIO_NET_HDR_GSO_ECN 0x80 // TCP has ECN set
86 __u8 gso_type; 87 __u8 gso_type;
87 __u16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */ 88 __virtio16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */
88 __u16 gso_size; /* Bytes to append to hdr_len per frame */ 89 __virtio16 gso_size; /* Bytes to append to hdr_len per frame */
89 __u16 csum_start; /* Position to start checksumming from */ 90 __virtio16 csum_start; /* Position to start checksumming from */
90 __u16 csum_offset; /* Offset after that to place checksum */ 91 __virtio16 csum_offset; /* Offset after that to place checksum */
91}; 92};
92 93
93/* This is the version of the header to use when the MRG_RXBUF 94/* This is the version of the header to use when the MRG_RXBUF
94 * feature has been negotiated. */ 95 * feature has been negotiated. */
95struct virtio_net_hdr_mrg_rxbuf { 96struct virtio_net_hdr_mrg_rxbuf {
96 struct virtio_net_hdr hdr; 97 struct virtio_net_hdr hdr;
97 __u16 num_buffers; /* Number of merged rx buffers */ 98 __virtio16 num_buffers; /* Number of merged rx buffers */
98}; 99};
99 100
100/* 101/*
@@ -149,7 +150,7 @@ typedef __u8 virtio_net_ctrl_ack;
149 * VIRTIO_NET_F_CTRL_MAC_ADDR feature is available. 150 * VIRTIO_NET_F_CTRL_MAC_ADDR feature is available.
150 */ 151 */
151struct virtio_net_ctrl_mac { 152struct virtio_net_ctrl_mac {
152 __u32 entries; 153 __virtio32 entries;
153 __u8 macs[][ETH_ALEN]; 154 __u8 macs[][ETH_ALEN];
154} __attribute__((packed)); 155} __attribute__((packed));
155 156
@@ -193,7 +194,7 @@ struct virtio_net_ctrl_mac {
193 * specified. 194 * specified.
194 */ 195 */
195struct virtio_net_ctrl_mq { 196struct virtio_net_ctrl_mq {
196 __u16 virtqueue_pairs; 197 __virtio16 virtqueue_pairs;
197}; 198};
198 199
199#define VIRTIO_NET_CTRL_MQ 4 200#define VIRTIO_NET_CTRL_MQ 4