History

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.

Michael S. Tsirkin committed 12 years ago

Commit fdd819b1 parent b3bb62d2 files · +28 −20Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/virtio_net.h+8−7
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include <linux/types.h>
2929 #include <linux/virtio_ids.h>
3030 #include <linux/virtio_config.h>
31+#include <linux/virtio_types.h>
3132 #include <linux/if_ether.h>
3233
3334 /* The feature bitmap for virtio net */
@@ -84,17 +85,17 @@ struct virtio_net_hdr { · 50 unmodified lines
8485 #define VIRTIO_NET_HDR_GSO_TCPV6 4 // GSO frame, IPv6 TCP
8586 #define VIRTIO_NET_HDR_GSO_ECN 0x80 // TCP has ECN set
8687 __u8 gso_type;
87− __u16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */
88− __u16 gso_size; /* Bytes to append to hdr_len per frame */
89− __u16 csum_start; /* Position to start checksumming from */
90− __u16 csum_offset; /* Offset after that to place checksum */
88+ __virtio16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */
89+ __virtio16 gso_size; /* Bytes to append to hdr_len per frame */
90+ __virtio16 csum_start; /* Position to start checksumming from */
91+ __virtio16 csum_offset; /* Offset after that to place checksum */
9192 };
9293
9394 /* This is the version of the header to use when the MRG_RXBUF
9495 * feature has been negotiated. */
9596 struct virtio_net_hdr_mrg_rxbuf {
9697 struct virtio_net_hdr hdr;
97− __u16 num_buffers; /* Number of merged rx buffers */
98+ __virtio16 num_buffers; /* Number of merged rx buffers */
9899 };
99100
100101 /*
@@ -149,7 +150,7 @@ typedef __u8 virtio_net_ctrl_ack; · 48 unmodified lines
149150 * VIRTIO_NET_F_CTRL_MAC_ADDR feature is available.
150151 */
151152 struct virtio_net_ctrl_mac {
152− __u32 entries;
153+ __virtio32 entries;
153154 __u8 macs[][ETH_ALEN];
154155 } __attribute__((packed));
155156
@@ -193,7 +194,7 @@ struct virtio_net_ctrl_mac { · 37 unmodified lines
193194 * specified.
194195 */
195196 struct virtio_net_ctrl_mq {
196− __u16 virtqueue_pairs;
197+ __virtio16 virtqueue_pairs;
197198 };
198199
199200 #define VIRTIO_NET_CTRL_MQ 4