aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/virtio_net.c9
-rw-r--r--include/linux/virtio_net.h13
2 files changed, 20 insertions, 2 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index e44116452b7b..ad43421ab6f1 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -385,6 +385,15 @@ static int virtnet_probe(struct virtio_device *vdev)
385 dev->features |= NETIF_F_TSO | NETIF_F_UFO 385 dev->features |= NETIF_F_TSO | NETIF_F_UFO
386 | NETIF_F_TSO_ECN | NETIF_F_TSO6; 386 | NETIF_F_TSO_ECN | NETIF_F_TSO6;
387 } 387 }
388 /* Individual feature bits: what can host handle? */
389 if (gso && vdev->config->feature(vdev, VIRTIO_NET_F_HOST_TSO4))
390 dev->features |= NETIF_F_TSO;
391 if (gso && vdev->config->feature(vdev, VIRTIO_NET_F_HOST_TSO6))
392 dev->features |= NETIF_F_TSO6;
393 if (gso && vdev->config->feature(vdev, VIRTIO_NET_F_HOST_ECN))
394 dev->features |= NETIF_F_TSO_ECN;
395 if (gso && vdev->config->feature(vdev, VIRTIO_NET_F_HOST_UFO))
396 dev->features |= NETIF_F_UFO;
388 } 397 }
389 398
390 /* Configuration may specify what MAC to use. Otherwise random. */ 399 /* Configuration may specify what MAC to use. Otherwise random. */
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index 1ea3351df609..9405aa6cdf26 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -6,9 +6,18 @@
6#define VIRTIO_ID_NET 1 6#define VIRTIO_ID_NET 1
7 7
8/* The feature bitmap for virtio net */ 8/* The feature bitmap for virtio net */
9#define VIRTIO_NET_F_CSUM 0 /* Can handle pkts w/ partial csum */ 9#define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */
10#define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */
10#define VIRTIO_NET_F_MAC 5 /* Host has given MAC address. */ 11#define VIRTIO_NET_F_MAC 5 /* Host has given MAC address. */
11#define VIRTIO_NET_F_GSO 6 /* Can handle pkts w/ any GSO type */ 12#define VIRTIO_NET_F_GSO 6 /* Host handles pkts w/ any GSO type */
13#define VIRTIO_NET_F_GUEST_TSO4 7 /* Guest can handle TSOv4 in. */
14#define VIRTIO_NET_F_GUEST_TSO6 8 /* Guest can handle TSOv6 in. */
15#define VIRTIO_NET_F_GUEST_ECN 9 /* Guest can handle TSO[6] w/ ECN in. */
16#define VIRTIO_NET_F_GUEST_UFO 10 /* Guest can handle UFO in. */
17#define VIRTIO_NET_F_HOST_TSO4 11 /* Host can handle TSOv4 in. */
18#define VIRTIO_NET_F_HOST_TSO6 12 /* Host can handle TSOv6 in. */
19#define VIRTIO_NET_F_HOST_ECN 13 /* Host can handle TSO[6] w/ ECN in. */
20#define VIRTIO_NET_F_HOST_UFO 14 /* Host can handle UFO in. */
12 21
13struct virtio_net_config 22struct virtio_net_config
14{ 23{