aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/virtio_net.h
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2011-06-09 20:56:17 -0400
committerDavid S. Miller <davem@davemloft.net>2011-06-11 18:57:47 -0400
commit10a8d94a95742bb15b4e617ee9884bb4381362be (patch)
tree768f2d92be0e12bca791bcb901ad4bdedc7d8a76 /include/linux/virtio_net.h
parent40d15cd06e87722b1cc27d56c8274617580f2c56 (diff)
virtio_net: introduce VIRTIO_NET_HDR_F_DATA_VALID
There's no need for the guest to validate the checksum if it have been validated by host nics. So this patch introduces a new flag - VIRTIO_NET_HDR_F_DATA_VALID which is used to bypass the checksum examing in guest. The backend (tap/macvtap) may set this flag when met skbs with CHECKSUM_UNNECESSARY to save cpu utilization. No feature negotiation is needed as old driver just ignore this flag. Iperf shows 12%-30% performance improvement for UDP traffic. For TCP, when gro is on no difference as it produces skb with partial checksum. But when gro is disabled, 20% or even higher improvement could be measured by netperf. Signed-off-by: Jason Wang <jasowang@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/virtio_net.h')
-rw-r--r--include/linux/virtio_net.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index 136040bba3e3..970d5a2a9047 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -63,6 +63,7 @@ struct virtio_net_config {
63 * specify GSO or CSUM features, you can simply ignore the header. */ 63 * specify GSO or CSUM features, you can simply ignore the header. */
64struct virtio_net_hdr { 64struct virtio_net_hdr {
65#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset 65#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset
66#define VIRTIO_NET_HDR_F_DATA_VALID 2 // Csum is valid
66 __u8 flags; 67 __u8 flags;
67#define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame 68#define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame
68#define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO) 69#define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO)