aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2015-07-29 08:02:34 +0100
committerMaryam Tahhan <maryam.tahhan@intel.com>2015-08-05 14:50:51 +0000
commit017df35d6c2a73dbdce22e260a8ca16e6b369a01 (patch)
treefbb7edbbe083a2cc292878f4971ec352915a4c9b
parentd476ee6b6db3968443d6d82d5ffef8acefb3dccb (diff)
src/dpdk: Enable building of vhost-user in src/dpdk.
Allow vhost-user compilation by specifying make VHOST_USER=y in src/Makefile. This commit also fixes a dpdk linking issue by modifying config/common_linuxapp instead of passing args. JIRA: VSPERF-56 Change-Id: I0437bf92b37f8f5a1939690c308cd54dfbe017f0 Signed-off-by: Dino Simeon Madarang <dino.simeonx.madarang@intel.com> Signed-off-by: Martin Klozik <martinx.klozik@intel.com> Reviewed-by: Billy O Mahony <billy.o.mahony@intel.com> Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com> Reviewed-by: Eugene Snider <Eugene.Snider@huawei.com> Reviewed-by: Gurpreet Singh <gurpreet.singh@spirent.com> Reviewed-by: Tv Rao <tv.rao@freescale.com>
-rw-r--r--src/Makefile2
-rwxr-xr-xsrc/dpdk/Makefile12
2 files changed, 11 insertions, 3 deletions
diff --git a/src/Makefile b/src/Makefile
index 3b7104ad..d16b093d 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -21,6 +21,8 @@
include mk/master.mk
+export VHOST_USER
+
# specify upstream package as SUBDIRS - common terms as suggest by gnu-make
SUBDIRS =
SUBDIRS += l2fwd
diff --git a/src/dpdk/Makefile b/src/dpdk/Makefile
index 1f4ca0ae..8335ed4e 100755
--- a/src/dpdk/Makefile
+++ b/src/dpdk/Makefile
@@ -24,6 +24,9 @@ include ../package-list.mk
.PHONY: install force_make
+ifndef VHOST_USER
+ VHOST_USER = n
+endif
WORK_DIR = dpdk
TAG_DONE_FLAG = $(WORK_DIR)/.$(DPDK_TAG).tag.done
@@ -41,8 +44,14 @@ all: force_make
INSTALL_TARGET = force_make
+# modify CONFIG_FILE to enable VHOST_USER build and restore original CONFIG_FILE after the build
force_make: $(TAG_DONE_FLAG)
+ $(AT)sed -i -e 's/CONFIG_RTE_LIBRTE_VHOST_USER=.\+/CONFIG_RTE_LIBRTE_VHOST_USER=$(VHOST_USER)/g' $(CONFIG_FILE)
+ $(AT)sed -i -e 's/CONFIG_RTE_BUILD_COMBINE_LIBS=./CONFIG_RTE_BUILD_COMBINE_LIBS=y/g' $(CONFIG_FILE)
+ $(AT)sed -i -e 's/CONFIG_RTE_LIBRTE_VHOST=./CONFIG_RTE_LIBRTE_VHOST=y/g' $(CONFIG_FILE)
+ $(AT)sed -i -e 's/CONFIG_RTE_LIBRTE_KNI=./CONFIG_RTE_LIBRTE_KNI=n/g' $(CONFIG_FILE)
$(AT)cd $(WORK_DIR); make install T=$(DPDK_TARGET) -j
+ $(AT)cd `dirname $(CONFIG_FILE)` && git checkout `basename $(CONFIG_FILE)` && cd -
@echo "Make done"
install: $(INSTALL_TARGET)
@@ -70,7 +79,4 @@ $(WORK_DIR):
$(TAG_DONE_FLAG): $(WORK_DIR)
$(AT)cd $(WORK_DIR); git checkout $(DPDK_TAG)
- $(AT)sed -i 's/CONFIG_RTE_BUILD_COMBINE_LIBS=n/CONFIG_RTE_BUILD_COMBINE_LIBS=y/g' $(CONFIG_FILE)
- $(AT)sed -i 's/CONFIG_RTE_LIBRTE_VHOST=n/CONFIG_RTE_LIBRTE_VHOST=y/g' $(CONFIG_FILE)
- $(AT)sed -i 's/CONFIG_RTE_LIBRTE_KNI=y /CONFIG_RTE_LIBRTE_KNI=n/g' $(CONFIG_FILE)
$(AT)touch $@