From: Michael S. Tsirkin Date: Wed, 8 Mar 2017 00:14:25 +0000 (+0200) Subject: virtio_net: enable big packets for large MTU values X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2e123b44a3c19de75f40ee0081d6d4fc04adfdc7;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git virtio_net: enable big packets for large MTU values 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 --- diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index ea9890d61967..006f1a603102 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -2367,6 +2367,10 @@ static int virtnet_probe(struct virtio_device *vdev) dev->mtu = mtu; dev->max_mtu = mtu; } + + /* TODO: size buffers correctly in this case. */ + if (dev->mtu > ETH_DATA_LEN) + vi->big_packets = true; } if (vi->any_header_sg)