vhost: enable virtio MTU feature

This patch enables the new VIRTIO_NET_F_MTU feature,
which makes possible for the host to advise the guest
with its maximum supported MTU.

MTU value is set via QEMU parameters, either via Libvirt XML, or
directly in virtio-net device command line arguments.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
This commit is contained in:
Maxime Coquelin 2017-03-12 17:33:58 +01:00 committed by Yuanhan Liu
parent 160cbc815b
commit 3d3c6590b5
2 changed files with 6 additions and 1 deletions

View File

@ -66,7 +66,8 @@
(1ULL << VIRTIO_NET_F_GUEST_CSUM) | \ (1ULL << VIRTIO_NET_F_GUEST_CSUM) | \
(1ULL << VIRTIO_NET_F_GUEST_TSO4) | \ (1ULL << VIRTIO_NET_F_GUEST_TSO4) | \
(1ULL << VIRTIO_NET_F_GUEST_TSO6) | \ (1ULL << VIRTIO_NET_F_GUEST_TSO6) | \
(1ULL << VIRTIO_RING_F_INDIRECT_DESC)) (1ULL << VIRTIO_RING_F_INDIRECT_DESC) | \
(1ULL << VIRTIO_NET_F_MTU))
uint64_t VHOST_FEATURES = VHOST_SUPPORTED_FEATURES; uint64_t VHOST_FEATURES = VHOST_SUPPORTED_FEATURES;

View File

@ -120,6 +120,10 @@ struct vhost_virtqueue {
#endif #endif
#define VHOST_MAX_QUEUE_PAIRS 0x80 #define VHOST_MAX_QUEUE_PAIRS 0x80
#ifndef VIRTIO_NET_F_MTU
#define VIRTIO_NET_F_MTU 3
#endif
/* /*
* Define virtio 1.0 for older kernels * Define virtio 1.0 for older kernels
*/ */