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
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 { · 50 unmodified lines
84#define VIRTIO_NET_HDR_GSO_TCPV6 4 // GSO frame, IPv6 TCP85#define VIRTIO_NET_HDR_GSO_TCPV6 4 // GSO frame, IPv6 TCP
85#define VIRTIO_NET_HDR_GSO_ECN 0x80 // TCP has ECN set86#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_RXBUF94/* 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; · 48 unmodified lines
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 { · 37 unmodified lines
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 4200#define VIRTIO_NET_CTRL_MQ 4