diff options
author | Martin Klozik <martinx.klozik@intel.com> | 2017-04-21 09:57:56 +0100 |
---|---|---|
committer | Martin Klozik <martinx.klozik@intel.com> | 2017-05-03 14:35:20 +0100 |
commit | b878f491b6590678210aa94ed49327d192148144 (patch) | |
tree | b56374b99430f9ce3086cf4624aa3a77c055c052 /vswitches/vpp_dpdk_vhost.py | |
parent | 59aae8c0539ca9632d9ffdcb2788ab715fbff9ec (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>
Diffstat (limited to 'vswitches/vpp_dpdk_vhost.py')
-rw-r--r-- | vswitches/vpp_dpdk_vhost.py | 36 |
1 files changed, 34 insertions, 2 deletions
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. """ |