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 3EBC945484; Mon, 17 Jun 2024 21:47:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 27D6E40B98; Mon, 17 Jun 2024 21:47:59 +0200 (CEST) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) by mails.dpdk.org (Postfix) with ESMTP id 9B3CA402BD for ; Mon, 17 Jun 2024 21:47:57 +0200 (CEST) Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-795502843ccso271213585a.1 for ; Mon, 17 Jun 2024 12:47:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1718653677; x=1719258477; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MZcDJ+KR6wV/bOSbWiOQYReNHuRZ4EpCEvVQNUWaxXw=; b=URP16f/tVjm9n/dltcEV7L3vFJoqpzOBiZ7YYZK+EH5smc4o7MNDZRFNju3BfrI3zT yDO1WepQdNrlN95WD+yAlFwv7WgWa5G1VdTHG8aGuE6EvuyDA8FbZmU7VJj+1H+BkBLC DdRxPP6wLBqPjDNh91YO8QEb16/qSnPeWZNPw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718653677; x=1719258477; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MZcDJ+KR6wV/bOSbWiOQYReNHuRZ4EpCEvVQNUWaxXw=; b=st3NORV4Nkz6cRfeSQGTrnL4DTO9BywxDICUP8JFrWoiiZmJbW/ftWjrci32qfyNMO IY9mtCST2gR4FR9ReNxY+wEiFecx06zHkcFjJwvUk7kl5Za/spyz+/jNiut+UAut3R5S MldwAHdCYJLPIWD9r1gqOBVq9vTAhZIDmTdlV6b1bgppApjEXo32I8NZMPv4W9M3jB9c nDEqHKI4qrjZFWGp7gAtCzRUmREa1qTYb0/TeyG0cKmAoG8JGt3KwgsDnvookccn+gk1 Yz7vcn1k020LNMP0GmAAoz002p6R1JlJuqA8/XIwoLwPIxMqjT8pms3alK3+3dM/TrbZ 2R7A== X-Gm-Message-State: AOJu0YyQj4pvjETVvNbnrIIu/wizdby/Gxjc2fWUQuFnLtTMgvAdyRpE QZPrj1Y5hD6V4DgRb/4uqiIYoZmlfbtEDYbT+f2dTCPGCtAP0apSnERujpuokz4= X-Google-Smtp-Source: AGHT+IF2fZMGu2OJoPyAks6DuQesmAbzvOQdJgzb6BZONhNDRefYCLkLGKZ+7pCw3/mYVZhBN6vt7Q== X-Received: by 2002:a05:620a:31a6:b0:795:d19b:5e4b with SMTP id af79cd13be357-798d258de01mr1340575185a.52.1718653676853; Mon, 17 Jun 2024 12:47:56 -0700 (PDT) Received: from dean-laptop.iol.unh.edu ([2606:4100:3880:1210:52ef:3eaf:5f1e:6f6a]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aacae6eesm459167185a.16.2024.06.17.12.47.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 12:47:56 -0700 (PDT) From: Dean Marx To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, jspewock@iol.unh.edu, bruce.richardson@intel.com, luca.vizzarro@arm.com Cc: dev@dpdk.org, Dean Marx Subject: [PATCH v2 1/3] dts: initial queue start/stop suite implementation Date: Mon, 17 Jun 2024 15:46:38 -0400 Message-ID: <20240617194638.12926-4-dmarx@iol.unh.edu> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240617194638.12926-2-dmarx@iol.unh.edu> References: <20240617194638.12926-2-dmarx@iol.unh.edu> MIME-Version: 1.0 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 This suite tests the ability of the Poll Mode Driver to enable and disable Rx/Tx queues on a port. Signed-off-by: Dean Marx --- dts/tests/TestSuite_queue_start_stop.py | 79 +++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 dts/tests/TestSuite_queue_start_stop.py diff --git a/dts/tests/TestSuite_queue_start_stop.py b/dts/tests/TestSuite_queue_start_stop.py new file mode 100644 index 0000000000..e180b916e8 --- /dev/null +++ b/dts/tests/TestSuite_queue_start_stop.py @@ -0,0 +1,79 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2024 University of New Hampshire + +"""Rx/Tx queue start and stop functionality suite. + +This suite tests the ability of the poll mode driver to start and +stop either the Rx or Tx queue (depending on the port) during runtime, +and verify that packets are not received when one is disabled. + +Given a paired port topology, the Rx queue will be disabled on port 0, +and the Tx queue will be disabled on port 1. + +""" + +from scapy.layers.inet import IP # type: ignore[import] +from scapy.layers.l2 import Ether # type: ignore[import] +from scapy.packet import Raw # type: ignore[import] + +from framework.remote_session.testpmd_shell import TestPmdForwardingModes, TestPmdShell +from framework.test_suite import TestSuite + +class TestQueueStartStop(TestSuite): + """DPDK Queue start/stop test suite. + + Ensures Rx/Tx queue on a port can be disabled and enabled. + Verifies packets are not received when either queue is disabled. + """ + + def set_up_suite(self) -> None: + """Set up the test suite. + + Setup: + Create a testpmd session and set up tg nodes + verify that at least two ports are open for session + """ + self.verify(len(self._port_links) > 1, "Not enough ports") + + def send_packet_and_verify(self, should_receive: bool = True): + """Generate a packet, send to the DUT, and verify it is forwarded back. + + Args: + should_receive: indicate whether the packet should be received + """ + packet = Ether()/IP()/Raw(load="xxxxx") + received = self.send_packet_and_capture(packet) + test_packet = None + for packet in received: + if packet.haslayer(Raw) and packet[Raw].load == b'xxxxx': + test_packet = packet + break + if should_receive: + self.verify(test_packet is not None, "Packet was dropped when it should have been received") + else: + self.verify(test_packet is None, "Packet was received when it should have been dropped") + + def test_all_queues_enabled(self) -> None: + """Ensure packets are received when both Tx and Rx queues are enabled. + + Test: + Create an interactive testpmd session, stop Rx queue on port 0, verify + packets are dropped. Then start port 0 Rx queue, stop port 1 Tx queue, and + verify packets are dropped.""" + testpmd = self.sut_node.create_interactive_shell(TestPmdShell, privileged=True) + testpmd.set_forward_mode(TestPmdForwardingModes.mac) + testpmd.stop_port_queue(0, 0, True) + + testpmd.start() + self.send_packet_and_verify(False) + testpmd.stop() + + testpmd.start_port_queue(0, 0, True) + testpmd.stop_port_queue(1, 0, False) + + testpmd.start() + self.send_packet_and_verify(False) + testpmd.close() + + def tear_down_suite(self) -> None: + """Tear down the suite.""" -- 2.44.0