From 7c845c1fcd410fceddb38bb1cf557e9390a40605 Mon Sep 17 00:00:00 2001 From: Huawei Xie Date: Thu, 9 Oct 2014 02:54:59 +0800 Subject: [PATCH] vhost: add makefile vhost lib is turned off by default. vhost lib is based on cuse, which requires fuse development package to be installed. Signed-off-by: Huawei Xie Acked-by: Changchun Ouyang [Thomas: fix build dependencies] --- config/common_linuxapp | 8 +++++++ lib/Makefile | 1 + lib/librte_vhost/Makefile | 50 +++++++++++++++++++++++++++++++++++++++ mk/rte.app.mk | 5 ++++ 4 files changed, 64 insertions(+) create mode 100644 lib/librte_vhost/Makefile diff --git a/config/common_linuxapp b/config/common_linuxapp index 4713eb49fe..c5751bda27 100644 --- a/config/common_linuxapp +++ b/config/common_linuxapp @@ -387,6 +387,14 @@ CONFIG_RTE_KNI_VHOST_VNET_HDR_EN=n CONFIG_RTE_KNI_VHOST_DEBUG_RX=n CONFIG_RTE_KNI_VHOST_DEBUG_TX=n +# +# Compile vhost library +# fuse-devel is needed to run vhost. +# fuse-devel enables user space char driver development +# +CONFIG_RTE_LIBRTE_VHOST=n +CONFIG_RTE_LIBRTE_VHOST_DEBUG=n + # #Compile Xen domain0 support # diff --git a/lib/Makefile b/lib/Makefile index 10c5bb3045..e3237ff5fc 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -50,6 +50,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += librte_pmd_pcap DIRS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += librte_pmd_virtio DIRS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += librte_pmd_vmxnet3 DIRS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += librte_pmd_xenvirt +DIRS-$(CONFIG_RTE_LIBRTE_VHOST) += librte_vhost DIRS-$(CONFIG_RTE_LIBRTE_HASH) += librte_hash DIRS-$(CONFIG_RTE_LIBRTE_LPM) += librte_lpm DIRS-$(CONFIG_RTE_LIBRTE_ACL) += librte_acl diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile new file mode 100644 index 0000000000..c008d64ae0 --- /dev/null +++ b/lib/librte_vhost/Makefile @@ -0,0 +1,50 @@ +# BSD LICENSE +# +# Copyright(c) 2010-2014 Intel Corporation. All rights reserved. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +include $(RTE_SDK)/mk/rte.vars.mk + +# library name +LIB = librte_vhost.a + +CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64 -lfuse +LDFLAGS += -lfuse +# all source are stored in SRCS-y +SRCS-$(CONFIG_RTE_LIBRTE_VHOST) := vhost-net-cdev.c virtio-net.c vhost_rxtx.c + +# install includes +SYMLINK-$(CONFIG_RTE_LIBRTE_VHOST)-include += rte_virtio_net.h + +# dependencies +DEPDIRS-$(CONFIG_RTE_LIBRTE_VHOST) += lib/librte_eal +DEPDIRS-$(CONFIG_RTE_LIBRTE_VHOST) += lib/librte_ether +DEPDIRS-$(CONFIG_RTE_LIBRTE_VHOST) += lib/librte_mbuf + +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 34dff2a02a..285b65ce66 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -190,6 +190,11 @@ ifeq ($(CONFIG_RTE_LIBRTE_VIRTIO_PMD),y) LDLIBS += -lrte_pmd_virtio_uio endif +ifeq ($(CONFIG_RTE_LIBRTE_VHOST), y) +LDLIBS += -lrte_vhost +LDLIBS += -lfuse +endif + ifeq ($(CONFIG_RTE_LIBRTE_I40E_PMD),y) LDLIBS += -lrte_pmd_i40e endif -- 2.20.1