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 69A304577A; Fri, 9 Aug 2024 17:28:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4CD3242E9D; Fri, 9 Aug 2024 17:28:03 +0200 (CEST) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 2B58C4025F for ; Fri, 9 Aug 2024 17:28:01 +0200 (CEST) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1fc60c3ead4so18016045ad.0 for ; Fri, 09 Aug 2024 08:28:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1723217280; x=1723822080; 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=X5Omc2PtXvntz35aWtGqs0Jc5htTYzY1N0NMz4EmrhA=; b=boCVMvAVmGSpsI5AMVh0p4mMnyUPdajCujKF2Wt3tCBEVe+kJ4eTwlVsYDjHtY+S0k mj22Iy+i7j0lURr47FAcEUXyzRkw/nXy0NvEcevdZGFMJWa8RYe1qbYjWBlvY5JCrrEi /S83XspXTgLefjegkdaZikakGsYHv/ZFHz0MM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723217280; x=1723822080; 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=X5Omc2PtXvntz35aWtGqs0Jc5htTYzY1N0NMz4EmrhA=; b=O4xMg9Ky7bK2ls6GVv4T9puPli16CE15e4CE71WW3M+OQ1uajXTyrMj5DlHMWJTuqc nhKOSkx/1Uyis9HO8seiBUquwDUw4XzzHrNQnP+wLy2wKZfhp4YAWfOw8JrQ8k+N203l Y4uDIhdEby8FvKpBaCUww5LZFQhZhXdww3yem61zAD1v4I1Kf8gavgJEhHFwfMcNbfZ0 Y0FWdbzdA1S2JXho3chjRajEO2V9pDJ+9bE5Jr9jafHWc9JAnBqtyZIMnlWtwaEyY/Lc W/2n3/v1AFs8eyI4GyEnu42gI5f0KfrtmZtDPYJJUE/b2OT5shoD6PgrJwL9EZuYH0MS t/FA== X-Gm-Message-State: AOJu0YyiZ9I3r3ILOpLHdwaYmXw0ulsBb8G9F18rTdQShtnCoitfBTIR EgWiCRwFwDHVQsoAP4rF3YUzyAWLUMdNE7fFr+CWPH9+QFgiRa9sb0yDZThxM1FzmcJHNfXkjjT xCCnZZIcwOSQ+V/RIb1j8tdfnkXkNxbK4aKJz3w== X-Google-Smtp-Source: AGHT+IHKq5ej/pW6mMb81P91gzximg3yP50Mw2ZMQh3WtYEbd7hn7ZnzItOJAUAMGPvBWZb46EWvPw8vScDff9UaF2Y= X-Received: by 2002:a17:902:b589:b0:1fd:6529:744c with SMTP id d9443c01a7336-200ae4db981mr18394445ad.1.1723217279920; Fri, 09 Aug 2024 08:27:59 -0700 (PDT) MIME-Version: 1.0 References: <20240806125140.2582859-1-luca.vizzarro@arm.com> In-Reply-To: <20240806125140.2582859-1-luca.vizzarro@arm.com> From: Jeremy Spewock Date: Fri, 9 Aug 2024 11:27:48 -0400 Message-ID: Subject: Re: [PATCH] dts: add l2fwd test suite To: Luca Vizzarro Cc: dev@dpdk.org, =?UTF-8?Q?Juraj_Linke=C5=A1?= , Honnappa Nagarahalli , Paul Szczepanek 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 Hey Luca, Thanks for the patch! Just a few pretty minor comments below. On Tue, Aug 6, 2024 at 8:53=E2=80=AFAM Luca Vizzarro wrote: > > Add a basic L2 forwarding test suite which tests the correct > functionality of the forwarding facility built-in in the DPDK. > > The tests are performed with different queues numbers per port. > > Bugzilla ID: 1481 > > Signed-off-by: Luca Vizzarro > Reviewed-by: Paul Szczepanek > --- > Depends-on: series-32714 ("dts: add pktgen and testpmd changes") Out of my own curiosity, are depends on supposed to be outside of the commit body? I don't think it really matters for automation or anything regardless, but I just didn't know if there was a rule about it. > --- > dts/framework/config/conf_yaml_schema.json | 3 +- > dts/tests/TestSuite_l2fwd.py | 58 ++++++++++++++++++++++ > 2 files changed, 60 insertions(+), 1 deletion(-) > create mode 100644 dts/tests/TestSuite_l2fwd.py > > diff --git a/dts/framework/config/conf_yaml_schema.json b/dts/framework/c= onfig/conf_yaml_schema.json > index df390e8ae2..58a719a923 100644 > --- a/dts/framework/config/conf_yaml_schema.json > +++ b/dts/framework/config/conf_yaml_schema.json > @@ -187,7 +187,8 @@ > "enum": [ > "hello_world", > "os_udp", > - "pmd_buffer_scatter" > + "pmd_buffer_scatter", > + "l2fwd" > ] > }, > "test_target": { > diff --git a/dts/tests/TestSuite_l2fwd.py b/dts/tests/TestSuite_l2fwd.py > new file mode 100644 > index 0000000000..46f07b78eb > --- /dev/null > +++ b/dts/tests/TestSuite_l2fwd.py > @@ -0,0 +1,58 @@ This file looks like it is missing the copyright information at the top. > +"""Basic L2 forwarding test suite. > + > +This testing suites runs basic L2 forwarding on testpmd with different q= ueue sizes per port. The phrasing of "different queue sizes per port" makes me initially think that like, port 0 will have 2 queues and port 1 will have 4. Maybe something like "This testing suites runs basic L2 forwarding on testpmd across multiple different queue sizes" would make this more clear. > +The forwarding test is performed with several packets being sent at once= . > +""" > + > +from framework.params.testpmd import EthPeer, SimpleForwardingModes > +from framework.remote_session.testpmd_shell import TestPmdShell > +from framework.test_suite import TestSuite > +from framework.testbed_model.cpu import LogicalCoreCount > +from framework.utils import generate_random_packets > + > + > +class TestL2fwd(TestSuite): > + """L2 forwarding test suite.""" > + > + #: The total number of packets to generate and send for forwarding. > + NUMBER_OF_PACKETS_TO_SEND =3D 50 > + #: The payload size to use for the generated packets in bytes. > + PAYLOAD_SIZE =3D 100 > + > + def set_up_suite(self) -> None: > + """Set up the test suite. > + > + Setup: > + Verify that we have at least 2 ports in the current test. Ge= nerate the random packets > + that will be sent and spawn a reusable testpmd shell. Seems like this method is no longer spawning a testpmd shell, so this part of the doc-string is no longer relevant. > + """ > + self.verify(len(self.sut_node.ports) >=3D 2, "At least 2 ports a= re required for this test.") > + self.packets =3D generate_random_packets(self.NUMBER_OF_PACKETS_= TO_SEND, self.PAYLOAD_SIZE) > + > + def test_l2fwd_integrity(self) -> None: > + """Test the L2 forwarding integrity. > + > + Test: > + Configure a testpmd shell with a different numbers of queues= per run. Start up L2 It might make sense to name the numbers of queues in the doc-string just so that the rst for the suite is more clear. > + forwarding, send random packets from the TG and verify they = were all received back. > + """ > + queues =3D [1, 2, 4, 8] > + > + with TestPmdShell( > + self.sut_node, > + lcore_filter_specifier=3DLogicalCoreCount(cores_per_socket= =3D4), > + forward_mode=3DSimpleForwardingModes.mac, > + eth_peer=3D[EthPeer(1, self.tg_node.ports[1].mac_address)], > + disable_device_start=3DTrue, > + ) as shell: > + for queues_num in queues: > + self._logger.info(f"Testing L2 forwarding with {queues_n= um} queue(s)") > + shell.set_ports_queues(queues_num) > + shell.start() > + > + received_packets =3D self.send_packets_and_capture(self.= packets) > + > + expected_packets =3D [self.get_expected_packet(packet) f= or packet in self.packets] Ahh, the get_expected_packet method also sheds some light on how the match_all_packets could be useful. > + self.match_all_packets(expected_packets, received_packet= s) > + > + shell.stop() > -- > 2.34.1 >