From 3d3c6590b58cf27b861dade140f5eb2e857bcad2 Mon Sep 17 00:00:00 2001 From: Maxime Coquelin Date: Sun, 12 Mar 2017 17:33:58 +0100 Subject: [PATCH] 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 Acked-by: Yuanhan Liu --- lib/librte_vhost/vhost.c | 3 ++- lib/librte_vhost/vhost.h | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index 3c3f6a4275..3e87ecca07 100644 --- a/lib/librte_vhost/vhost.c +++ b/lib/librte_vhost/vhost.c @@ -66,7 +66,8 @@ (1ULL << VIRTIO_NET_F_GUEST_CSUM) | \ (1ULL << VIRTIO_NET_F_GUEST_TSO4) | \ (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; diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index d97df1d83a..5c94322261 100644 --- a/lib/librte_vhost/vhost.h +++ b/lib/librte_vhost/vhost.h @@ -120,6 +120,10 @@ struct vhost_virtqueue { #endif #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 */ -- 2.20.1