The 'make' creates all required variants of vSwitch 07/2207/3
authorRadek Zetik <radekx.zetik@intel.com>
Thu, 1 Oct 2015 17:13:18 +0000 (18:13 +0100)
committerMaryam Tahhan <maryam.tahhan@intel.com>
Wed, 7 Oct 2015 14:52:16 +0000 (14:52 +0000)
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 <radekx.zetik@intel.com>
Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com>
Reviewed-by: Brian Castelli <brian.castelli@spirent.com>
src/Makefile
src/Makefile.src_cuse [new file with mode: 0644]
src/Makefile.src_vanilla [new file with mode: 0644]
src/dpdk/Makefile
src/ovs/Makefile
src/qemu/Makefile

index 0b62da3..81143ae 100644 (file)
 # 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 (file)
index 0000000..74e76f4
--- /dev/null
@@ -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 (file)
index 0000000..922d5e5
--- /dev/null
@@ -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
index 71839e2..af74373 100755 (executable)
@@ -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)
index 223d2dc..32a7ab0 100755 (executable)
@@ -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)
index 1a736a2..0a71cf7 100755 (executable)
@@ -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)