CSIT-989 Fix: Reflect latest memif API changes 13/11013/9
authorPeter Mikus <pmikus@cisco.com>
Wed, 7 Mar 2018 14:06:47 +0000 (15:06 +0100)
committerPeter Mikus <pmikus@cisco.com>
Thu, 8 Mar 2018 10:42:57 +0000 (10:42 +0000)
Change-Id: I0c9cb073a42a8b4b7e573023e784ab9e72d0ad55
Signed-off-by: Peter Mikus <pmikus@cisco.com>
13 files changed:
bootstrap-verify-perf.sh
resources/libraries/python/ContainerUtils.py
resources/libraries/python/LXCUtils.py [deleted file]
resources/libraries/python/Memif.py
resources/libraries/robot/performance/performance_configuration.robot
resources/libraries/robot/shared/container.robot
resources/libraries/robot/shared/memif.robot
resources/templates/vat/memif_create_cnt.vat [new file with mode: 0644]
resources/templates/vat/memif_create_lxc.vat [deleted file]
resources/templates/vat/memif_socket_filename_add_del.vat [new file with mode: 0644]
tests/vpp/perf/container_memif/10ge2p1x520-eth-l2bdbasemaclrn-eth-2memif-1lxc-mrr.robot [new file with mode: 0644]
tests/vpp/perf/container_memif/10ge2p1x520-eth-l2xcbase-eth-2memif-1dcr-mrr.robot [new file with mode: 0644]
tests/vpp/perf/container_memif/10ge2p1x520-eth-l2xcbase-eth-2memif-1lxc-mrr.robot [new file with mode: 0644]

index 8dedb53..377f89c 100755 (executable)
@@ -299,6 +299,8 @@ case "$TEST_TAG" in
               -s "tests.vpp.perf" \
               --include pdrdiscANDnic_intel-x520-da2AND1t1cANDmemif \
               --include pdrdiscANDnic_intel-x520-da2AND2t2cANDmemif \
               -s "tests.vpp.perf" \
               --include pdrdiscANDnic_intel-x520-da2AND1t1cANDmemif \
               --include pdrdiscANDnic_intel-x520-da2AND2t2cANDmemif \
+              --include mrrANDnic_intel-x520-da2AND1t1cANDmemif \
+              --include mrrANDnic_intel-x520-da2AND2t2cANDmemif \
               tests/
         RETURN_STATUS=$(echo $?)
         ;;
               tests/
         RETURN_STATUS=$(echo $?)
         ;;
index ed058b7..aafc3eb 100644 (file)
@@ -166,18 +166,23 @@ class ContainerManager(object):
         dut_cnt = len(Counter([self.containers[container].node['host']
                                for container in self.containers]))
         container_cnt = len(self.containers)
         dut_cnt = len(Counter([self.containers[container].node['host']
                                for container in self.containers]))
         container_cnt = len(self.containers)
-        mod = dut_cnt/container_cnt
+        mod = container_cnt/dut_cnt
 
         for i, container in enumerate(self.containers):
 
         for i, container in enumerate(self.containers):
+            mid1 = i % mod + 1
+            mid2 = i % mod + 1
+            sid1 = i % mod * 2 + 1
+            sid2 = i % mod * 2 + 2
             self.engine.container = self.containers[container]
             self.engine.create_vpp_startup_config()
             self.engine.container = self.containers[container]
             self.engine.create_vpp_startup_config()
-            self.engine.create_vpp_exec_config(vat_template_file,
-                                               memif_id1=i % mod * 2 + 1,
-                                               memif_id2=i % mod * 2 + 2,
-                                               socket1='memif-{c.name}-1'
-                                               .format(c=self.engine.container),
-                                               socket2='memif-{c.name}-2'
-                                               .format(c=self.engine.container))
+            self.engine.create_vpp_exec_config(vat_template_file, mid1=mid1,
+                                               mid2=mid2, sid1=sid1, sid2=sid2,
+                                               socket1='memif-{c.name}-{sid}'
+                                               .format(c=self.engine.container,
+                                                       sid=sid1),
+                                               socket2='memif-{c.name}-{sid}'
+                                               .format(c=self.engine.container,
+                                                       sid=sid2))
 
     def stop_all_containers(self):
         """Stop all containers."""
 
     def stop_all_containers(self):
         """Stop all containers."""
@@ -286,6 +291,7 @@ class ContainerEngine(object):
                          'do dpkg -i --force-all {0}/install_dir/$i; done'
                          .format(self.container.guest_dir))
         self.execute('apt-get -f install -y')
                          'do dpkg -i --force-all {0}/install_dir/$i; done'
                          .format(self.container.guest_dir))
         self.execute('apt-get -f install -y')
+        self.execute('apt-get install -y ca-certificates')
         self.execute('echo "{0}" >> {1}'
                      .format(
                          '[program:vpp]\n'
         self.execute('echo "{0}" >> {1}'
                      .format(
                          '[program:vpp]\n'
diff --git a/resources/libraries/python/LXCUtils.py b/resources/libraries/python/LXCUtils.py
deleted file mode 100644 (file)
index 57ced6b..0000000
+++ /dev/null
@@ -1,424 +0,0 @@
-# Copyright (c) 2017 Cisco and/or its affiliates.
-# 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.
-
-"""Library to manipulate LXC."""
-
-from resources.libraries.python.ssh import SSH
-from resources.libraries.python.constants import Constants
-from resources.libraries.python.topology import NodeType
-
-
-__all__ = ["LXCUtils"]
-
-class LXCUtils(object):
-    """LXC utilities."""
-
-    def __init__(self, container_name='slave'):
-        # LXC container name
-        self._container_name = container_name
-        self._node = None
-        # Host hugepages dir that will be mounted inside LXC
-        self._host_hugepages_dir = '/dev/hugepages'
-        # Host dir that will be mounted inside LXC
-        self._host_dir = '/tmp/'
-        # Guest dir to mount host dir to
-        self._guest_dir = '/mnt/host'
-        # LXC container env variables
-        self._env_vars = ['LC_ALL="en_US.UTF-8"',
-                          'DEBIAN_FRONTEND=noninteractive']
-
-    def set_node(self, node):
-        """Set node for LXC execution.
-
-        :param node: Node to execute LXC on.
-        :type node: dict
-        :raises RuntimeError: If Node type is not DUT.
-        """
-        if node['type'] != NodeType.DUT:
-            raise RuntimeError('Node type is not DUT.')
-        self._node = node
-
-    def set_host_dir(self, node, host_dir):
-        """Set shared dir on parent node for LXC.
-
-        :param node: Node to control LXC on.
-        :type node: dict
-        :raises RuntimeError: If Node type is not DUT.
-        """
-        if node['type'] != NodeType.DUT:
-            raise RuntimeError('Node type is not DUT.')
-        self._host_dir = host_dir
-
-    def set_guest_dir(self, node, guest_dir):
-        """Set mount dir on LXC.
-
-        :param node: Node to control LXC on.
-        :param guest_dir: Guest dir for mount.
-        :type node: dict
-        :type guest_dir: str
-        :raises RuntimeError: If Node type is not DUT.
-        """
-        if node['type'] != NodeType.DUT:
-            raise RuntimeError('Node type is not DUT.')
-        self._guest_dir = guest_dir
-
-    def _lxc_checkconfig(self):
-        """Check the current kernel for LXC support.
-
-        :raises RuntimeError: If failed to check LXC support.
-        """
-
-        ssh = SSH()
-        ssh.connect(self._node)
-
-        ret, _, _ = ssh.exec_command_sudo('lxc-checkconfig')
-        if int(ret) != 0:
-            raise RuntimeError('Failed to check LXC support.')
-
-    def _lxc_create(self, distro='ubuntu', release='xenial', arch='amd64'):
-        """Creates a privileged system object where is stored the configuration
-        information and where can be stored user information.
-
-        :param distro: Linux distribution name.
-        :param release: Linux distribution release.
-        :param arch: Linux distribution architecture.
-        :type distro: str
-        :type release: str
-        :type arch: str
-        :raises RuntimeError: If failed to create a container.
-        """
-
-        ssh = SSH()
-        ssh.connect(self._node)
-
-        ret, _, _ = ssh.exec_command_sudo(
-            'lxc-create -t download --name {0} -- -d {1} -r {2} -a {3}'\
-            ' --no-validate'.format(self._container_name, distro, release,
-                                    arch), timeout=1800)
-        if int(ret) != 0:
-            raise RuntimeError('Failed to create LXC container.')
-
-    def _lxc_info(self):
-        """Queries and shows information about a container.
-
-        :raises RuntimeError: If failed to get info about a container.
-        """
-
-        ssh = SSH()
-        ssh.connect(self._node)
-
-        ret, _, _ = ssh.exec_command_sudo(
-            'lxc-info --name {0}'.format(self._container_name))
-        if int(ret) != 0:
-            raise RuntimeError('Failed to get info about LXC container {0}.'
-                               .format(self._container_name))
-
-    def _lxc_start(self):
-        """Start an application inside a container.
-
-        :raises RuntimeError: If failed to start container.
-        """
-
-        ssh = SSH()
-        ssh.connect(self._node)
-
-        ret, _, _ = ssh.exec_command_sudo(
-            'lxc-start --name {0} --daemon'.format(self._container_name))
-        if int(ret) != 0:
-            raise RuntimeError('Failed to start LXC container {0}.'
-                               .format(self._container_name))
-
-    def _lxc_stop(self):
-        """Stop an application inside a container.
-
-        :raises RuntimeError: If failed to stop container.
-        """
-
-        ssh = SSH()
-        ssh.connect(self._node)
-
-        ret, _, _ = ssh.exec_command_sudo(
-            'lxc-stop --name {0}'.format(self._container_name))
-        if int(ret) != 0:
-            raise RuntimeError('Failed to stop LXC container {}.'
-                               .format(self._container_name))
-
-    def _lxc_destroy(self):
-        """Destroy a container.
-
-        :raises RuntimeError: If failed to destroy container.
-        """
-
-        ssh = SSH()
-        ssh.connect(self._node)
-
-        ret, _, _ = ssh.exec_command_sudo(
-            'lxc-destroy --force --name {0}'.format(self._container_name))
-        if int(ret) != 0:
-            raise RuntimeError('Failed to destroy LXC container {}.'
-                               .format(self._container_name))
-
-    def _lxc_wait(self, state):
-        """Wait for a specific container state.
-
-        :param state: Specify the container state(s) to wait for.
-        :type state: str
-        :raises RuntimeError: If failed to wait for state of a container.
-        """
-
-        ssh = SSH()
-        ssh.connect(self._node)
-
-        ret, _, _ = ssh.exec_command_sudo(
-            'lxc-wait --name {0} --state "{1}"'
-            .format(self._container_name, state))
-        if int(ret) != 0:
-            raise RuntimeError('Failed to wait for "{0}" of LXC container {1}.'
-                               .format(state, self._container_name))
-
-    def _lxc_cgroup(self, state_object, value=''):
-        """Manage the control group associated with a container.
-
-        :param state_object: Specify the state object name.
-        :param value: Specify the value to assign to the state object. If empty,
-        then action is GET, otherwise is action SET.
-        :type state_object: str
-        :type value: str
-        :raises RuntimeError: If failed to get/set for state of a container.
-        """
-
-        ssh = SSH()
-        ssh.connect(self._node)
-
-        ret, _, _ = ssh.exec_command_sudo(
-            'lxc-cgroup --name {0} {1} {2}'
-            .format(self._container_name, state_object, value))
-        if int(ret) != 0:
-            if value:
-                raise RuntimeError('Failed to set {0} of LXC container {1}.'
-                                   .format(state_object, self._container_name))
-            else:
-                raise RuntimeError('Failed to get {0} of LXC container {1}.'
-                                   .format(state_object, self._container_name))
-
-    def lxc_attach(self, command):
-        """Start a process inside a running container. Runs the specified
-        command inside the container specified by name. The container has to
-        be running already.
-
-        :param command: Command to run inside container.
-        :type command: str
-        :raises RuntimeError: If container is not running.
-        :raises RuntimeError: If failed to run the command.
-        """
-        env_var = '--keep-env {0}'\
-            .format(' '.join('--set-var %s' % var for var in self._env_vars))
-
-        ssh = SSH()
-        ssh.connect(self._node)
-
-        if not self.is_container_running():
-            raise RuntimeError('LXC {0} is not running.'
-                               .format(self._container_name))
-
-        ret, _, _ = ssh.exec_command_lxc(lxc_cmd=command,
-                                         lxc_name=self._container_name,
-                                         lxc_params=env_var, timeout=180)
-        if int(ret) != 0:
-            raise RuntimeError('Failed to run "{0}" on LXC container {1}.'
-                               .format(command, self._container_name))
-
-    def is_container_present(self):
-        """Check if LXC container is existing on node."""
-
-        ssh = SSH()
-        ssh.connect(self._node)
-
-        ret, _, _ = ssh.exec_command_sudo(
-            'lxc-info --name {0}'.format(self._container_name))
-        return False if int(ret) else True
-
-    def create_container(self, force_create=True):
-        """Create and start a container.
-
-        :param force_create: Destroy a container if exists and create.
-        :type force_create: bool
-        """
-        if self.is_container_present():
-            if force_create:
-                self.destroy_container()
-            else:
-                return
-
-        self._lxc_checkconfig()
-        self._lxc_create(distro='ubuntu', release='xenial', arch='amd64')
-        self.start_container()
-
-    def start_container(self):
-        """Start a container and wait for running state."""
-
-        self._lxc_start()
-        self._lxc_wait('RUNNING')
-        self._lxc_info()
-
-    def is_container_running(self):
-        """Check if LXC container is running on node.
-
-        :raises RuntimeError: If failed to get info about a container.
-        """
-
-        ssh = SSH()
-        ssh.connect(self._node)
-
-        ret, stdout, _ = ssh.exec_command_sudo(
-            'lxc-info --state --name {0}'.format(self._container_name))
-        if int(ret) != 0:
-            raise RuntimeError('Failed to get info about LXC container {0}.'
-                               .format(self._container_name))
-
-        return True if 'RUNNING' in stdout else False
-
-    def stop_container(self):
-        """Stop a container and wait for stopped state."""
-
-        self._lxc_stop()
-        self._lxc_wait('STOPPED|FROZEN')
-        self._lxc_info()
-
-    def restart_container(self):
-        """Restart container."""
-
-        self.stop_container()
-        self.start_container()
-
-    def destroy_container(self):
-        """Stop and destroy a container."""
-
-        self._lxc_destroy()
-
-    def container_cpuset_cpus(self, container_cpu):
-        """Set cpuset.cpus control group associated with a container.
-
-        :param container_cpu: Cpuset.cpus string.
-        :type container_cpu: str
-        :raises RuntimeError: If failed to set cgroup for a container.
-        """
-
-        ssh = SSH()
-        ssh.connect(self._node)
-
-        ret, _, _ = ssh.exec_command_sudo('cgset --copy-from / lxc')
-        if int(ret) != 0:
-            raise RuntimeError('Failed to copy cgroup settings from root.')
-
-        self._lxc_cgroup(state_object='cpuset.cpus')
-        self._lxc_cgroup(state_object='cpuset.cpus', value=container_cpu)
-        self._lxc_cgroup(state_object='cpuset.cpus')
-
-    def mount_host_dir_in_container(self):
-        """Mount shared folder inside container.
-
-        :raises RuntimeError: If failed to mount host dir in a container.
-        """
-
-        ssh = SSH()
-        ssh.connect(self._node)
-
-        mnt_cfg = 'lxc.mount.entry = {0} /var/lib/lxc/{1}/rootfs{2} ' \
-            'none bind,create=dir 0 0'.format(self._host_dir,
-                                              self._container_name,
-                                              self._guest_dir)
-        ret, _, _ = ssh.exec_command_sudo(
-            "sh -c 'echo \"{0}\" >> /var/lib/lxc/{1}/config'"
-            .format(mnt_cfg, self._container_name))
-        if int(ret) != 0:
-            raise RuntimeError('Failed to mount {0} in lxc: {1}'
-                               .format(self._host_dir, self._container_name))
-
-        self.restart_container()
-
-    def mount_hugepages_in_container(self):
-        """Mount hugepages inside container.
-
-        :raises RuntimeError: If failed to mount hugepages in a container.
-        """
-
-        ssh = SSH()
-        ssh.connect(self._node)
-
-        mnt_cfg = 'lxc.mount.entry = {0} dev/hugepages ' \
-            'none bind,create=dir 0 0'.format(self._host_hugepages_dir)
-        ret, _, _ = ssh.exec_command_sudo(
-            "sh -c 'echo \"{0}\" >> /var/lib/lxc/{1}/config'"
-            .format(mnt_cfg, self._container_name))
-        if int(ret) != 0:
-            raise RuntimeError('Failed to mount {0} in lxc: {1}'
-                               .format(self._host_hugepages_dir,
-                                       self._container_name))
-
-        self.restart_container()
-
-    def install_vpp_in_container(self, install_dkms=False):
-        """Install vpp inside a container.
-
-        :param install_dkms: If install dkms package. This will impact install
-        time. Dkms is required for installation of vpp-dpdk-dkms. Default is
-        false.
-        :type install_dkms: bool
-        """
-
-        ssh = SSH()
-        ssh.connect(self._node)
-
-        self.lxc_attach('apt-get update')
-        if install_dkms:
-            self.lxc_attach('apt-get install -y dkms && '
-                            'dpkg -i --force-all {0}/install_dir/*.deb'
-                            .format(self._guest_dir))
-        else:
-            self.lxc_attach('for i in $(ls -I \"*dkms*\" {0}/install_dir/); '
-                            'do dpkg -i --force-all {0}/install_dir/$i; done'
-                            .format(self._guest_dir))
-        self.lxc_attach('apt-get -f install -y')
-
-    def restart_vpp_in_container(self):
-        """Restart vpp service inside a container."""
-
-        ssh = SSH()
-        ssh.connect(self._node)
-
-        self.lxc_attach('service vpp restart')
-
-    def create_vpp_cfg_in_container(self, vat_template_file, **args):
-        """Create VPP exec config for a container on given node.
-
-        :param vat_template_file: Template file name of a VAT script.
-        :param args: Parameters for VAT script.
-        :type vat_template_file: str
-        :type args: dict
-        """
-        ssh = SSH()
-        ssh.connect(self._node)
-
-        vat_file_path = '{}/{}'.format(Constants.RESOURCES_TPL_VAT,
-                                       vat_template_file)
-
-        with open(vat_file_path, 'r') as template_file:
-            cmd_template = template_file.readlines()
-            for line_tmpl in cmd_template:
-                vat_cmd = line_tmpl.format(**args)
-                ssh.exec_command('echo "{0}" | '
-                                 'sudo lxc-attach --name {1} -- '
-                                 '/bin/sh -c "/bin/cat >> /tmp/running.exec"'
-                                 .format(vat_cmd.replace('\n', ''),
-                                         self._container_name))
index e3cea93..e1f3d30 100644 (file)
@@ -25,16 +25,18 @@ class Memif(object):
         pass
 
     @staticmethod
         pass
 
     @staticmethod
-    def create_memif_interface(node, socket, mid, role='master'):
+    def create_memif_interface(node, filename, mid, sid, role='master'):
         """Create Memif interface on the given node.
 
         :param node: Given node to create Memif interface on.
         """Create Memif interface on the given node.
 
         :param node: Given node to create Memif interface on.
-        :param socket: Memif interface socket path.
+        :param filename: Memif interface socket filename.
         :param mid: Memif interface ID.
         :param mid: Memif interface ID.
+        :param sid: Socket ID.
         :param role: Memif interface role [master|slave]. Default is master.
         :type node: dict
         :param role: Memif interface role [master|slave]. Default is master.
         :type node: dict
-        :type socket: str
+        :type filename: str
         :type mid: str
         :type mid: str
+        :type sid: str
         :type role: str
         :returns: SW interface index.
         :rtype: int
         :type role: str
         :returns: SW interface index.
         :rtype: int
@@ -43,8 +45,10 @@ class Memif(object):
 
         with VatTerminal(node, json_param=False) as vat:
             vat.vat_terminal_exec_cmd_from_template(
 
         with VatTerminal(node, json_param=False) as vat:
             vat.vat_terminal_exec_cmd_from_template(
-                'memif_create.vat',
-                socket=socket, id=mid, role=role)
+                'memif_socket_filename_add_del.vat',
+                add_del='add', id=sid, filename='/tmp/'+filename)
+            vat.vat_terminal_exec_cmd_from_template(
+                'memif_create.vat', id=mid, socket=sid, role=role)
             if 'sw_if_index' in vat.vat_stdout:
                 try:
                     sw_if_idx = int(vat.vat_stdout.split()[4])
             if 'sw_if_index' in vat.vat_stdout:
                 try:
                     sw_if_idx = int(vat.vat_stdout.split()[4])
@@ -56,7 +60,8 @@ class Memif(object):
                     Topology.update_interface_name(node, if_key, ifc_name)
                     ifc_mac = Memif.vpp_get_memif_interface_mac(node, sw_if_idx)
                     Topology.update_interface_mac_address(node, if_key, ifc_mac)
                     Topology.update_interface_name(node, if_key, ifc_name)
                     ifc_mac = Memif.vpp_get_memif_interface_mac(node, sw_if_idx)
                     Topology.update_interface_mac_address(node, if_key, ifc_mac)
-                    Topology.update_interface_memif_socket(node, if_key, socket)
+                    Topology.update_interface_memif_socket(node, if_key,
+                                                           '/tmp/'+filename)
                     Topology.update_interface_memif_id(node, if_key, mid)
                     Topology.update_interface_memif_role(node, if_key, role)
                     return sw_if_idx
                     Topology.update_interface_memif_id(node, if_key, mid)
                     Topology.update_interface_memif_role(node, if_key, role)
                     return sw_if_idx
index 8c94fc7..ba6c796 100644 (file)
 | | ...
 | | ... | *Note:*
 | | ... | Socket paths for Memif are defined in following format:
 | | ...
 | | ... | *Note:*
 | | ... | Socket paths for Memif are defined in following format:
-| | ... | - /tmp/memif-${number}-1
-| | ... | - /tmp/memif-${number}-2
+| | ... | - /tmp/memif-DUT1_VNF${number}-${sid}
 | | ...
 | | ... | *Example:*
 | | ...
 | | ...
 | | ... | *Example:*
 | | ...
 | | Set Interface State | ${dut2} | ${dut2_if1} | up
 | | Set Interface State | ${dut2} | ${dut2_if2} | up
 | | :FOR | ${number} | IN RANGE | 1 | ${nr}+1
 | | Set Interface State | ${dut2} | ${dut2_if1} | up
 | | Set Interface State | ${dut2} | ${dut2_if2} | up
 | | :FOR | ${number} | IN RANGE | 1 | ${nr}+1
-| |      | ${sock1}= | Set Variable | /tmp/memif-DUT1_VNF${number}-1
-| |      | ${sock2}= | Set Variable | /tmp/memif-DUT1_VNF${number}-2
+| |      | ${sock1}= | Set Variable | memif-DUT1_VNF
+| |      | ${sock2}= | Set Variable | memif-DUT1_VNF
 | |      | ${prev_index}= | Evaluate | ${number}-1
 | |      | Set up memif interfaces on DUT node | ${dut1}
 | |      | ... | ${sock1} | ${sock2} | ${number} | dut1-memif-${number}-if1
 | |      | ${prev_index}= | Evaluate | ${number}-1
 | |      | Set up memif interfaces on DUT node | ${dut1}
 | |      | ... | ${sock1} | ${sock2} | ${number} | dut1-memif-${number}-if1
 | |      | ... | ${dut1-memif-${prev_index}-if2}
 | |      | Configure L2XC | ${dut1} | ${dut1_xconnect_if1}
 | |      | ... | ${dut1-memif-${number}-if1}
 | |      | ... | ${dut1-memif-${prev_index}-if2}
 | |      | Configure L2XC | ${dut1} | ${dut1_xconnect_if1}
 | |      | ... | ${dut1-memif-${number}-if1}
-| |      | ${sock1}= | Set Variable | /tmp/memif-DUT2_VNF${number}-1
-| |      | ${sock2}= | Set Variable | /tmp/memif-DUT2_VNF${number}-2
+| |      | ${sock1}= | Set Variable | memif-DUT2_VNF
+| |      | ${sock2}= | Set Variable | memif-DUT2_VNF
 | |      | Set up memif interfaces on DUT node | ${dut2}
 | |      | ... | ${sock1} | ${sock2} | ${number} | dut2-memif-${number}-if1
 | |      | ... | dut2-memif-${number}-if2
 | |      | Set up memif interfaces on DUT node | ${dut2}
 | |      | ... | ${sock1} | ${sock2} | ${number} | dut2-memif-${number}-if1
 | |      | ... | dut2-memif-${number}-if2
 | | ...
 | | ... | *Note:*
 | | ... | Socket paths for Memif are defined in following format:
 | | ...
 | | ... | *Note:*
 | | ... | Socket paths for Memif are defined in following format:
-| | ... | - /tmp/memif-${number}-1
-| | ... | - /tmp/memif-${number}-2
+| | ... | - /tmp/memif-DUT1_VNF${number}-${sid}
 | | ...
 | | ... | *Example:*
 | | ...
 | | ...
 | | ... | *Example:*
 | | ...
 | | Add interface to bridge domain | ${dut2} | ${dut2_if1} | ${1}
 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
 | | :FOR | ${number} | IN RANGE | 1 | ${nr}+1
 | | Add interface to bridge domain | ${dut2} | ${dut2_if1} | ${1}
 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
 | | :FOR | ${number} | IN RANGE | 1 | ${nr}+1
-| | | ${sock1}= | Set Variable | /tmp/memif-DUT1_VNF${number}-1
-| | | ${sock2}= | Set Variable | /tmp/memif-DUT1_VNF${number}-2
+| | | ${sock1}= | Set Variable | memif-DUT1_VNF
+| | | ${sock2}= | Set Variable | memif-DUT1_VNF
 | | | Set up memif interfaces on DUT node | ${dut1}
 | | | ... | ${sock1} | ${sock2} | ${number} | dut1-memif-${number}-if1
 | | | ... | dut1-memif-${number}-if2
 | | | Set up memif interfaces on DUT node | ${dut1}
 | | | ... | ${sock1} | ${sock2} | ${number} | dut1-memif-${number}-if1
 | | | ... | dut1-memif-${number}-if2
 | | | ... | ${dut1-memif-${number}-if1} | ${number}
 | | | Add interface to bridge domain | ${dut1}
 | | | ... | ${dut1-memif-${number}-if2} | ${bd_id2}
 | | | ... | ${dut1-memif-${number}-if1} | ${number}
 | | | Add interface to bridge domain | ${dut1}
 | | | ... | ${dut1-memif-${number}-if2} | ${bd_id2}
-| | | ${sock1}= | Set Variable | /tmp/memif-DUT2_VNF${number}-1
-| | | ${sock2}= | Set Variable | /tmp/memif-DUT2_VNF${number}-2
+| | | ${sock1}= | Set Variable | memif-DUT2_VNF
+| | | ${sock2}= | Set Variable | memif-DUT2_VNF
 | | | Set up memif interfaces on DUT node | ${dut2}
 | | | ... | ${sock1} | ${sock2} | ${number} | dut2-memif-${number}-if1
 | | | ... | dut2-memif-${number}-if2
 | | | Set up memif interfaces on DUT node | ${dut2}
 | | | ... | ${sock1} | ${sock2} | ${number} | dut2-memif-${number}-if1
 | | | ... | dut2-memif-${number}-if2
index c8c940b..4b23236 100644 (file)
 | | ... | group on all DUT nodes.
 | | ...
 | | Run Keyword | ${group}.Configure VPP In All Containers
 | | ... | group on all DUT nodes.
 | | ...
 | | Run Keyword | ${group}.Configure VPP In All Containers
-| | ... | memif_create_lxc.vat
+| | ... | memif_create_cnt.vat
 
 | Stop all '${group}' containers
 | | [Documentation] | Stop all container(s) in specific container group on all
 
 | Stop all '${group}' containers
 | | [Documentation] | Stop all container(s) in specific container group on all
index a4857fe..1739743 100644 (file)
 | | ...
 | | ... | *Arguments:*
 | | ... | - ${dut_node} - DUT node. Type: dictionary
 | | ...
 | | ... | *Arguments:*
 | | ... | - ${dut_node} - DUT node. Type: dictionary
-| | ... | - ${sock1} - Socket path for first Memif interface. Type: string
-| | ... | - ${sock2} - Socket path for second Memif interface. Type: string
-| | ... | - ${number} - Memif interface key. Type: integer
+| | ... | - ${filename1} - Socket filename for 1st Memif interface. Type: string
+| | ... | - ${filename2} - Socket filename for 2nd Memif interface. Type: string
+| | ... | - ${mid} - Memif interface ID. Type: integer
 | | ... | - ${memif_if1} - Name of the first Memif interface (Optional).
 | | ... | Type: string
 | | ... | - ${memif_if2} - Name of the second Memif interface (Optional).
 | | ... | Type: string
 | | ...
 | | ... | _NOTE:_ This KW sets following test case variable:
 | | ... | - ${memif_if1} - Name of the first Memif interface (Optional).
 | | ... | Type: string
 | | ... | - ${memif_if2} - Name of the second Memif interface (Optional).
 | | ... | Type: string
 | | ...
 | | ... | _NOTE:_ This KW sets following test case variable:
-| | ... | - ${${memif_if1}} - First Memif interface.
-| | ... | - ${${memif_if2}} - Second Memif interface.
+| | ... | - ${${memif_if1}} - 1st Memif interface.
+| | ... | - ${${memif_if2}} - 2nd Memif interface.
 | | ...
 | | ... | *Example:*
 | | ...
 | | ... | \| Set up memif interfaces on DUT node \
 | | ...
 | | ... | *Example:*
 | | ...
 | | ... | \| Set up memif interfaces on DUT node \
-| | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| 1 \|
+| | ... | \| ${nodes['DUT1']} \| sock1 \| sock2 \| 1 \|
 | | ... | \| Set up memif interfaces on DUT node \
 | | ... | \| Set up memif interfaces on DUT node \
-| | ... | \| ${nodes['DUT2']} \| /tmp/sock1 \| /tmp/sock2 \| 1 \
+| | ... | \| ${nodes['DUT2']} \| sock1 \| sock2 \| 1 \
 | | ... | \| dut2_memif_if1 \| dut2_memif_if2 \|
 | | ...
 | | ... | \| dut2_memif_if1 \| dut2_memif_if2 \|
 | | ...
-| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${number}=${1}
+| | [Arguments] | ${dut_node} | ${filename1} | ${filename2} | ${mid}=${1}
 | | ... | ${memif_if1}=memif_if1 | ${memif_if2}=memif_if2
 | | ... | ${memif_if1}=memif_if1 | ${memif_if2}=memif_if2
-| | ${key_1}= | Evaluate | (${number}*2)-1
-| | ${key_2}= | Evaluate | (${number}*2)
-| | ${memif_1}= | Create memif interface | ${dut_node} | ${sock1} | ${key_1}
-| | ${memif_2}= | Create memif interface | ${dut_node} | ${sock2} | ${key_2}
+| | ${sid_1}= | Evaluate | (${mid}*2)-1
+| | ${sid_2}= | Evaluate | (${mid}*2)
+| | ${memif_1}= | Create memif interface | ${dut_node}
+| | ... | ${filename1}${mid}-${sid_1} | ${mid} | ${sid_1}
+| | ${memif_2}= | Create memif interface | ${dut_node}
+| | ... | ${filename2}${mid}-${sid_2} | ${mid} | ${sid_2}
 | | Set Interface State | ${dut_node} | ${memif_1} | up
 | | Set Interface State | ${dut_node} | ${memif_2} | up
 | | Set Test Variable | ${${memif_if1}} | ${memif_1}
 | | Set Interface State | ${dut_node} | ${memif_1} | up
 | | Set Interface State | ${dut_node} | ${memif_2} | up
 | | Set Test Variable | ${${memif_if1}} | ${memif_1}
diff --git a/resources/templates/vat/memif_create_cnt.vat b/resources/templates/vat/memif_create_cnt.vat
new file mode 100644 (file)
index 0000000..f0d847b
--- /dev/null
@@ -0,0 +1,10 @@
+create memif socket id {sid1} filename /mnt/host/{socket1}
+create interface memif id {mid1} socket-id {sid1} slave
+set int state memif{sid1}/{mid1} up
+
+create memif socket id {sid2} filename /mnt/host/{socket2}
+create interface memif id {mid2} socket-id {sid2} slave
+set int state memif{sid2}/{mid2} up
+
+set interface l2 xconnect memif{sid2}/{mid2} memif{sid1}/{mid1}
+set interface l2 xconnect memif{sid1}/{mid1} memif{sid2}/{mid2}
diff --git a/resources/templates/vat/memif_create_lxc.vat b/resources/templates/vat/memif_create_lxc.vat
deleted file mode 100644 (file)
index 9c54543..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-create memif id {memif_id1} socket-id /mnt/host/{socket1} slave
-set int state memif0/{memif_id1} up
-
-create memif id {memif_id2} socket-id /mnt/host/{socket2} slave
-set int state memif1/{memif_id2} up
-
-set interface l2 xconnect memif1/{memif_id2} memif0/{memif_id1}
-set interface l2 xconnect memif0/{memif_id1} memif1/{memif_id2}
diff --git a/resources/templates/vat/memif_socket_filename_add_del.vat b/resources/templates/vat/memif_socket_filename_add_del.vat
new file mode 100644 (file)
index 0000000..cc7a824
--- /dev/null
@@ -0,0 +1 @@
+memif_socket_filename_add_del {add_del} id {id} filename {filename}
diff --git a/tests/vpp/perf/container_memif/10ge2p1x520-eth-l2bdbasemaclrn-eth-2memif-1lxc-mrr.robot b/tests/vpp/perf/container_memif/10ge2p1x520-eth-l2bdbasemaclrn-eth-2memif-1lxc-mrr.robot
new file mode 100644 (file)
index 0000000..760e845
--- /dev/null
@@ -0,0 +1,157 @@
+# Copyright (c) 2018 Cisco and/or its affiliates.
+# 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.
+
+*** Settings ***
+| Resource | resources/libraries/robot/performance/performance_setup.robot
+| ...
+| Force Tags | 3_NODE_SINGLE_LINK_TOPO | PERFTEST | HW_ENV | MRR
+| ... | NIC_Intel-X520-DA2 | ETH | L2BDMACLRN | BASE | MEMIF | LXC
+| ...
+| Suite Setup | Run Keywords
+| ... | Set up 3-node performance topology with DUT's NIC model | L2
+| ... | Intel-X520-DA2
+| ... | AND | Set up performance test suite with MEMIF
+| ... | AND | Set up performance topology with containers
+| ...
+| Suite Teardown | Tear down 3-node performance topology with container
+| ...
+| Test Setup | Set up performance test
+| ...
+| Test Teardown | Tear down performance mrr test
+| ...
+| Documentation |  *Raw results L2BD test cases*
+| ...
+| ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology
+| ... | with single links between nodes.
+| ... | *[Enc] Packet Encapsulations:* Eth-IPv4 for L2 bridge domain.
+| ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with two L2
+| ... | bridge domains and MAC learning enabled. LXC is connected to VPP via
+| ... | Memif interface. LXC is running same VPP version as running on DUT. LXC
+| ... | is limited via cgroup to use 3 cores allocated from pool of isolated
+| ... | CPUs. There are no memory constraints. DUT1 and DUT2 tested with
+| ... | 2p10GE NIC X520 Niantic by Intel.
+| ... | *[Ver] TG verification:* In MaxReceivedRate test TG sends traffic
+| ... | at line rate and reports total received/sent packets over trial period.
+| ... | Test packets are generated by TG on links to DUTs. TG traffic profile
+| ... | contains two L3 flow-groups (flow-group per direction, 253 flows per
+| ... | flow-group) with all packets containing Ethernet header, IPv4 header
+| ... | with IP protocol=61 and static payload. MAC addresses are matching MAC
+| ... | addresses of the TG node interfaces.
+| ... | *[Ref] Applicable standard specifications:* RFC2544.
+
+*** Variables ***
+# X520-DA2 bandwidth limit
+| ${s_limit} | ${10000000000}
+# Traffic profile:
+| ${traffic_profile} | trex-sl-3n-ethip4-ip4src254
+# LXC container
+| ${container_count}= | ${1}
+| ${container_engine}= | LXC
+| ${container_image}= | ${EMPTY}
+# CPU settings
+| ${system_cpus}= | ${1}
+| ${vpp_cpus}= | ${5}
+| ${container_cpus}= | ${3}
+
+*** Keywords ***
+| Check RR for l2bdbasemaclrn-eth-2memif-1lxc
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2BD switching config with ${wt} thread(s), ${wt}\
+| | ... | phy core(s), ${rxq} receive queue(s) per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate for ${framesize} frames using single\
+| | ... | trial throughput test.
+| | ...
+| | [Arguments] | ${framesize} | ${wt} | ${rxq}
+| | ...
+| | # Test Variables required for test teardown
+| | Set Test Variable | ${framesize}
+| | ${get_framesize}= | Get Frame Size | ${framesize}
+| | ${max_rate}= | Calculate pps | ${s_limit} | ${framesize}
+| | ...
+| | Given Add '${wt}' worker threads and '${rxq}' rxqueues in 3-node single-link circular topology
+| | And Add PCI devices to DUTs in 3-node single link topology
+| | And Run Keyword If | ${get_framesize} < ${1522}
+| | ... | Add no multi seg to all DUTs
+| | And Apply startup configuration on all VPP DUTs
+| | And Initialize L2 Bridge Domain for '1' memif pairs in 3-node circular topology
+| | Then Traffic should pass with maximum rate | ${perf_trial_duration}
+| | ... | ${max_rate}pps | ${framesize} | ${traffic_profile}
+
+*** Test Cases ***
+| tc01-64B-1t1c-eth-l2bdbasemaclrn-eth-2memif-1lxc-mrr
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2BD switching config with 1 thread, 1 phy core,\
+| | ... | 1 receive queue per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate for 64B frames using single trial\
+| | ... | throughput test.
+| | ...
+| | [Tags] | 64B | 1T1C | STHREAD
+| | [Template] | Check RR for l2bdbasemaclrn-eth-2memif-1lxc
+| | framesize=${64} | wt=1 | rxq=1
+
+| tc02-IMIX-1t1c-eth-l2bdbasemaclrn-eth-2memif-1lxc-mrr
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2BD switching config with 1 thread, 1 phy core,\
+| | ... | 1 receive queue per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate for IMIX_v4_1 frames using single trial\
+| | ... | throughput test.
+| | ... | IMIX_v4_1 = (28x64B;16x570B;4x1518B)
+| | ...
+| | [Tags] | IMIX | 1T1C | STHREAD
+| | [Template] | Check RR for l2bdbasemaclrn-eth-2memif-1lxc
+| | framesize=IMIX_v4_1 | wt=1 | rxq=1
+
+| tc03-1518B-1t1c-eth-l2bdbasemaclrn-eth-2memif-1lxc-mrr
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2BD switching config with 1 thread, 1 phy core,\
+| | ... | 1 receive queue per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate for 1518B frames using single trial\
+| | ... | throughput test.
+| | ...
+| | [Tags] | 1518B | 1T1C | STHREAD
+| | [Template] | Check RR for l2bdbasemaclrn-eth-2memif-1lxc
+| | framesize=${1518} | wt=1 | rxq=1
+
+| tc04-64B-2t2c-eth-l2bdbasemaclrn-eth-2memif-1lxc-mrr
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2BD switching config with 2 thread, 2 phy core,\
+| | ... | 1 receive queue per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate for 64B frames using single trial\
+| | ... | throughput test.
+| | ...
+| | [Tags] | 64B | 2T2C | MTHREAD
+| | [Template] | Check RR for l2bdbasemaclrn-eth-2memif-1lxc
+| | framesize=${64} | wt=2 | rxq=1
+
+| tc05-IMIX-2t2c-eth-l2bdbasemaclrn-eth-2memif-1lxc-mrr
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2BD switching config with 2 thread, 2 phy core,\
+| | ... | 1 receive queue per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate forIMIX_v4_1 frames using single trial\
+| | ... | throughput test.
+| | ... | IMIX_v4_1 = (28x64B;16x570B;4x1518B)
+| | ...
+| | [Tags] | IMIX | 2T2C | MTHREAD
+| | [Template] | Check RR for l2bdbasemaclrn-eth-2memif-1lxc
+| | framesize=IMIX_v4_1 | wt=2 | rxq=1
+
+| tc06-1518B-2t2c-eth-l2bdbasemaclrn-eth-2memif-1lxc-mrr
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2BD switching config with 2 thread, 1 phy core,\
+| | ... | 1 receive queue per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate for 1518B frames using single trial\
+| | ... | throughput test.
+| | ...
+| | [Tags] | 1518B | 2T2C | MTHREAD
+| | [Template] | Check RR for l2bdbasemaclrn-eth-2memif-1lxc
+| | framesize=${1518} | wt=2 | rxq=1
\ No newline at end of file
diff --git a/tests/vpp/perf/container_memif/10ge2p1x520-eth-l2xcbase-eth-2memif-1dcr-mrr.robot b/tests/vpp/perf/container_memif/10ge2p1x520-eth-l2xcbase-eth-2memif-1dcr-mrr.robot
new file mode 100644 (file)
index 0000000..b157663
--- /dev/null
@@ -0,0 +1,157 @@
+# Copyright (c) 2018 Cisco and/or its affiliates.
+# 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.
+
+*** Settings ***
+| Resource | resources/libraries/robot/performance/performance_setup.robot
+| ...
+| Force Tags | 3_NODE_SINGLE_LINK_TOPO | PERFTEST | HW_ENV | MRR
+| ... | NIC_Intel-X520-DA2 | ETH | L2XCFWD | BASE | MEMIF | DOCKER
+| ...
+| Suite Setup | Run Keywords
+| ... | Set up 3-node performance topology with DUT's NIC model | L2
+| ... | Intel-X520-DA2
+| ... | AND | Set up performance test suite with MEMIF
+| ... | AND | Set up performance topology with containers
+| ...
+| Suite Teardown | Tear down 3-node performance topology with container
+| ...
+| Test Setup | Set up performance test
+| ...
+| Test Teardown | Tear down performance mrr test
+| ...
+| Documentation |  *Raw results L2XC test cases*
+| ...
+| ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology
+| ... | with single links between nodes.
+| ... | *[Enc] Packet Encapsulations:* Eth-IPv4 for L2 cross connect.
+| ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2 cross-
+| ... | connect. DUT1 and DUT2 tested with 2p10GE NIC X520 Niantic by Intel.
+| ... | Container is connected to VPP via Memif interface. Container is running
+| ... | same VPP version as running on DUT. Container is limited via cgroup to
+| ... | use 3 cores allocated from pool of isolated CPUs. There are no memory
+| ... | contraints.
+| ... | *[Ver] TG verification:* In MaxReceivedRate test TG sends traffic
+| ... | at line rate and reports total received/sent packets over trial period.
+| ... | Test packets are generated by TG on links to DUTs. TG traffic profile
+| ... | contains two L3 flow-groups (flow-group per direction, 253 flows per
+| ... | flow-group) with all packets containing Ethernet header, IPv4 header
+| ... | with IP protocol=61 and static payload. MAC addresses are matching MAC
+| ... | addresses of the TG node interfaces.
+| ... | *[Ref] Applicable standard specifications:* RFC2544.
+
+*** Variables ***
+# X520-DA2 bandwidth limit
+| ${s_limit} | ${10000000000}
+# Traffic profile:
+| ${traffic_profile} | trex-sl-3n-ethip4-ip4src254
+# LXC container
+| ${container_count}= | ${1}
+| ${container_engine}= | Docker
+| ${container_image}= | ubuntu
+# CPU settings
+| ${system_cpus}= | ${1}
+| ${vpp_cpus}= | ${5}
+| ${container_cpus}= | ${3}
+
+*** Keywords ***
+| Check RR for l2xcbase-eth-2memif-1dcr
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2XC switching config with ${wt} thread(s), ${wt}\
+| | ... | phy core(s), ${rxq} receive queue(s) per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate for ${framesize} frames using single\
+| | ... | trial throughput test.
+| | ...
+| | [Arguments] | ${framesize} | ${wt} | ${rxq}
+| | ...
+| | # Test Variables required for test teardown
+| | Set Test Variable | ${framesize}
+| | ${get_framesize}= | Get Frame Size | ${framesize}
+| | ${max_rate}= | Calculate pps | ${s_limit} | ${framesize}
+| | ...
+| | Given Add '${wt}' worker threads and '${rxq}' rxqueues in 3-node single-link circular topology
+| | And Add PCI devices to DUTs in 3-node single link topology
+| | And Run Keyword If | ${get_framesize} < ${1522}
+| | ... | Add no multi seg to all DUTs
+| | And Apply startup configuration on all VPP DUTs
+| | And Initialize L2 xconnect for '1' memif pairs in 3-node circular topology
+| | Then Traffic should pass with maximum rate | ${perf_trial_duration}
+| | ... | ${max_rate}pps | ${framesize} | ${traffic_profile}
+
+*** Test Cases ***
+| tc01-64B-1t1c-eth-l2xcbase-eth-2memif-1dcr-mrr
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2XC switching config with 1 thread, 1 phy core,\
+| | ... | 1 receive queue per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate for 64B frames using single trial\
+| | ... | throughput test.
+| | ...
+| | [Tags] | 64B | 1T1C | STHREAD
+| | [Template] | Check RR for l2xcbase-eth-2memif-1dcr
+| | framesize=${64} | wt=1 | rxq=1
+
+| tc02-IMIX-1t1c-eth-l2xcbase-eth-2memif-1dcr-mrr
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2XC switching config with 1 thread, 1 phy core,\
+| | ... | 1 receive queue per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate for IMIX_v4_1 frames using single trial\
+| | ... | throughput test.
+| | ... | IMIX_v4_1 = (28x64B;16x570B;4x1518B)
+| | ...
+| | [Tags] | IMIX | 1T1C | STHREAD
+| | [Template] | Check RR for l2xcbase-eth-2memif-1dcr
+| | framesize=IMIX_v4_1 | wt=1 | rxq=1
+
+| tc03-1518B-1t1c-eth-l2xcbase-eth-2memif-1dcr-mrr
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2XC switching config with 1 thread, 1 phy core,\
+| | ... | 1 receive queue per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate for 1518B frames using single trial\
+| | ... | throughput test.
+| | ...
+| | [Tags] | 1518B | 1T1C | STHREAD
+| | [Template] | Check RR for l2xcbase-eth-2memif-1dcr
+| | framesize=${1518} | wt=1 | rxq=1
+
+| tc04-64B-2t2c-eth-l2xcbase-eth-2memif-1dcr-mrr
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2XC switching config with 2 thread, 2 phy core,\
+| | ... | 1 receive queue per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate for 64B frames using single trial\
+| | ... | throughput test.
+| | ...
+| | [Tags] | 64B | 2T2C | MTHREAD
+| | [Template] | Check RR for l2xcbase-eth-2memif-1dcr
+| | framesize=${64} | wt=2 | rxq=1
+
+| tc05-IMIX-2t2c-eth-l2xcbase-eth-2memif-1dcr-mrr
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2XC switching config with 2 thread, 2 phy core,\
+| | ... | 1 receive queue per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate forIMIX_v4_1 frames using single trial\
+| | ... | throughput test.
+| | ... | IMIX_v4_1 = (28x64B;16x570B;4x1518B)
+| | ...
+| | [Tags] | IMIX | 2T2C | MTHREAD
+| | [Template] | Check RR for l2xcbase-eth-2memif-1dcr
+| | framesize=IMIX_v4_1 | wt=2 | rxq=1
+
+| tc06-1518B-2t2c-eth-l2xcbase-eth-2memif-1dcr-mrr
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2XC switching config with 2 thread, 1 phy core,\
+| | ... | 1 receive queue per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate for 1518B frames using single trial\
+| | ... | throughput test.
+| | ...
+| | [Tags] | 1518B | 2T2C | MTHREAD
+| | [Template] | Check RR for l2xcbase-eth-2memif-1dcr
+| | framesize=${1518} | wt=2 | rxq=1
\ No newline at end of file
diff --git a/tests/vpp/perf/container_memif/10ge2p1x520-eth-l2xcbase-eth-2memif-1lxc-mrr.robot b/tests/vpp/perf/container_memif/10ge2p1x520-eth-l2xcbase-eth-2memif-1lxc-mrr.robot
new file mode 100644 (file)
index 0000000..8d8c969
--- /dev/null
@@ -0,0 +1,156 @@
+# Copyright (c) 2018 Cisco and/or its affiliates.
+# 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.
+
+*** Settings ***
+| Resource | resources/libraries/robot/performance/performance_setup.robot
+| ...
+| Force Tags | 3_NODE_SINGLE_LINK_TOPO | PERFTEST | HW_ENV | MRR
+| ... | NIC_Intel-X520-DA2 | ETH | L2XCFWD | BASE | MEMIF | LXC
+| ...
+| Suite Setup | Run Keywords
+| ... | Set up 3-node performance topology with DUT's NIC model | L2
+| ... | Intel-X520-DA2
+| ... | AND | Set up performance test suite with MEMIF
+| ... | AND | Set up performance topology with containers
+| ...
+| Suite Teardown | Tear down 3-node performance topology with container
+| ...
+| Test Setup | Set up performance test
+| ...
+| Test Teardown | Tear down performance mrr test
+| ...
+| Documentation |  *Raw results L2XC test cases*
+| ...
+| ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology
+| ... | with single links between nodes.
+| ... | *[Enc] Packet Encapsulations:* Eth-IPv4 for L2 cross connect.
+| ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2 cross-
+| ... | connect. DUT1 and DUT2 tested with 2p10GE NIC X520 Niantic by Intel.
+| ... | LXC is connected to VPP via Memif interface. LXC is running same VPP
+| ... | version as running on DUT. LXC is limited via cgroup to use 3 cores
+| ... | allocated from pool of isolated CPUs. There are no memory contraints.
+| ... | *[Ver] TG verification:* In MaxReceivedRate test TG sends traffic
+| ... | at line rate and reports total received/sent packets over trial period.
+| ... | Test packets are generated by TG on links to DUTs. TG traffic profile
+| ... | contains two L3 flow-groups (flow-group per direction, 253 flows per
+| ... | flow-group) with all packets containing Ethernet header, IPv4 header
+| ... | with IP protocol=61 and static payload. MAC addresses are matching MAC
+| ... | addresses of the TG node interfaces.
+| ... | *[Ref] Applicable standard specifications:* RFC2544.
+
+*** Variables ***
+# X520-DA2 bandwidth limit
+| ${s_limit} | ${10000000000}
+# Traffic profile:
+| ${traffic_profile} | trex-sl-3n-ethip4-ip4src254
+# LXC container
+| ${container_count}= | ${1}
+| ${container_engine}= | LXC
+| ${container_image}= | ${EMPTY}
+# CPU settings
+| ${system_cpus}= | ${1}
+| ${vpp_cpus}= | ${5}
+| ${container_cpus}= | ${3}
+
+*** Keywords ***
+| Check RR for l2xcbase-eth-2memif-1lxc
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2XC switching config with ${wt} thread(s), ${wt}\
+| | ... | phy core(s), ${rxq} receive queue(s) per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate for ${framesize} frames using single\
+| | ... | trial throughput test.
+| | ...
+| | [Arguments] | ${framesize} | ${wt} | ${rxq}
+| | ...
+| | # Test Variables required for test teardown
+| | Set Test Variable | ${framesize}
+| | ${get_framesize}= | Get Frame Size | ${framesize}
+| | ${max_rate}= | Calculate pps | ${s_limit} | ${framesize}
+| | ...
+| | Given Add '${wt}' worker threads and '${rxq}' rxqueues in 3-node single-link circular topology
+| | And Add PCI devices to DUTs in 3-node single link topology
+| | And Run Keyword If | ${get_framesize} < ${1522}
+| | ... | Add no multi seg to all DUTs
+| | And Apply startup configuration on all VPP DUTs
+| | And Initialize L2 xconnect for '1' memif pairs in 3-node circular topology
+| | Then Traffic should pass with maximum rate | ${perf_trial_duration}
+| | ... | ${max_rate}pps | ${framesize} | ${traffic_profile}
+
+*** Test Cases ***
+| tc01-64B-1t1c-eth-l2xcbase-eth-2memif-1lxc-mrr
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2XC switching config with 1 thread, 1 phy core,\
+| | ... | 1 receive queue per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate for 64B frames using single trial\
+| | ... | throughput test.
+| | ...
+| | [Tags] | 64B | 1T1C | STHREAD
+| | [Template] | Check RR for l2xcbase-eth-2memif-1lxc
+| | framesize=${64} | wt=1 | rxq=1
+
+| tc02-IMIX-1t1c-eth-l2xcbase-eth-2memif-1lxc-mrr
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2XC switching config with 1 thread, 1 phy core,\
+| | ... | 1 receive queue per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate for IMIX_v4_1 frames using single trial\
+| | ... | throughput test.
+| | ... | IMIX_v4_1 = (28x64B;16x570B;4x1518B)
+| | ...
+| | [Tags] | IMIX | 1T1C | STHREAD
+| | [Template] | Check RR for l2xcbase-eth-2memif-1lxc
+| | framesize=IMIX_v4_1 | wt=1 | rxq=1
+
+| tc03-1518B-1t1c-eth-l2xcbase-eth-2memif-1lxc-mrr
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2XC switching config with 1 thread, 1 phy core,\
+| | ... | 1 receive queue per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate for 1518B frames using single trial\
+| | ... | throughput test.
+| | ...
+| | [Tags] | 1518B | 1T1C | STHREAD
+| | [Template] | Check RR for l2xcbase-eth-2memif-1lxc
+| | framesize=${1518} | wt=1 | rxq=1
+
+| tc04-64B-2t2c-eth-l2xcbase-eth-2memif-1lxc-mrr
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2XC switching config with 2 thread, 2 phy core,\
+| | ... | 1 receive queue per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate for 64B frames using single trial\
+| | ... | throughput test.
+| | ...
+| | [Tags] | 64B | 2T2C | MTHREAD
+| | [Template] | Check RR for l2xcbase-eth-2memif-1lxc
+| | framesize=${64} | wt=2 | rxq=1
+
+| tc05-IMIX-2t2c-eth-l2xcbase-eth-2memif-1lxc-mrr
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2XC switching config with 2 thread, 2 phy core,\
+| | ... | 1 receive queue per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate forIMIX_v4_1 frames using single trial\
+| | ... | throughput test.
+| | ... | IMIX_v4_1 = (28x64B;16x570B;4x1518B)
+| | ...
+| | [Tags] | IMIX | 2T2C | MTHREAD
+| | [Template] | Check RR for l2xcbase-eth-2memif-1lxc
+| | framesize=IMIX_v4_1 | wt=2 | rxq=1
+
+| tc06-1518B-2t2c-eth-l2xcbase-eth-2memif-1lxc-mrr
+| | [Documentation]
+| | ... | [Cfg] DUT runs L2XC switching config with 2 thread, 1 phy core,\
+| | ... | 1 receive queue per NIC port.
+| | ... | [Ver] Measure MaxReceivedRate for 1518B frames using single trial\
+| | ... | throughput test.
+| | ...
+| | [Tags] | 1518B | 2T2C | MTHREAD
+| | [Template] | Check RR for l2xcbase-eth-2memif-1lxc
+| | framesize=${1518} | wt=2 | rxq=1