From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DD648A0543; Wed, 24 Aug 2022 18:25:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5891542B71; Wed, 24 Aug 2022 18:25:07 +0200 (CEST) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by mails.dpdk.org (Postfix) with ESMTP id 171534281A for ; Wed, 24 Aug 2022 18:25:04 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 10604CD26F; Wed, 24 Aug 2022 18:25:03 +0200 (CEST) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id x8WnTq2axTQu; Wed, 24 Aug 2022 18:25:02 +0200 (CEST) Received: from entguard.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id F0974CD267; Wed, 24 Aug 2022 18:24:57 +0200 (CEST) From: =?UTF-8?q?Juraj=20Linke=C5=A1?= To: thomas@monjalon.net, david.marchand@redhat.com, ronan.randles@intel.com, Honnappa.Nagarahalli@arm.com, ohilyard@iol.unh.edu, lijuan.tu@intel.com Cc: dev@dpdk.org, =?UTF-8?q?Juraj=20Linke=C5=A1?= Subject: [RFC PATCH v1 06/10] dts: add traffic generator node Date: Wed, 24 Aug 2022 16:24:50 +0000 Message-Id: <20220824162454.394285-7-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220824162454.394285-1-juraj.linkes@pantheon.tech> References: <20220824162454.394285-1-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The Traffic Generator node is responsible for configuring and running traffic generators. For HelloWorld, we don't need any traffic, so this is just a barebones implementation demonstrating the two nodes in use in DTS. Signed-off-by: Juraj Linkeš --- dts/framework/tg_node.py | 78 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 dts/framework/tg_node.py diff --git a/dts/framework/tg_node.py b/dts/framework/tg_node.py new file mode 100644 index 0000000000..109019e740 --- /dev/null +++ b/dts/framework/tg_node.py @@ -0,0 +1,78 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2010-2014 Intel Corporation +# Copyright(c) 2022 PANTHEON.tech s.r.o. +# + +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2010-2019 Intel Corporation +# Copyright(c) 2022 PANTHEON.tech s.r.o. +# + +""" +Interface for bulk traffic generators. +""" + +from framework.config import NodeConfiguration + +from .node import Node + + +class TrafficGeneratorNode(Node): + """ + A class for managing connections to the node running the Traffic generator, + providing methods that retrieve the necessary information about the node + (such as cpu, memory and NIC details), configure it and configure and + manage the Traffic generator. + """ + + def __init__(self, node_config: NodeConfiguration): + super(TrafficGeneratorNode, self).__init__(node_config) + # check the python version of TG + self.sut_nodes = [] + self.re_run_time = 0 + + def prerequisites(self): + """ + Setup hugepages and kernel modules on TG. + """ + self.kill_all() + + if not self.skip_setup: + total_huge_pages = self.get_total_huge_pages() + hugepages_size = self.send_expect( + "awk '/Hugepagesize/ {print $2}' /proc/meminfo", "# " + ) + if total_huge_pages == 0: + self.mount_huge_pages() + if hugepages_size == "524288": + self.set_huge_pages(8) + else: + self.set_huge_pages(1024) + + self.send_expect("modprobe uio", "# ") + + self.tg_prerequisites() + + def tg_prerequisites(self): + """ + Prerequest function should be called before execute any test case. + Will call function to scan all lcore's information which on TG. + """ + + self.init_core_list() + + self.disable_lldp() + + def set_re_run(self, re_run_time): + """ + set failed case re-run time + """ + self.re_run_time = int(re_run_time) + + def disable_lldp(self): + """ + Disable TG ports LLDP. + """ + result = self.send_expect("lldpad -d", "# ") + if result: + self.logger.error(result.strip()) -- 2.30.2