]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
virtio_net: enable big packets for large MTU values
authorMichael S. Tsirkin <mst@redhat.com>
Wed, 8 Mar 2017 00:14:25 +0000 (02:14 +0200)
committerSi-Wei Liu <si-wei.liu@oracle.com>
Fri, 15 Sep 2017 18:24:22 +0000 (14:24 -0400)
If one enables e.g. jumbo frames without mergeable
buffers, packets won't fit in 1500 byte buffers
we use. Switch to big packet mode instead.
TODO: make sizing more exact, possibly extend small
packet mode to use larger pages.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 2e123b44a3c19de75f40ee0081d6d4fc04adfdc7)

Orabug: 26584452

Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Conflicts:
drivers/net/virtio_net.c
Due to the lack of commit d0c2c9973ecd ("net: use core MTU range
checking in virt drivers") the MTU size check is still done in the
virtio_net.

drivers/net/virtio_net.c

index 4634cba53b70325da0190f4ef779b4ace12690df..4f0b08363073d8990f2d4e4db62e9919408482c2 100644 (file)
@@ -1842,6 +1842,10 @@ static int virtnet_probe(struct virtio_device *vdev)
                                              mtu));
                if (virtnet_change_mtu(dev, mtu))
                        __virtio_clear_bit(vdev, VIRTIO_NET_F_MTU);
+
+               /* TODO: size buffers correctly in this case. */
+               if (dev->mtu > ETH_DATA_LEN)
+                       vi->big_packets = true;
        }
 
        if (vi->any_header_sg)