From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 9B8943772 for ; Mon, 6 Mar 2017 09:27:54 +0100 (CET) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0CB3AC057FA5; Mon, 6 Mar 2017 08:27:55 +0000 (UTC) Received: from max-t460s.redhat.com (ovpn-116-235.ams2.redhat.com [10.36.116.235]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v268RmvB006934; Mon, 6 Mar 2017 03:27:52 -0500 From: Maxime Coquelin To: aconole@redhat.com, sodey@sonusnet.com, yuanhan.liu@linux.intel.com, jianfeng.tan@intel.com, dev@dpdk.org Cc: Maxime Coquelin Date: Mon, 6 Mar 2017 09:27:34 +0100 Message-Id: <20170306082740.5675-2-maxime.coquelin@redhat.com> In-Reply-To: <20170306082740.5675-1-maxime.coquelin@redhat.com> References: <20170213142820.8964-1-maxime.coquelin@redhat.com> <20170306082740.5675-1-maxime.coquelin@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 06 Mar 2017 08:27:55 +0000 (UTC) Subject: [dpdk-dev] [PATCH v2 1/7] vhost: Enable VIRTIO_NET_F_MTU feature X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Mar 2017 08:27:54 -0000 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 --- lib/librte_vhost/vhost.c | 3 ++- lib/librte_vhost/vhost.h | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index e415093..3974087 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 22564f1..6a57bb3 100644 --- a/lib/librte_vhost/vhost.h +++ b/lib/librte_vhost/vhost.h @@ -110,11 +110,15 @@ struct vhost_virtqueue { uint16_t shadow_used_idx; } __rte_cache_aligned; -/* Old kernels have no such macro defined */ +/* Old kernels have no such macros defined */ #ifndef VIRTIO_NET_F_GUEST_ANNOUNCE #define VIRTIO_NET_F_GUEST_ANNOUNCE 21 #endif +#ifndef VIRTIO_NET_F_MTU + #define VIRTIO_NET_F_MTU 3 +#endif + /* * Make an extra wrapper for VIRTIO_NET_F_MQ and -- 2.9.3