From: Huawei Xie Date: Thu, 12 Mar 2015 15:30:23 +0000 (+0800) Subject: vhost: add build option for vhost-user X-Git-Tag: spdx-start~9436 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=28a1ccca41bf;p=dpdk.git vhost: add build option for vhost-user 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 Acked-by: Changchun Ouyang --- diff --git a/config/common_linuxapp b/config/common_linuxapp index 97f1c9ee23..09a58acff5 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 52f65752c1..a8645a664a 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