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.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -28,6 +28,7 @@ · 27 unmodified lines | ||
| 28 | 28 | #include <linux/types.h> |
| 29 | 29 | #include <linux/virtio_ids.h> |
| 30 | 30 | #include <linux/virtio_config.h> |
| 31 | +#include <linux/virtio_types.h> | |
| 31 | 32 | #include <linux/if_ether.h> |
| 32 | 33 | |
| 33 | 34 | /* The feature bitmap for virtio net */ |
| @@ -84,17 +85,17 @@ struct virtio_net_hdr { · 50 unmodified lines | ||
| 84 | 85 | #define VIRTIO_NET_HDR_GSO_TCPV6 4 // GSO frame, IPv6 TCP |
| 85 | 86 | #define VIRTIO_NET_HDR_GSO_ECN 0x80 // TCP has ECN set |
| 86 | 87 | __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 */ | |
| 91 | 92 | }; |
| 92 | 93 | |
| 93 | 94 | /* This is the version of the header to use when the MRG_RXBUF |
| 94 | 95 | * feature has been negotiated. */ |
| 95 | 96 | struct virtio_net_hdr_mrg_rxbuf { |
| 96 | 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 | 150 | * VIRTIO_NET_F_CTRL_MAC_ADDR feature is available. |
| 150 | 151 | */ |
| 151 | 152 | struct virtio_net_ctrl_mac { |
| 152 | − __u32 entries; | |
| 153 | + __virtio32 entries; | |
| 153 | 154 | __u8 macs[][ETH_ALEN]; |
| 154 | 155 | } __attribute__((packed)); |
| 155 | 156 | |
| @@ -193,7 +194,7 @@ struct virtio_net_ctrl_mac { · 37 unmodified lines | ||
| 193 | 194 | * specified. |
| 194 | 195 | */ |
| 195 | 196 | struct virtio_net_ctrl_mq { |
| 196 | − __u16 virtqueue_pairs; | |
| 197 | + __virtio16 virtqueue_pairs; | |
| 197 | 198 | }; |
| 198 | 199 | |
| 199 | 200 | #define VIRTIO_NET_CTRL_MQ 4 |