From: Maxime Coquelin Date: Sun, 12 Mar 2017 16:33:58 +0000 (+0100) Subject: vhost: enable virtio MTU feature X-Git-Tag: spdx-start~3915 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3d3c6590b58cf27b861dade140f5eb2e857bcad2;p=dpdk.git 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 --- 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 */