From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BDA4BA04F1; Thu, 18 Jun 2020 21:08:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 151E31BFFF; Thu, 18 Jun 2020 21:08:27 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 47EDE1BFD1 for ; Thu, 18 Jun 2020 21:08:25 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from matan@mellanox.com) with SMTP; 18 Jun 2020 22:08:24 +0300 Received: from pegasus25.mtr.labs.mlnx. (pegasus25.mtr.labs.mlnx [10.210.16.10]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 05IJ8OZY004278; Thu, 18 Jun 2020 22:08:24 +0300 From: Matan Azrad To: Maxime Coquelin Cc: dev@dpdk.org, stable@dpdk.org Date: Thu, 18 Jun 2020 19:08:20 +0000 Message-Id: <1592507300-442031-1-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1591113208-79169-2-git-send-email-matan@mellanox.com> References: <1591113208-79169-2-git-send-email-matan@mellanox.com> Subject: [dpdk-dev] [PATCH] vhost: fix features definition location 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The vhost library provide an infrastructure in order to help the DPDK users to manage vhost devices. One of the infrastructure parts is the features enablement APIs. Some features bits may be defined only in the internal file vhost.h in case the kernel version doesn't include them. Hence, user running on old kernel may not be able to manage thus features. Move all the feature bits definitions to the API file rte_vhost.h. Fixes: db69be54b6ff ("vhost: hide internal code") Fixes: 8d286dbeb8d7 ("vhost: fix multiple queue not enabled for old kernels") Fixes: 3d3c6590b58c ("vhost: enable virtio MTU feature") Fixes: 704098fc478c ("vhost: fix build with old kernels") Cc: stable@dpdk.org Signed-off-by: Matan Azrad --- lib/librte_vhost/rte_vhost.h | 17 +++++++++++++++++ lib/librte_vhost/vhost.h | 17 ----------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h index d43669f..329ed8a 100644 --- a/lib/librte_vhost/rte_vhost.h +++ b/lib/librte_vhost/rte_vhost.h @@ -36,6 +36,23 @@ /* support only linear buffers (no chained mbufs) */ #define RTE_VHOST_USER_LINEARBUF_SUPPORT (1ULL << 6) +/* Features. */ +#ifndef VIRTIO_NET_F_GUEST_ANNOUNCE + #define VIRTIO_NET_F_GUEST_ANNOUNCE 21 +#endif + +#ifndef VIRTIO_NET_F_MQ + #define VIRTIO_NET_F_MQ 22 +#endif + +#ifndef VIRTIO_NET_F_MTU + #define VIRTIO_NET_F_MTU 3 +#endif + +#ifndef VIRTIO_F_ANY_LAYOUT + #define VIRTIO_F_ANY_LAYOUT 27 +#endif + /** Protocol features. */ #ifndef VHOST_USER_PROTOCOL_F_MQ #define VHOST_USER_PROTOCOL_F_MQ 0 diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index df98d15..17f1e9a 100644 --- a/lib/librte_vhost/vhost.h +++ b/lib/librte_vhost/vhost.h @@ -202,26 +202,9 @@ struct vhost_virtqueue { TAILQ_HEAD(, vhost_iotlb_entry) iotlb_pending_list; } __rte_cache_aligned; -/* 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_MQ - #define VIRTIO_NET_F_MQ 22 -#endif - #define VHOST_MAX_VRING 0x100 #define VHOST_MAX_QUEUE_PAIRS 0x80 -#ifndef VIRTIO_NET_F_MTU - #define VIRTIO_NET_F_MTU 3 -#endif - -#ifndef VIRTIO_F_ANY_LAYOUT - #define VIRTIO_F_ANY_LAYOUT 27 -#endif - /* Declare IOMMU related bits for older kernels */ #ifndef VIRTIO_F_IOMMU_PLATFORM -- 1.8.3.1