diff options
author | Martin Klozik <martinx.klozik@intel.com> | 2017-07-20 15:49:16 +0100 |
---|---|---|
committer | Martin Klozik <martinx.klozik@intel.com> | 2017-07-21 08:32:30 +0100 |
commit | 01455386f7186721ffd7578d95a84580a5ff7087 (patch) | |
tree | 35ad64b8c83c9a81f5acb53ce812ef914ac635f1 /vswitches | |
parent | d3b124a22bf3aa2c05a5cb030f37b97db3d27dbd (diff) |
dpdk: Support dpdk vhost-user client mode
Support of vhost-user client mode has been added for both
OVS and VPP. VSPERF configures vhost-user server mode
in vswitches by default for backward compatibility.
Support of vhost-user server mode is deprecated
in OVS and it can be removed in future releases. Once it will
happen, we have to change vsperf default behavior to
usage of vhost-user client ports at vswitch side.
This patch also fixes processing of boolean configuration
parameters passed via --test-params option. In the past
it was not possible to set boolean value to False through
--test-params option.
JIRA: VSPERF-517
Change-Id: I65e341f820edd6c720043a4acc74c5140b05db18
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')
-rw-r--r-- | vswitches/ovs_dpdk_vhost.py | 13 | ||||
-rw-r--r-- | vswitches/vpp_dpdk_vhost.py | 6 |
2 files changed, 16 insertions, 3 deletions
diff --git a/vswitches/ovs_dpdk_vhost.py b/vswitches/ovs_dpdk_vhost.py index 13aef173..3b20be35 100644 --- a/vswitches/ovs_dpdk_vhost.py +++ b/vswitches/ovs_dpdk_vhost.py @@ -142,9 +142,18 @@ class OvsDpdkVhost(IVSwitchOvs): from 0 """ bridge = self._bridges[switch_name] - vhost_count = self._get_port_count('type=dpdkvhostuser') + + if S.getValue('VSWITCH_VHOSTUSER_SERVER_MODE'): + nic_type = 'dpdkvhostuser' + else: + nic_type = 'dpdkvhostuserclient' + + vhost_count = self._get_port_count('type={}'.format(nic_type)) port_name = 'dpdkvhostuser' + str(vhost_count) - params = ['--', 'set', 'Interface', port_name, 'type=dpdkvhostuser'] + params = ['--', 'set', 'Interface', port_name, 'type={}'.format(nic_type)] + if not S.getValue('VSWITCH_VHOSTUSER_SERVER_MODE'): + params += ['--', 'set', 'Interface', port_name, 'options:vhost-server-path=' + '{}{}'.format(S.getValue('TOOLS')['ovs_var_tmp'], port_name)] if S.getValue('VSWITCH_JUMBO_FRAMES_ENABLED'): params += ['mtu_request={}'.format( S.getValue('VSWITCH_JUMBO_FRAMES_SIZE'))] diff --git a/vswitches/vpp_dpdk_vhost.py b/vswitches/vpp_dpdk_vhost.py index 42f1cdf1..317f3798 100644 --- a/vswitches/vpp_dpdk_vhost.py +++ b/vswitches/vpp_dpdk_vhost.py @@ -225,7 +225,11 @@ class VppDpdkVhost(IVSwitch, tasks.Process): """See IVswitch for general description """ 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'] + + if S.getValue('VSWITCH_VHOSTUSER_SERVER_MODE'): + mode = ['server'] + else: + mode = [] + output = self.run_vppctl(['create', 'vhost-user', 'socket', socket_name] + mode + S.getValue('VSWITCH_VPP_VHOSTUSER_ARGS')) if output[0].find('returned') >= 0: raise RuntimeError('VPP VhostUser interface cannot be created.') |