From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 4FD3F5938 for ; Thu, 12 Mar 2015 16:30:31 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 12 Mar 2015 08:24:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,389,1422950400"; d="scan'208";a="691133817" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga002.fm.intel.com with ESMTP; 12 Mar 2015 08:30:29 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t2CFURtw025266; Thu, 12 Mar 2015 23:30:27 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t2CFUPNY014704; Thu, 12 Mar 2015 23:30:27 +0800 Received: (from hxie5@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t2CFUOtm014700; Thu, 12 Mar 2015 23:30:24 +0800 From: Huawei Xie To: dev@dpdk.org Date: Thu, 12 Mar 2015 23:30:23 +0800 Message-Id: <1426174223-14666-1-git-send-email-huawei.xie@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] lib/librte_vhost: add CONFIG_RTE_LIBRTE_VHOST_USER switch X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 15:30:31 -0000 Turn on CONFIG_RTE_LIBRTE_VHOST to enable vhost. vhost-user is turned on by default. Turn off CONFIG_RTE_LIBRTE_VHOST_USER to enable vhost-cuse implementation. Signed-off-by: Huawei Xie --- config/common_linuxapp | 4 +++- lib/librte_vhost/Makefile | 11 +++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/config/common_linuxapp b/config/common_linuxapp index 97f1c9e..09a58ac 100644 --- a/config/common_linuxapp +++ b/config/common_linuxapp @@ -414,10 +414,12 @@ CONFIG_RTE_KNI_VHOST_DEBUG_TX=n # # Compile vhost library -# fuse-devel is needed to run vhost. +# fuse-devel is needed to run vhost-cuse. # fuse-devel enables user space char driver development +# vhost-user is turned on by default. # CONFIG_RTE_LIBRTE_VHOST=n +CONFIG_RTE_LIBRTE_VHOST_USER=y CONFIG_RTE_LIBRTE_VHOST_DEBUG=n # diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile index 52f6575..a8645a6 100644 --- a/lib/librte_vhost/Makefile +++ b/lib/librte_vhost/Makefile @@ -39,13 +39,20 @@ EXPORT_MAP := rte_vhost_version.map LIBABIVER := 1 CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64 -CFLAGS += -I vhost_cuse -lfuse +ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),y) CFLAGS += -I vhost_user +else +CFLAGS += -I vhost_cuse -lfuse LDFLAGS += -lfuse +endif + # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_VHOST) := virtio-net.c vhost_rxtx.c -#SRCS-$(CONFIG_RTE_LIBRTE_VHOST) += vhost_cuse/vhost-net-cdev.c vhost_cuse/virtio-net-cdev.c vhost_cuse/eventfd_copy.c +ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),y) SRCS-$(CONFIG_RTE_LIBRTE_VHOST) += vhost_user/vhost-net-user.c vhost_user/virtio-net-user.c vhost_user/fd_man.c +else +SRCS-$(CONFIG_RTE_LIBRTE_VHOST) += vhost_cuse/vhost-net-cdev.c vhost_cuse/virtio-net-cdev.c vhost_cuse/eventfd_copy.c +endif # install includes SYMLINK-$(CONFIG_RTE_LIBRTE_VHOST)-include += rte_virtio_net.h -- 1.8.1.4