aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/bash/function/per_patch.sh
AgeCommit message (Expand)AuthorFilesLines
2020-07-23perpatch: Echo MAKE_PARALLEL_* var before buildJuraj Linkeš1-1/+15
2019-12-16FIX PIP requirement packagesPeter Mikus1-4/+0
2019-12-02Refactor jumpavg to be more readable and usableVratko Polak1-3/+4
2019-12-02FIX: Perpatch PY3Peter Mikus1-2/+2
2019-07-23vppdevice: fix install-dep failure when component install is requiredDave Wallace1-1/+1
2019-07-17FIX: Move per-patch building mechanicsPeter Mikus1-5/+2
2019-07-10Bash functions style cleanupVratko Polak1-25/+24
2019-02-20FIX: Static variables all over the place for per patchPeter Mikus1-10/+25
2019-02-19CSIT-1419 Convert vpp-virl job to vpp-devicePeter Mikus1-65/+46
2018-10-24Remove usage of vpp-ext-deps packageJan Gelety1-7/+2
2018-10-22Per patch: multiple BMRR callsVratko Polak1-66/+71
2018-10-01CSIT-1327 Migrate from vpp-dkms-dpdk to vpp-ext-depsPeter Mikus1-10/+11
2018-08-30CSIT-1135: Scripts for VPP per-patch testingVratko Polak1-0/+314
ghlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
# Copyright (c) 2020 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.

"""This module implements functionality which sets L2 forwarding for DPDK on
DUT nodes.
"""

from resources.libraries.python.Constants import Constants
from resources.libraries.python.ssh import exec_cmd_no_error
from resources.libraries.python.topology import NodeType


class L2fwdTest:
    """Setup the DPDK for l2fwd performance test."""

    @staticmethod
    def start_the_l2fwd_test(
            node, cpu_cores, nb_cores, queue_nums, jumbo_frames,
            rxq_size=1024, txq_size=1024):
        """
        Execute the l2fwd on the DUT node.

        :param node: Will execute the l2fwd on this node.
        :param cpu_cores: The DPDK run cores.
        :param nb_cores: The cores number for the forwarding.
        :param queue_nums: The queues number for the NIC.
        :param jumbo_frames: Indication if the jumbo frames are used (True) or
            not (False).
        :param rxq_size: RXQ size. Default=1024.
        :param txq_size: TXQ size. Default=1024.
        :type node: dict
        :type cpu_cores: str
        :type nb_cores: str
        :type queue_nums: str
        :type jumbo_frames: bool
        :type rxq_size: int
        :type txq_size: int
        :raises RuntimeError: If the script "run_l2fwd.sh" fails.
        """
        if node[u"type"] == NodeType.DUT:
            jumbo = u"yes" if jumbo_frames else u"no"
            command = f"{Constants.REMOTE_FW_DIR}/tests/dpdk/dpdk_scripts" \
                f"/run_l2fwd.sh {cpu_cores} {nb_cores} {queue_nums} {jumbo} " \
                f"{rxq_size} {txq_size}"

            message = f"Failed to execute l2fwd test at node {node['host']}"

            exec_cmd_no_error(node, command, timeout=1800, message=message)