summaryrefslogtreecommitdiff
path: root/include/linux/virtio_net.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2008-02-05 07:50:02 +0300
committerRusty Russell <rusty@rustcorp.com.au>2008-02-04 15:50:02 +0300
commit34a48579e4fb380604d06f0409db3851bd22d785 (patch)
tree0bf5091284b456719b527a288bc79111987fd0f2 /include/linux/virtio_net.h
parent50c8ea8080700014872f2bbd7466d31ce0476290 (diff)
downloadlinux-34a48579e4fb380604d06f0409db3851bd22d785.tar.xz
virtio: Tweak virtio_net defines
1) Turn GSO on virtio net into an all-or-nothing (keep checksumming separate). Having multiple bits is a pain: if you can't support something you should handle it in software, which is still a performance win. 2) Make VIRTIO_NET_HDR_GSO_ECN a flag in the header, so it can apply to IPv6 or v4. 3) Rename VIRTIO_NET_F_NO_CSUM to VIRTIO_NET_F_CSUM (ie. means we do checksumming). 4) Add csum and gso params to virtio_net to allow more testing. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include/linux/virtio_net.h')
-rw-r--r--include/linux/virtio_net.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index 1456f7b936d0..1ea3351df609 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -6,12 +6,9 @@
#define VIRTIO_ID_NET 1
/* The feature bitmap for virtio net */
-#define VIRTIO_NET_F_NO_CSUM 0
-#define VIRTIO_NET_F_TSO4 1
-#define VIRTIO_NET_F_UFO 2
-#define VIRTIO_NET_F_TSO4_ECN 3
-#define VIRTIO_NET_F_TSO6 4
-#define VIRTIO_NET_F_MAC 5
+#define VIRTIO_NET_F_CSUM 0 /* Can handle pkts w/ partial csum */
+#define VIRTIO_NET_F_MAC 5 /* Host has given MAC address. */
+#define VIRTIO_NET_F_GSO 6 /* Can handle pkts w/ any GSO type */
struct virtio_net_config
{
@@ -27,10 +24,9 @@ struct virtio_net_hdr
__u8 flags;
#define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame
#define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO)
-/* FIXME: Do we need this? If they said they can handle ECN, do they care? */
-#define VIRTIO_NET_HDR_GSO_TCPV4_ECN 2 // GSO frame, IPv4 TCP w/ ECN
#define VIRTIO_NET_HDR_GSO_UDP 3 // GSO frame, IPv4 UDP (UFO)
#define VIRTIO_NET_HDR_GSO_TCPV6 4 // GSO frame, IPv6 TCP
+#define VIRTIO_NET_HDR_GSO_ECN 0x80 // TCP has ECN set
__u8 gso_type;
__u16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */
__u16 gso_size; /* Bytes to append to gso_hdr_len per frame */