summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2017-03-08 02:14:25 +0200
committerMichael S. Tsirkin <mst@redhat.com>2017-04-07 16:38:59 +0300
commit2e123b44a3c19de75f40ee0081d6d4fc04adfdc7 (patch)
treea2ec9ff230c93bab071e13798899a9040aaf76e0
parenta71c9a1c779f2499fb2afc0553e543f18aff6edf (diff)
downloadop-kernel-dev-2e123b44a3c19de75f40ee0081d6d4fc04adfdc7.zip
op-kernel-dev-2e123b44a3c19de75f40ee0081d6d4fc04adfdc7.tar.gz
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 <mst@redhat.com>
-rw-r--r--drivers/net/virtio_net.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index ea9890d..006f1a60 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)
OpenPOWER on IntegriCloud