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 134AA45ED5; Wed, 18 Dec 2024 04:05:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A1F63402AE; Wed, 18 Dec 2024 04:05:33 +0100 (CET) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mails.dpdk.org (Postfix) with ESMTP id 0B92B402A1 for ; Wed, 18 Dec 2024 04:05:32 +0100 (CET) Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-72764c995e5so3675267b3a.2 for ; Tue, 17 Dec 2024 19:05:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1734491132; x=1735095932; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=8PrJvNRK61iAf+bBqxa/9oJJTHl2qzWzxV3O2CWNSNY=; b=2yxQa0g3xhijCFu9pwapGPd+3EvGURf9eSNJfmcEDGd0UbqeUqvWggKBW+l7Qys/BJ cwcXWnxJn7uYz4Y+CS/fNxEKJEZJweHcIjIggSV9PnlXb/4rb0kU1F5rpV7+1OmLNJWJ NZ8Zkk8YW8Dzdn4skKehOCCB2ClWsFXNWwzqAG5/Ez6KLDk0fP83R/8ZtadQXpJP4+v7 OT1Vplq8LVEBNUog68iHVCLz4tRONWsuQjyXuy9g9lrGCSnTri+Z/yvJjBcNB6reJwwB VZ4gFXJC35gLP5ubwaXzZTO1qLsKwLYWaShGdio8Fokh/bav3HZdYig363LXkEVwrJtx kqJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734491132; x=1735095932; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8PrJvNRK61iAf+bBqxa/9oJJTHl2qzWzxV3O2CWNSNY=; b=YhAnaZAf29zsWmntqx8Y7sIYqwa0XF7ZNN2COHpNYc7PXp9a0O2NZSFyvAPjSHwfCj bj7LYj42R+SeVnYhqHEr4WMf3z+E+hbH5nXDsTFsG68E8O1dHvHVQh9F/nk5KAo43zVi wjmSnO3hBvi5eNDlMU8/82eO5grEEc+wTl3/opiMEVPD2w1V9wPO5E2LIA1i8By60GcE UJQrQ4jeUI+KeKJiy7FWHRSJQqU+Bu0AWmv58IGuKpQ1T32RVDdBHjEE6KHY3XQl3t4H /K6STIzKtpQJDIfAkSjaUgQB103ZqFlolQtvpu31wKNeyQXbfUSpP1eqrBV76ukcf2bU AaiQ== X-Forwarded-Encrypted: i=1; AJvYcCVAioxfM0WdGEgL0Ogbm0kpQMYhWEzXGrs3m2xQhEbMw289tfSa0a/ih95eYTroHvyhwzI=@dpdk.org X-Gm-Message-State: AOJu0YydXkK+IOfZcb9DHeU7YIYl+b7S+fwd1kBsEI72XF2qBWEgfooX W+lmM19Js/G1OUJS5NjbU8q5mjNW2U8/r5HIKOW2WJXCJeBdcPkIhOhayuHTr14= X-Gm-Gg: ASbGncvMArcA/UbE3JCk07se9uirv9BX9WGmbh7a0DUroulbLmLD7iXWS7vRtkvJF48 mxOOvoJvoFx0kU5UmSTZOsn0B35po6S9qEkgnOmqE1yDm9UPPW5fAlUEr+42+sSb5Xw2ZWb7EJQ R6YBIwWqVRjSDvlbf/OiafLdNDb/lN2Y/UxMieQcS7wueNFHq8zf/LaxEq0UertjIoR9JpH8XA4 eKs2SJI3LvQIv9btdnPZGEf6cEWSA3q9hu5iuQpCTtKE7eB/F4X6kWfzZk5gyiKfohU8BQ5j2Gg obmfAd9XS9zh6CHpqZ4PC/GhwdVb/rnXfw== X-Google-Smtp-Source: AGHT+IGCALEfLQJYoAueQss83e5OP2d0hpx7ldIA55wKj+9wJWdSAw3lSDjZ5Qze0nC9JNTak97B9Q== X-Received: by 2002:a05:6a21:78a3:b0:1d5:10d6:92b9 with SMTP id adf61e73a8af0-1e5b487a751mr2192640637.30.1734491131942; Tue, 17 Dec 2024 19:05:31 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72918af1040sm7443638b3a.83.2024.12.17.19.05.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2024 19:05:31 -0800 (PST) Date: Tue, 17 Dec 2024 19:05:29 -0800 From: Stephen Hemminger To: Dean Marx Cc: probb@iol.unh.edu, npratte@iol.unh.edu, luca.vizzarro@arm.com, yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com, dev@dpdk.org, Jeremy Spewock Subject: Re: [PATCH v12] dts: port over queue start/stop suite Message-ID: <20241217190529.319f3a08@hermes.local> In-Reply-To: <20241217230837.27594-1-dmarx@iol.unh.edu> References: <20241118195929.13730-1-dmarx@iol.unh.edu> <20241217230837.27594-1-dmarx@iol.unh.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Tue, 17 Dec 2024 18:08:37 -0500 Dean Marx wrote: > 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 > Reviewed-by: Jeremy Spewock > --- > dts/tests/TestSuite_queue_start_stop.py | 89 +++++++++++++++++++++++++ > 1 file changed, 89 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..389030ae8c > --- /dev/null > +++ b/dts/tests/TestSuite_queue_start_stop.py > @@ -0,0 +1,89 @@ > +# 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-untyped] > +from scapy.layers.l2 import Ether # type: ignore[import-untyped] > +from scapy.packet import Raw # type: ignore[import-untyped] > + > +from framework.remote_session.testpmd_shell import SimpleForwardingModes, TestPmdShell > +from framework.test_suite import TestSuite, func_test > +from framework.testbed_model.capability import NicCapability, TopologyType, requires > + > + > +@requires(topology_type=TopologyType.two_links) > +@requires(NicCapability.RUNTIME_RX_QUEUE_SETUP) > +@requires(NicCapability.RUNTIME_TX_QUEUE_SETUP) > +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. > + The suite contains two test cases, Rx queue start/stop and > + Tx queue start/stop, which each disable the corresponding > + queue and verify that packets are not received/forwarded. > + """ > + > + def send_packet_and_verify(self, should_receive: bool = True) -> None: > + """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) > + contains_packet = any( > + packet.haslayer(Raw) and b"xxxxx" in packet.load for packet in received > + ) > + self.verify( > + should_receive == contains_packet, > + f"Packet was {'dropped' if should_receive else 'received'}", > + ) > + > + @func_test > + def test_rx_queue_start_stop(self) -> None: > + """Verify packets are not received by port 0 when Rx queue is disabled. > + > + Test: > + Create an interactive testpmd session, stop Rx queue on port 0, verify > + packets are not received. > + """ > + with TestPmdShell(node=self.sut_node) as testpmd: > + testpmd.set_forward_mode(SimpleForwardingModes.mac) > + testpmd.stop_port_queue(0, 0, True) > + testpmd.start() > + self.send_packet_and_verify(should_receive=False) > + stats = testpmd.show_port_stats(port_id=0) > + self.verify( > + stats.rx_packets == 0, > + "Packets were received on Rx queue when it should've been disabled", > + ) > + > + @func_test > + def test_tx_queue_start_stop(self) -> None: > + """Verify packets are not forwarded by port 1 when Tx queue is disabled. > + > + Test: > + Create an interactive testpmd session, stop Tx queue on port 1, verify > + packets are not forwarded. > + """ > + with TestPmdShell(node=self.sut_node) as testpmd: > + testpmd.set_forward_mode(SimpleForwardingModes.mac) > + testpmd.stop_port_queue(1, 0, False) > + testpmd.start() > + self.send_packet_and_verify(should_receive=False) > + stats = testpmd.show_port_stats(port_id=1) > + self.verify( > + stats.tx_packets == 0, > + "Packets were forwarded on Tx queue when it should've been disabled", > + ) If you are going to test start/stop make sure to use deferred start in at least one test. Support start/stop without supporting deferred start would be a bug for me.