Requires DPDK 16.11 or greater to support vdev flags.
Initial support for TestPMD to support guests.
Allows vsperf to execute TestPMD as a switch for pvp
test scenarios.
Can be increased in functionality later to support
multiple guest configs.
JIRA: VSPERF-406
Change-Id: I67a5a355c990ca6cfcbb5845a2beaf1c1f21f5f0
Signed-off-by: Christian Trautman <ctrautma@redhat.com>
#
# parameters used for legacy DPDK configuration through '--dpdk' option of ovs-vswitchd
# e.g. ovs-vswitchd --dpdk --socket-mem 1024,0
+# This config line is also used for pkt_fwd option (TestPMD phy2phy and pvp tests)
VSWITCHD_DPDK_ARGS = ['-c', '0x4', '-n', '4', '--socket-mem 1024,0']
# options used for new type of OVS configuration via calls to ovs-vsctl
self._deployment = deployment
self._logger = logging.getLogger(__name__)
self._pktfwd_class = pktfwd_class
- self._pktfwd = pktfwd_class()
+ self._pktfwd = pktfwd_class(guest=True if deployment == "pvp" else False)
self._logger.debug('Creation using ' + str(self._pktfwd_class))
def setup(self):
self._pktfwd.stop()
raise
+ def setup_for_guest(self):
+ """Sets up the packet forwarder for pvp.
+ """
+ self._logger.debug('Setup using ' + str(self._pktfwd_class))
+
+ try:
+ self._pktfwd.start_for_guest()
+ except:
+ self._pktfwd.stop()
+ raise
+
def stop(self):
"""Tears down the packet forwarder created in setup().
"""
def __enter__(self):
if self._deployment.find("p2p") == 0:
self.setup()
+ elif self._deployment == "pvp":
+ self.setup_for_guest()
def __exit__(self, type_, value, traceback):
if self._deployment.find("p2p") == 0:
self.stop()
+ elif self._deployment == "pvp":
+ self.stop()
def get_pktfwd(self):
"""Get the controlled packet forwarder
* Remove support for vhost cuse
* Add Vanilla OVS Multi-queue with non testpmd options
* Add support for Multi-queue with OVS 2.5.0 or less
+* Add TestPMD as a switch option for pvp topology testing with vhostuser
OPNFV Colorado Release
======================
.. code-block:: console
- $ ./vsperf --conf-file user_settings.py \
+ $ ./vsperf phy2phy_cont --conf-file user_settings.py \
--vswitch none \
--fwdapp TestPMD
.. code-block:: console
- $ ./vsperf --conf-file <path_to_settings_py>
+ $ ./vsperf phy2phy_tput --conf-file <path_to_settings_py>
+
+Executing Packet Forwarding tests with one guest
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+TestPMD with DPDK 16.11 or greater can be used to forward packets as a switch to a single guest using TestPMD vdev
+option. To set this configuration the following parameters should be used.
+
+ .. code-block:: python
+
+ VSWITCH = 'none'
+ PKTFWD = 'TestPMD'
+
+or use ``--vswitch`` and ``--fwdapp`` CLI arguments:
+
+ .. code-block:: console
+
+ $ ./vsperf pvp_tput --conf-file user_settings.py \
+ --vswitch none \
+ --fwdapp TestPMD
+
+Guest forwarding application only supports TestPMD in this configuration.
+
+ .. code-block:: python
+
+ GUEST_LOOPBACK = ['testpmd']
+
+For optimal performance one cpu per port +1 should be used for TestPMD. Also set additional params for packet forwarding
+application to use the correct number of nb-cores.
+
+ .. code-block:: python
+
+ VSWITCHD_DPDK_ARGS = ['-l', '46,44,42,40,38', '-n', '4', '--socket-mem 1024,0']
+ TESTPMD_ARGS = ['--nb-cores=4', '--txq=1', '--rxq=1']
+
+For guest TestPMD 3 VCpus should be assigned with the following TestPMD params.
+
+ .. code-block:: python
+
+ GUEST_TESTPMD_PARAMS = ['-l 0,1,2 -n 4 --socket-mem 1024 -- '
+ '--burst=64 -i --txqflags=0xf00 '
+ '--disable-hw-vlan --nb-cores=2 --txq=1 --rxq=1']
+
+Execution of TestPMD can be run with the following command line
+
+ .. code-block:: console
+
+ ./vsperf pvp_tput --vswitch=none --fwdapp=TestPMD --conf-file <path_to_settings_py>
+
+**NOTE:** To achieve the best 0% loss numbers with rfc2544 throughput testing, other tunings should be applied to host
+and guest such as tuned profiles and CPU tunings to prevent possible interrupts to worker threads.
VSPERF modes of operation
^^^^^^^^^^^^^^^^^^^^^^^^^
"""
raise NotImplementedError('Please call an implementation.')
+ def start_for_guest(self):
+ """Start the packet forward for guest config
+
+ :returns: None
+ """
+
def stop(self):
"""Stop the packet forwarder.
_LOGGER = logging.getLogger(__name__)
_VSWITCHD_CONST_ARGS = ['--', '-i']
+_TESTPMD_PVP_CONST_ARGS = ['--vdev', 'net_vhost0,iface=/tmp/dpdkvhostuser0',
+ '--vdev', 'net_vhost1,iface=/tmp/dpdkvhostuser1',]
class TestPMD(IPktFwd):
"""TestPMD implementation (only phy2phy deployment is supported)
_logger = logging.getLogger()
- def __init__(self):
+ def __init__(self, guest=False):
vswitchd_args = settings.getValue('VSWITCHD_DPDK_ARGS')
+ if guest:
+ vswitchd_args += _TESTPMD_PVP_CONST_ARGS
vswitchd_args += _VSWITCHD_CONST_ARGS
vswitchd_args += settings.getValue('TESTPMD_ARGS')
self._testpmd.send('start', 1)
+ def start_for_guest(self):
+ """See IPktFwd for general description
+
+ Activates testpmd for guest config
+ """
+ self._logger.info("Starting TestPMD for one guest...")
+ dpdk.init()
+ self._testpmd.start()
+ self._logger.info("TestPMD...Started.")
+ self._testpmd.send('set portlist 0,2,1,3')
+
+ self._testpmd.send('start', 1)
+
def stop(self):
"""See IPktFwd for general description
ifi = str(index)
net = 'net' + str(index + 1)
+ # In case of testpmd as switch, path to vhost netdev folder will be set
+ # to tmp location instead of default ovs_var_tmp folder.
+ if S.getValue('VSWITCH') == 'none':
+ vhost_folder = '/tmp/'
+ else:
+ vhost_folder = S.getValue('TOOLS')['ovs_var_tmp']
+
self._cmd += ['-chardev',
'socket,id=char' + ifi +
- ',path=' + S.getValue('TOOLS')['ovs_var_tmp'] +
+ ',path=' + vhost_folder +
'dpdkvhostuser' + ifi,
'-netdev',
'type=vhost-user,id=' + net +