aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2015-07-30 13:43:23 +0100
committerMaryam Tahhan <maryam.tahhan@intel.com>2015-08-05 14:56:27 +0000
commiteaf66887b3a8a80c0e52906d3182f93d52f8e8ba (patch)
tree7b0bd4f8fa517932cbc336324b09e0bc197802a0
parent017df35d6c2a73dbdce22e260a8ca16e6b369a01 (diff)
src/ovs: Add support for building vanilla OVS with kernel module
DPDK build remains the default. JIRA: VSPERF-27 Change-Id: I7282e32d2246eaf75e399c5af87ef0ea53981895 Signed-off-by: Timo Puha <timox.puha@intel.com> Signed-off-by: Martin Klozik <martinx.klozik@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>
-rwxr-xr-xdocs/quickstart.md7
-rw-r--r--src/Makefile4
-rwxr-xr-xsrc/ovs/Makefile26
3 files changed, 29 insertions, 8 deletions
diff --git a/docs/quickstart.md b/docs/quickstart.md
index 9ab15c15..45bca6c5 100755
--- a/docs/quickstart.md
+++ b/docs/quickstart.md
@@ -29,6 +29,13 @@ cd src
make
```
+VSPERF can be used with OVS without DPDK support. In this case you have to specify path to the kernel sources by WITH_LINUX parameter:
+
+```bash
+cd src
+make WITH_LINUX=/lib/modules/`uname -r`/build
+```
+
To delete a src subdirectory and its contents to allow you to re-clone simply use:
```bash
diff --git a/src/Makefile b/src/Makefile
index d16b093d..20e78906 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -26,10 +26,14 @@ export VHOST_USER
# specify upstream package as SUBDIRS - common terms as suggest by gnu-make
SUBDIRS =
SUBDIRS += l2fwd
+ifeq ($(WITH_LINUX),)
SUBDIRS += dpdk
+endif
SUBDIRS += ovs
+ifeq ($(WITH_LINUX),)
# specify package dependency here if needed
ovs: dpdk
+endif
include mk/make-subsys.mk
diff --git a/src/ovs/Makefile b/src/ovs/Makefile
index 68ac0f6d..223d2dcb 100755
--- a/src/ovs/Makefile
+++ b/src/ovs/Makefile
@@ -22,11 +22,26 @@
include ../mk/master.mk
include ../package-list.mk
+WORK_DIR = ovs
+TAG_DONE_FLAG = $(WORK_DIR)/.$(OVS_TAG).done
+CONFIG_CMD =
+CONFIG_CMD += ./configure
+
+# If WITH_LINUX is defined, OVS is built without DPDK but with kernel
+# module
+# By default, OVS is built with DPDK
+
+# WITH_LINUX is the Linux kernel build directory used for building
+# OVS kernel module as documented in OVS --with-linux switch
+ifneq ($(WITH_LINUX),) # Building with Linux kernel
+CONFIG_CMD += --with-linux=$(WITH_LINUX)
+
+else # Building with DPDK
+
# DPDK_DIR is the top directory for dpdk source tree
# it can be passed in from Makefile command
# if it is not set, try to read it in from environment
# if it is still not set, then set it using relative path
-
DPDK_DIR ?= $(shell echo $$DPDK_DIR)
ifeq ($(DPDK_DIR),)
DPDK_DIR = ../../dpdk/dpdk
@@ -35,20 +50,15 @@ endif
ifeq ($(DPDK_TARGET),)
DPDK_TARGET = x86_64-native-linuxapp-gcc
endif
+CONFIG_CMD += --with-dpdk=$(DPDK_DIR)/$(DPDK_TARGET)
+endif # Kernel vs. DPDK
.PHONY: install force_install config force_make
# install depends on make
force_install: force_make
-WORK_DIR = ovs
-TAG_DONE_FLAG = $(WORK_DIR)/.$(OVS_TAG).done
-CONFIG_CMD =
-CONFIG_CMD += ./configure
-CONFIG_CMD += --with-dpdk=$(DPDK_DIR)/$(DPDK_TARGET)
-
-
all: force_make
@echo "Finished making $(WORK_DIR) "