aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2017-04-21 09:57:56 +0100
committerMartin Klozik <martinx.klozik@intel.com>2017-05-03 14:35:20 +0100
commitb878f491b6590678210aa94ed49327d192148144 (patch)
treeb56374b99430f9ce3086cf4624aa3a77c055c052
parent59aae8c0539ca9632d9ffdcb2788ab715fbff9ec (diff)
build: Automated VPP build
VSPERF makefiles were updated to automatically download and compile VPP. VPP will not be installed into the OS, but it will be executed from VSPERF's src subdirectory. Thus underlying OS is not affected by VPP build required by VSPERF. It also allows quick switch among different versions of various tools used by VSPERF. As part of this patch, VERIFY and MERGE CI jobs were updated to build VPP and test it with basic set of integration tests. JIRA: VSPERF-493 Change-Id: I958b9031c4fefc87c4c63a471d2ba1a0db1eaaa4 Signed-off-by: Martin Klozik <martinx.klozik@intel.com> Reviewed-by: Al Morton <acmorton@att.com> Reviewed-by: Christian Trautman <ctrautma@redhat.com> Reviewed-by: Sridhar Rao <sridhar.rao@spirent.com> Reviewed-by: Trevor Cooper <trevor.cooper@intel.com>
-rwxr-xr-xci/build-vsperf.sh42
-rw-r--r--conf/02_vswitch.conf10
-rw-r--r--conf/integration/01_testcases.conf22
-rw-r--r--docs/testing/user/userguide/testusage.rst4
-rw-r--r--src/Makefile1
-rw-r--r--src/package-list.mk4
-rw-r--r--src/vpp/Makefile76
-rw-r--r--vswitches/vpp_dpdk_vhost.py36
8 files changed, 183 insertions, 12 deletions
diff --git a/ci/build-vsperf.sh b/ci/build-vsperf.sh
index b4a0f24b..7a16014d 100755
--- a/ci/build-vsperf.sh
+++ b/ci/build-vsperf.sh
@@ -45,9 +45,13 @@ VSPERFENV_DIR="$HOME/vsperfenv"
# VERIFY - run basic set of TCs with default settings
TESTCASES_VERIFY="vswitch_add_del_bridge vswitch_add_del_bridges vswitch_add_del_vport vswitch_add_del_vports vswitch_vports_add_del_flow"
TESTPARAM_VERIFY="--integration"
+TESTCASES_VERIFY_VPP="vswitch_add_del_bridge vswitch_add_del_bridges vswitch_add_del_vport vswitch_add_del_vports vswitch_vports_add_del_connection_vpp"
+TESTPARAM_VERIFY_VPP=$TESTPARAM_VERIFY
# MERGE - run selected TCs with default settings
-TESTCASES_MERGE="vswitch_add_del_bridge vswitch_add_del_bridges vswitch_add_del_vport vswitch_add_del_vports vswitch_vports_add_del_flow"
-TESTPARAM_MERGE="--integration"
+TESTCASES_MERGE=$TESTCASES_VERIFY
+TESTPARAM_MERGE=$TESTPARAM_VERIFY
+TESTCASES_MERGE_VPP=$TESTCASES_VERIFY_VPP
+TESTPARAM_MERGE_VPP=$TESTPARAM_VERIFY_VPP
# DAILY - run selected TCs for defined packet sizes
TESTCASES_DAILY='phy2phy_tput back2back phy2phy_tput_mod_vlan phy2phy_scalability pvp_tput pvp_back2back pvvp_tput pvvp_back2back'
TESTPARAM_DAILY='--test-params TRAFFICGEN_PKT_SIZES=(64,128,512,1024,1518)'
@@ -145,12 +149,22 @@ function execute_vsperf() {
# figure out list of TCs and execution parameters
case $2 in
"verify")
- TESTPARAM=$TESTPARAM_VERIFY
- TESTCASES=$TESTCASES_VERIFY
+ if [ "$1" == "VPP" ] ; then
+ TESTPARAM=$TESTPARAM_VERIFY_VPP
+ TESTCASES=$TESTCASES_VERIFY_VPP
+ else
+ TESTPARAM=$TESTPARAM_VERIFY
+ TESTCASES=$TESTCASES_VERIFY
+ fi
;;
"merge")
- TESTPARAM=$TESTPARAM_MERGE
- TESTCASES=$TESTCASES_MERGE
+ if [ "$1" == "VPP" ] ; then
+ TESTPARAM=$TESTPARAM_MERGE_VPP
+ TESTCASES=$TESTCASES_MERGE_VPP
+ else
+ TESTPARAM=$TESTPARAM_MERGE
+ TESTCASES=$TESTCASES_MERGE
+ fi
;;
*)
# by default use daily build and upload results to the OPNFV databse
@@ -177,6 +191,16 @@ function execute_vsperf() {
echo " $VSPERF_BIN --vswitch none --vnf QemuPciPassthrough $CONF_FILE_SRIOV $TESTPARAM $TESTCASES &> $LOG_FILE"
$VSPERF_BIN --vswitch none --vnf QemuPciPassthrough $CONF_FILE_SRIOV $TESTPARAM $TESTCASES &> $LOG_FILE
;;
+ "VPP")
+ # figure out log file name
+ LOG_SUBDIR="VppDpdkVhost"
+ LOG_FILE="${LOG_FILE_PREFIX}_${LOG_SUBDIR}_${DATE_SUFFIX}.log"
+
+ hugepages_info > $LOG_FILE
+ echo " $VSPERF_BIN $OPNFVPOD --vswitch VppDpdkVhost --vnf QemuDpdkVhostUser $CONF_FILE $TESTPARAM $TESTCASES > $LOG_FILE"
+ $VSPERF_BIN $OPNFVPOD --vswitch VppDpdkVhost --vnf QemuDpdkVhostUser $CONF_FILE $TESTPARAM $TESTCASES &>> $LOG_FILE
+ hugepages_info >> $LOG_FILE
+ ;;
"OVS_vanilla")
# figure out log file name
LOG_SUBDIR="OvsVanilla"
@@ -430,6 +454,9 @@ case $1 in
execute_vsperf OVS_with_DPDK_and_vHost_User $1
terminate_vsperf
execute_vsperf OVS_vanilla $1
+ terminate_vsperf
+ execute_vsperf VPP $1
+ terminate_vsperf
exit $EXIT
;;
@@ -445,6 +472,9 @@ case $1 in
execute_vsperf OVS_with_DPDK_and_vHost_User $1
terminate_vsperf
execute_vsperf OVS_vanilla $1
+ terminate_vsperf
+ execute_vsperf VPP $1
+ terminate_vsperf
exit $EXIT
;;
diff --git a/conf/02_vswitch.conf b/conf/02_vswitch.conf
index 60ec7fb9..54ae6fa7 100644
--- a/conf/02_vswitch.conf
+++ b/conf/02_vswitch.conf
@@ -110,15 +110,17 @@ PATHS['vswitch'] = {
'ovs_var_tmp': '/usr/local/var/run/openvswitch/',
'ovs_etc_tmp': '/usr/local/etc/openvswitch/',
'VppDpdkVhost': {
- 'type' : 'bin',
+ 'type' : 'src',
'src': {
- 'path': os.path.join(ROOT_DIR, 'src/vpp/vpp/build-root/build-vpp-native'),
- 'vpp': 'vpp',
- 'vppctl': 'vppctl',
+ 'path': os.path.join(ROOT_DIR, 'src/vpp/vpp/build-root/install-vpp-native/vpp'),
+ 'vpp': 'bin/vpp',
+ 'vppctl': 'bin/vppctl',
+ 'vpp_plugin_path' : 'lib64/vpp_plugins',
},
'bin': {
'vpp': 'vpp',
'vppctl': 'vppctl',
+ 'vpp_plugin_path' : '/usr/lib/vpp_plugins',
}
},
}
diff --git a/conf/integration/01_testcases.conf b/conf/integration/01_testcases.conf
index 489c7a57..61766e33 100644
--- a/conf/integration/01_testcases.conf
+++ b/conf/integration/01_testcases.conf
@@ -976,6 +976,28 @@ INTEGRATION_TESTS = [
['vswitch', 'del_switch', 'int_br0'],
]
},
+ #
+ # VPP tests used by VERIFY and MERGE jobs by OPNFV Jenkins
+ #
+ {
+ "Name": "vswitch_vports_add_del_connection_vpp",
+ "Deployment": "clean",
+ "Description": "VPP: vSwitch - configure switch with vports, add and delete connection",
+ "TestSteps": [
+ ['vswitch', 'add_switch', 'int_br0'],
+ ['vswitch', 'add_vport', 'int_br0'],
+ ['vswitch', 'add_vport', 'int_br0'],
+ ['vswitch', 'add_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]', True],
+ ['vswitch', 'dump_connections', 'int_br0'],
+ ['vswitch', 'del_connection', 'int_br0', '#STEP[1][0]', '#STEP[2][0]', True],
+ ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
+ ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
+ ['vswitch', 'del_switch', 'int_br0'],
+ ]
+ },
+ #
+ # END of VPP tests used by VERIFY and MERGE jobs by OPNFV Jenkins
+ #
]
# Example of TC definition with exact vSwitch, VNF and TRAFFICGEN values.
diff --git a/docs/testing/user/userguide/testusage.rst b/docs/testing/user/userguide/testusage.rst
index 03068911..043ef928 100644
--- a/docs/testing/user/userguide/testusage.rst
+++ b/docs/testing/user/userguide/testusage.rst
@@ -393,6 +393,10 @@ set ``PATHS['dpdk']['bin']['modules']`` instead.
**NOTE:** Please ensure your boot/grub parameters include
the following:
+**NOTE:** In case of VPP, it is required to explicitly define, that vfio-pci
+DPDK driver should be used. It means to update dpdk part of VSWITCH_VPP_ARGS
+dictionary with uio-driver section, e.g. VSWITCH_VPP_ARGS['dpdk'] = 'uio-driver vfio-pci'
+
.. code-block:: console
iommu=pt intel_iommu=on
diff --git a/src/Makefile b/src/Makefile
index fbc2e711..6cd21dd6 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -40,6 +40,7 @@ SUBDIRS += l2fwd
SUBDIRS += dpdk
SUBDIRS += ovs
SUBDIRS += qemu
+SUBDIRS += vpp
ovs: dpdk
WITH_LINUX =
VHOST_USER = y
diff --git a/src/package-list.mk b/src/package-list.mk
index 9334cd8e..a8188f50 100644
--- a/src/package-list.mk
+++ b/src/package-list.mk
@@ -19,6 +19,10 @@ DPDK_TAG ?= v16.07
OVS_URL ?= https://github.com/openvswitch/ovs
OVS_TAG ?= ed26e3ea9995ba632e681d5990af5ee9814f650e
+# VPP section
+VPP_URL ?= https://git.fd.io/vpp
+VPP_TAG ?= v17.04
+
# QEMU section
QEMU_URL ?= https://github.com/qemu/qemu.git
QEMU_TAG ?= v2.5.0
diff --git a/src/vpp/Makefile b/src/vpp/Makefile
new file mode 100644
index 00000000..de50d941
--- /dev/null
+++ b/src/vpp/Makefile
@@ -0,0 +1,76 @@
+# makefile to manage VPP package
+#
+
+# Copyright 2017 Intel Corporation.
+#
+# 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.
+
+include ../mk/master.mk
+include ../package-list.mk
+
+WORK_DIR = vpp
+TAG_DONE_FLAG = $(WORK_DIR)/.$(VPP_TAG).done
+
+.PHONY: install force_install force_make
+
+all: force_make
+ @echo "Finished making $(WORK_DIR) "
+
+config $(WORK_DIR)/Makefile: $(WORK_DIR)/configure
+ $(AT)cd $(WORK_DIR); $(CONFIG_CMD)
+ @echo "Configure done"
+
+force_make: $(WORK_DIR)/Makefile
+ $(AT)cd $(WORK_DIR) && git pull $(VPP_URL) $(VPP_TAG)
+ @echo "git pull done"
+ # install vpp dependecies, currently it works for RHEL, CentOS and Ubuntu
+ # another option is to copy all required VPP dependencies into VSPERF
+ # installation files and keep them updated
+ $(AT)$(MAKE) -C $(WORK_DIR) UNATTENDED=y install-dep
+ $(AT)$(MAKE) -C $(WORK_DIR) build-release $(MORE_MAKE_FLAGS)
+ # vppctl expects that vpp_api_test is installed in system directories
+ # in order to execute vppctl from src/ subtree we have to use absolute path
+ $(AT)sed -i -e 's|vpp_api_test|$(CURDIR)/$(WORK_DIR)/build-root/install-vpp-native/vpp/bin/vpp_api_test|g' $(WORK_DIR)/build-root/install-vpp-native/vpp/bin/vppctl
+ @echo "Make done"
+
+install:
+ @echo "Make install in $(WORK_DIR) (stub) "
+
+# hard way to clean and clobber
+clean:
+ $(AT)cd $(WORK_DIR) && git clean -xfd *.o
+clobber:
+ $(AT)rm -rf $(WORK_DIR)
+
+# distclean is for developer who would like to keep the
+# clone git repo, saving time to fetch again from url
+distclean:
+ $(AT)cd $(WORK_DIR) && git clean -xfd && git checkout -f
+
+test:
+ @echo "Make test in $(WORK_DIR) (stub) "
+
+sanity:
+ @echo "Make sanity in $(WORK_DIR) (stub) "
+
+$(WORK_DIR)/configure: $(TAG_DONE_FLAG)
+
+$(WORK_DIR):
+ $(AT)git clone $(VPP_URL)
+
+$(TAG_DONE_FLAG): $(WORK_DIR)
+ $(AT)cd vpp; git checkout $(VPP_TAG)
+ifneq ($(PATCH_FILE),)
+ $(AT)cd $(WORK_DIR); patch -p1 < ../$(PATCH_FILE)
+endif
+ $(AT)touch $@
diff --git a/vswitches/vpp_dpdk_vhost.py b/vswitches/vpp_dpdk_vhost.py
index 68375538..42f1cdf1 100644
--- a/vswitches/vpp_dpdk_vhost.py
+++ b/vswitches/vpp_dpdk_vhost.py
@@ -63,6 +63,14 @@ class VppDpdkVhost(IVSwitch, tasks.Process):
tmp_args['dpdk'].append('socket-mem ' +
','.join(S.getValue('DPDK_SOCKET_MEM')))
+ # create directory for vhostuser sockets if needed
+ if not os.path.exists(S.getValue('TOOLS')['ovs_var_tmp']):
+ tasks.run_task(['sudo', 'mkdir', '-p',
+ S.getValue('TOOLS')['ovs_var_tmp']], self._logger)
+
+ # configure path to the plugins
+ tmp_args['plugin_path'] = S.getValue('TOOLS')['vpp_plugin_path']
+
for nic in S.getValue('NICS'):
tmp_args['dpdk'].append("dev {}".format(nic['pci']))
self._vswitch_args = self._process_vpp_args(tmp_args)
@@ -84,6 +92,8 @@ class VppDpdkVhost(IVSwitch, tasks.Process):
keyidx = keys.index(key)
for iface in ifaces[1:]:
tmpif = iface.split()
+ if not tmpif:
+ continue
# get PCI address of given interface
output = self.run_vppctl(['show', 'hardware', tmpif[1], 'detail'])
match = re.search(r'pci address:\s*([\d:\.]+)', output[0])
@@ -106,7 +116,10 @@ class VppDpdkVhost(IVSwitch, tasks.Process):
cli_args = []
for cfg_key in args:
cli_args.append(cfg_key)
- cli_args.append("{{ {} }}".format(' '.join(args[cfg_key])))
+ if isinstance(args[cfg_key], str):
+ cli_args.append(args[cfg_key])
+ else:
+ cli_args.append("{{ {} }}".format(' '.join(args[cfg_key])))
self._logger.debug("VPP CLI args: %s", cli_args)
return cli_args
@@ -214,7 +227,9 @@ class VppDpdkVhost(IVSwitch, tasks.Process):
socket_name = S.getValue('TOOLS')['ovs_var_tmp'] + 'dpdkvhostuser' + str(len(self._virt_ports))
output = self.run_vppctl(['create', 'vhost-user', 'socket', socket_name, 'server'] +
S.getValue('VSWITCH_VPP_VHOSTUSER_ARGS'))
- nic_name = output[0]
+ if output[0].find('returned') >= 0:
+ raise RuntimeError('VPP VhostUser interface cannot be created.')
+ nic_name = output[0].strip()
self._virt_ports.append(nic_name)
self.run_vppctl(['set', 'int', 'state', nic_name, 'up'])
return (nic_name, None)
@@ -377,6 +392,23 @@ class VppDpdkVhost(IVSwitch, tasks.Process):
return not (port_name in self._phy_ports or port_name in self._virt_ports)
# pylint: disable=no-self-use
+ def validate_add_connection(self, dummy_result, dummy_switch_name, dummy_port1,
+ dummy_port2, dummy_bidir=False):
+ """ Validate that connection was added
+ """
+ return True
+
+ def validate_del_connection(self, dummy_result, dummy_switch_name, dummy_port1,
+ dummy_port2, dummy_bidir=False):
+ """ Validate that connection was deleted
+ """
+ return True
+
+ def validate_dump_connections(self, dummy_result, dummy_switch_name):
+ """ Validate dump connections call
+ """
+ return True
+
def validate_run_vppctl(self, result, dummy_args, dummy_check_error=False):
"""validate execution of ``vppctl`` with supplied arguments.
"""