From 1550b638fca662c5e68556702ff0316c3fc9562c Mon Sep 17 00:00:00 2001 From: Radek Zetik Date: Thu, 1 Oct 2015 18:13:18 +0100 Subject: The 'make' creates all required variants of vSwitch Currently the VSPERF makefiles make just one variant of vSwitch - OVS with DPDK-vhost-user. To make the other variants the makefile has to be edited. And the make re-run. The fix builds all required versions: DPDK-vhost-user OVS (in src/) Vanilla OVS (in src_vanilla/) DPDK-vhost-cuse OVS (in src_cuse/) HowTo: - git clone vsperf - cd .../src - make JIRA: VSPERF-85 Change-Id: I469baf8432f0b127cde785f35a6c57a2c778f23f Signed-off-by: Radek Zetik Reviewed-by: Maryam Tahhan Reviewed-by: Brian Castelli --- src/Makefile | 26 ++++++++++++++++---------- src/Makefile.src_cuse | 34 ++++++++++++++++++++++++++++++++++ src/Makefile.src_vanilla | 33 +++++++++++++++++++++++++++++++++ src/dpdk/Makefile | 9 +++++++++ src/ovs/Makefile | 9 +++++++++ src/qemu/Makefile | 9 ++++++++- 6 files changed, 109 insertions(+), 11 deletions(-) create mode 100644 src/Makefile.src_cuse create mode 100644 src/Makefile.src_vanilla (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 0b62da3e..81143ae9 100644 --- a/src/Makefile +++ b/src/Makefile @@ -19,22 +19,28 @@ # Contributors: # Aihua Li, Huawei Technologies. -include mk/master.mk +SUBBUILDS = src_cuse src_vanilla +.PHONY: vhost subbuilds $(SUBBUILDS) -export VHOST_USER +all: vhost subbuilds -# specify upstream package as SUBDIRS - common terms as suggest by gnu-make +subbuilds: $(SUBBUILDS) +$(SUBBUILDS): vhost + $(AT)mkdir -p ../$@/mk + $(AT)cp -rf mk/* ../$@/mk + $(AT)cp -rf package-list.mk ../$@/ + $(AT)cp Makefile.$@ ../$@/Makefile + $(AT)$(MAKE) -C ../$@ + +vhost: +export VHOST_USER +include mk/master.mk SUBDIRS = SUBDIRS += l2fwd -ifeq ($(WITH_LINUX),) SUBDIRS += dpdk -endif SUBDIRS += ovs SUBDIRS += qemu - -ifeq ($(WITH_LINUX),) -# specify package dependency here if needed ovs: dpdk -endif - +WITH_LINUX = +VHOST_USER = y include mk/make-subsys.mk diff --git a/src/Makefile.src_cuse b/src/Makefile.src_cuse new file mode 100644 index 00000000..74e76f4f --- /dev/null +++ b/src/Makefile.src_cuse @@ -0,0 +1,34 @@ +# Top Makefile to build upstream packages. +# + +# Copyright 2015 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# Contributors: +# Aihua Li, Huawei Technologies. + +include mk/master.mk + +export VHOST_USER + +# specify upstream package as SUBDIRS - common terms as suggest by gnu-make +SUBDIRS = +SUBDIRS += dpdk +SUBDIRS += ovs +SUBDIRS += qemu +ovs: dpdk +WITH_LINUX = +VHOST_USER = n +include mk/make-subsys.mk diff --git a/src/Makefile.src_vanilla b/src/Makefile.src_vanilla new file mode 100644 index 00000000..922d5e53 --- /dev/null +++ b/src/Makefile.src_vanilla @@ -0,0 +1,33 @@ +# Top Makefile to build upstream packages. +# + +# Copyright 2015 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# Contributors: +# Aihua Li, Huawei Technologies. + +include mk/master.mk + +export VHOST_USER +export WITH_LINUX + +# specify upstream package as SUBDIRS - common terms as suggest by gnu-make +SUBDIRS = +SUBDIRS += ovs +SUBDIRS += qemu +WITH_LINUX=/lib/modules/`uname -r`/build +VHOST_USER = n +include mk/make-subsys.mk diff --git a/src/dpdk/Makefile b/src/dpdk/Makefile index 71839e26..af743732 100755 --- a/src/dpdk/Makefile +++ b/src/dpdk/Makefile @@ -29,6 +29,8 @@ ifndef VHOST_USER endif WORK_DIR = dpdk TAG_DONE_FLAG = $(WORK_DIR)/.$(DPDK_TAG).tag.done +DPDK_VANILLA = ../../src_vanilla/dpdk +DPDK_CUSE = ../../src_cuse/dpdk # the name has been changed from version to version ifeq ($(DPDK_TAG),v1.6.0r0) @@ -52,6 +54,7 @@ force_make: $(TAG_DONE_FLAG) $(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 - + $(AT)echo "VHOST_USER = $(VHOST_USER)" ifeq ($(VHOST_USER),n) $(AT)cd $(WORK_DIR)/lib/librte_vhost/eventfd_link; make endif @@ -65,6 +68,8 @@ install: $(INSTALL_TARGET) clean: cleanse clobber: $(AT)rm -rf $(WORK_DIR) + $(AT)rm -rf $(DPDK_VANILLA) + $(AT)rm -rf $(DPDK_CUSE) # cleanse is for developer who would like to keep the # clone git repo, saving time to fetch again from url @@ -79,6 +84,10 @@ sanity: $(WORK_DIR): $(AT)git clone $(DPDK_URL) + $(AT)mkdir -p $(DPDK_VANILLA) + $(AT)cp -rf ./* $(DPDK_VANILLA) + $(AT)mkdir -p $(DPDK_CUSE) + $(AT)cp -rf ./* $(DPDK_CUSE) $(TAG_DONE_FLAG): $(WORK_DIR) $(AT)cd $(WORK_DIR); git checkout $(DPDK_TAG) diff --git a/src/ovs/Makefile b/src/ovs/Makefile index 223d2dcb..32a7ab00 100755 --- a/src/ovs/Makefile +++ b/src/ovs/Makefile @@ -26,6 +26,8 @@ WORK_DIR = ovs TAG_DONE_FLAG = $(WORK_DIR)/.$(OVS_TAG).done CONFIG_CMD = CONFIG_CMD += ./configure +OVS_VANILLA = ../../src_vanilla/ovs +OVS_CUSE = ../../src_cuse/ovs # If WITH_LINUX is defined, OVS is built without DPDK but with kernel # module @@ -69,6 +71,7 @@ config $(WORK_DIR)/Makefile: $(WORK_DIR)/configure INSTALL_TARGET = force_install force_make force_make: $(WORK_DIR)/Makefile + $(AT)echo "WITH_LINUX = $(WITH_LINUX)" $(AT)$(MAKE) -C $(WORK_DIR) $(MORE_MAKE_FLAGS) @echo "Make done" @@ -82,6 +85,8 @@ install: $(INSTALL_TARGET) clean: clobber: $(AT)rm -rf $(WORK_DIR) + $(AT)rm -rf $(OVS_VANILLA) + $(AT)rm -rf $(OVS_CUSE) # cleanse is for developer who would like to keep the # clone git repo, saving time to fetch again from url @@ -105,6 +110,10 @@ boot $(WORK_DIR)/configure: $(TAG_DONE_FLAG) $(WORK_DIR): $(AT)git clone $(OVS_URL) + $(AT)mkdir -p $(OVS_VANILLA) + $(AT)cp -rf ./* $(OVS_VANILLA) + $(AT)mkdir -p $(OVS_CUSE) + $(AT)cp -rf ./* $(OVS_CUSE) $(TAG_DONE_FLAG): $(WORK_DIR) $(AT)cd ovs; git checkout $(OVS_TAG) diff --git a/src/qemu/Makefile b/src/qemu/Makefile index 1a736a29..0a71cf78 100755 --- a/src/qemu/Makefile +++ b/src/qemu/Makefile @@ -27,7 +27,8 @@ TAG_DONE_FLAG = $(WORK_DIR)/.$(QEMU_TAG).done CONFIG_CMD = CONFIG_CMD += ./configure CONFIG_CMD += --target-list="x86_64-softmmu" - +QEMU_VANILLA = ../../src_vanilla/qemu +QEMU_CUSE = ../../src_cuse/qemu all: force_make @@ -56,6 +57,8 @@ install: $(INSTALL_TARGET) clean: clobber: $(AT)rm -rf $(WORK_DIR) + $(AT)rm -rf $(QEMU_VANILLA) + $(AT)rm -rf $(QEMU_CUSE) # cleanse is for developer who would like to keep the # clone git repo, saving time to fetch again from url @@ -72,6 +75,10 @@ $(WORK_DIR)/configure: $(TAG_DONE_FLAG) $(WORK_DIR): $(AT)git clone $(QEMU_URL) + $(AT)mkdir -p $(QEMU_VANILLA) + $(AT)cp -rf ./* $(QEMU_VANILLA) + $(AT)mkdir -p $(QEMU_CUSE) + $(AT)cp -rf ./* $(QEMU_CUSE) $(TAG_DONE_FLAG): $(WORK_DIR) $(AT)cd $(WORK_DIR); git checkout $(QEMU_TAG) -- cgit 1.2.3-korg