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 0D3DF454BF; Fri, 21 Jun 2024 23:28:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F0E4C42EB0; Fri, 21 Jun 2024 23:28:12 +0200 (CEST) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mails.dpdk.org (Postfix) with ESMTP id 3F6C740041 for ; Fri, 21 Jun 2024 23:28:11 +0200 (CEST) Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-2c7d270912eso2030703a91.2 for ; Fri, 21 Jun 2024 14:28:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1719005290; x=1719610090; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=acTTQlj5Omi8s2yxjZCkFC+ixGsdp72NUiF08vslkaM=; b=SGwbmyzkmaSDKZkFwHKIYGjNpDlV9P+y0+/TDZLcBhmfYX+bqVd2qLh6wvSdIZVxof 6KYBb3E3JwlQ9//3d+ZGKAxL5TGpwlpzQBGkVGDfBl9mdl1TOBdBaA7LM9CMLALNvykG e/NdpxsZiiDYfkriLfIZRzNv77vuSJlaMhaGk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719005290; x=1719610090; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=acTTQlj5Omi8s2yxjZCkFC+ixGsdp72NUiF08vslkaM=; b=nOIgKNY7w0AOSTwcGj+e3Q200CqE6tfGxOYgtNggcBTzq64diD1G+tzq/E8maHIkBm aQr/789Sye4ShH3qqeTpz/hUQ+DlqK2VSEisOkxv6FvgpkBQi8vZJSdcf6+q+a3fsI74 SF63dOlpQdL9QSJWXhbVYwUof4+WmzQqZf++09PC+qm2y/PnLSaBTXuMMAb0URi5pcbM j3gXFDb7AJGS2GUkKpb1zDaV46Ddc6P4mNW+A6XE7LHN4eqcmrG001Li7BkK3nkVsim+ RLXDL1BIZ/xiRX9QVGSC7H69/OdcbZO9OhpqcOm25vEars4lXgI1N2RE5CUl7LInkoEO rPjg== X-Forwarded-Encrypted: i=1; AJvYcCVgzcKDixyIYwU8xhaiml2Cvw6lmVhqj0cUFF3oDk8DcxRoQxaCEs0QXvEB24AhqcHE7IqJx6oryzIsFKo= X-Gm-Message-State: AOJu0YzCgGC4+4A/QoMwyw+rFhKIRJfXM3n7tt9259PL/8Y19PaLuCix 4+TFoaOQyZ+DMugB+L9QXGnFfVXpSZbP0olK2ozbfOqcBaET04cp+UUFqRvN9gNFbOpK7E/2ssg 8HkABZ+SyCOMrLeDJY+/VRqSrC1ixnqD4wfdX9g== X-Google-Smtp-Source: AGHT+IGWn+K3GLyZGH0eCjmi3AbEUmu6AcG64vgC9ioeT3SC0+K+GbCFNMsDbEQ05+ezzjOuD/yrYdu67kTxnq2E4HA= X-Received: by 2002:a17:90a:bd86:b0:2c7:cf90:bd13 with SMTP id 98e67ed59e1d1-2c7cf90be27mr8113802a91.26.1719005290217; Fri, 21 Jun 2024 14:28:10 -0700 (PDT) MIME-Version: 1.0 References: <20240617194638.12926-2-dmarx@iol.unh.edu> <20240617194638.12926-4-dmarx@iol.unh.edu> In-Reply-To: <20240617194638.12926-4-dmarx@iol.unh.edu> From: Jeremy Spewock Date: Fri, 21 Jun 2024 17:27:58 -0400 Message-ID: Subject: Re: [PATCH v2 1/3] dts: initial queue start/stop suite implementation To: Dean Marx Cc: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, bruce.richardson@intel.com, luca.vizzarro@arm.com, dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Mon, Jun 17, 2024 at 3:47=E2=80=AFPM Dean Marx wrote= : > > This suite tests the ability of the Poll Mode Driver to enable and disabl= e > 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/TestSuit= e_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. I wonder if there is instead a way to validate that either packets aren't received on the port if Rx is disabled, or packets aren't sent if Tx is disabled rather than just showing that the full flow doesn't happen. I'm not sure the test really calls for it, but it might better show how the individual cases interact. > + > +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 TestPmdForwardingMode= s, 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. > + """ I think this doc-string would benefit from some more in-depth information about how the individual cases are tested and what they are. > + > + def set_up_suite(self) -> None: > + """Set up the test suite. > + > + Setup: > + Create a testpmd session and set up tg nodes We don't seem to be creating a testpmd shell or touching the TG in this setup method, so we should probably not include this line. > + verify that at least two ports are open for session Missing period at the end of this line. > + """ > + self.verify(len(self._port_links) > 1, "Not enough ports") > + > + def send_packet_and_verify(self, should_receive: bool =3D True): > + """Generate a packet, send to the DUT, and verify it is forwarde= d back. > + > + Args: > + should_receive: indicate whether the packet should be receiv= ed > + """ > + packet =3D Ether()/IP()/Raw(load=3D"xxxxx") > + received =3D self.send_packet_and_capture(packet) > + test_packet =3D None > + for packet in received: > + if packet.haslayer(Raw) and packet[Raw].load =3D=3D b'xxxxx'= : > + test_packet =3D packet > + break This feels very similar to what is happening in the VLAN test suite and if probably a good reason to sooner address this bugzilla ticket: https://bugs.dpdk.org/show_bug.cgi?id=3D1372 That's probably better done in another patch though. Regardless, I still think this could be done using the any() method that's built into python and it might be more concise. > + if should_receive: > + self.verify(test_packet is not None, "Packet was dropped whe= n it should have been received") > + else: > + self.verify(test_packet is None, "Packet was received when i= t should have been dropped") > + > + def test_all_queues_enabled(self) -> None: > + """Ensure packets are received when both Tx and Rx queues are en= abled. This method name and doc-string are confusing as it seems you are testing more than if it can receive traffic when the queues are enabled. It looks like you're actually also testing that the Rx and Tx don't function when they are stopped. These could also probably be different test cases as they are really testing two different things (Rx functionality vs Tx). > + > + 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 =3D self.sut_node.create_interactive_shell(TestPmdShell,= privileged=3DTrue) > + 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.""" This method stub isn't needed since it isn't extended here. > -- > 2.44.0 >