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>
This commit is contained in:
Michael S. Tsirkin 2017-03-08 02:14:25 +02:00
parent a71c9a1c77
commit 2e123b44a3
1 changed files with 4 additions and 0 deletions

View File

@ -2367,6 +2367,10 @@ static int virtnet_probe(struct virtio_device *vdev)
dev->mtu = mtu; dev->mtu = mtu;
dev->max_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) if (vi->any_header_sg)