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 1C6F445CF8; Wed, 13 Nov 2024 16:39:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0AED440698; Wed, 13 Nov 2024 16:39:11 +0100 (CET) Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by mails.dpdk.org (Postfix) with ESMTP id 7EB8F40290 for ; Wed, 13 Nov 2024 16:39:09 +0100 (CET) Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-7ede82dbb63so3690864a12.2 for ; Wed, 13 Nov 2024 07:39:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1731512349; x=1732117149; darn=dpdk.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Y65Z1lJwhbV6k+p86fg/MRE8X3kDLxpIsqBMCnx5tzI=; b=R8oLtonObPYLzxmGLAtN/3kKB7YusvWd9g6GQj59ubuuzC9l9p+X/mi3JlfMXA8oys L0ABOglQtS3tA9y0JJ4uVWtmZRhFv3W20rjLeQBDKHJthIh9wxTUtmWq9RbPZcKm6odL uMVWXvnvrLjdKHsFTiiCk0lMsZjTuFZb70Uys= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731512349; x=1732117149; h=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=Y65Z1lJwhbV6k+p86fg/MRE8X3kDLxpIsqBMCnx5tzI=; b=MCiEUvgRvChI+lNcvzh+H06GiPeVi1GO6ihC4sHHWtrHh+Y4PguA/9/S9nrn7W6il/ 0Vy+C1wVz0AQM49X6I0jMBdGJIlCtSdARJ68qo0ZyLPD1TOGZBAk7OnJL9RUON9TR9vW vPp4BWS4g8V6uPjybqk4Pqoo7xXLF+kTuXLERM+XOm+vhHwvtc3jDisHGlxLKrSCic3I sbmFsk0s+VER0+fflAVM3fnn3nA/ytNAErD4jXvpXYxwU1uOiDz4UdBKW1fBwtO8OEk4 TRQaeYugY81nKSaAonPF9qiOBrio8QRVQ8xbGpMQEkDerjqHGuJWTvgy8ZFUhZ08FLta J1cA== X-Gm-Message-State: AOJu0YwVCIMvbZ2189VfMWfcA4IcDCC2BUaAtedzHL0husj3kNgRdIpF uWxmRy30I+zJBg1uMRSdb4NDLD2y6WaAmGPDmD6osM0vqTu9+1c6bO/3rQsCPeObTpKrgt6IKu8 bxfefb95BrjZB66N0PMU1xBM59yuJzbbfxdc5wg== X-Google-Smtp-Source: AGHT+IFB5rm01FoVEY4isMUBIIHi7QXADuySCwmcveLc/yWNqRMcJTtu9A0UK9z5I8CIqNj5TBjsin/AzAlD94ImLWE= X-Received: by 2002:a17:90b:164a:b0:2d8:da35:b4d6 with SMTP id 98e67ed59e1d1-2e9b1713989mr26140775a91.14.1731512348598; Wed, 13 Nov 2024 07:39:08 -0800 (PST) MIME-Version: 1.0 References: <20240806125140.2582859-1-luca.vizzarro@arm.com> <20241108170138.203096-1-luca.vizzarro@arm.com> <20241108170138.203096-4-luca.vizzarro@arm.com> In-Reply-To: <20241108170138.203096-4-luca.vizzarro@arm.com> From: Patrick Robb Date: Wed, 13 Nov 2024 10:37:14 -0500 Message-ID: Subject: Re: [PATCH v3 3/3] dts: add l2fwd test suite To: Luca Vizzarro Cc: dev@dpdk.org, Paul Szczepanek , Thomas Wilks , Dean Marx Content-Type: multipart/alternative; boundary="0000000000007690110626cd229e" 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 --0000000000007690110626cd229e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Reviewed-by: Patrick Robb Tested-by: Patrick Robb On Fri, Nov 8, 2024 at 12:01=E2=80=AFPM 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. > > Signed-off-by: Luca Vizzarro > Signed-off-by: Thomas Wilks > Reviewed-by: Paul Szczepanek > Reviewed-by: Dean Marx > Reviewed-by: Patrick Robb > Tested-by: Patrick Robb > --- > dts/tests/TestSuite_l2fwd.py | 63 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 63 insertions(+) > create mode 100644 dts/tests/TestSuite_l2fwd.py > > diff --git a/dts/tests/TestSuite_l2fwd.py b/dts/tests/TestSuite_l2fwd.py > new file mode 100644 > index 0000000000..0f6ff18907 > --- /dev/null > +++ b/dts/tests/TestSuite_l2fwd.py > @@ -0,0 +1,63 @@ > +# SPDX-License-Identifier: BSD-3-Clause > +# Copyright(c) 2024 Arm Limited > + > +"""Basic L2 forwarding test suite. > + > +This testing suites runs basic L2 forwarding on testpmd across multiple > different queue sizes. > +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, func_test > +from framework.testbed_model.capability import requires > +from framework.testbed_model.cpu import LogicalCoreCount > +from framework.testbed_model.topology import TopologyType > +from framework.utils import generate_random_packets > + > + > +@requires(topology_type=3DTopologyType.two_links) > +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: > + Generate the random packets that will be sent. > + """ > + self.packets =3D > generate_random_packets(self.NUMBER_OF_PACKETS_TO_SEND, self.PAYLOAD_SIZE= ) > + > + @func_test > + def l2fwd_integrity(self) -> None: > + """Test the L2 forwarding integrity. > + > + Test: > + Configure a testpmd shell with a different numbers of queues > (1, 2, 4 and 8) per run. > + Start up L2 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_num} 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_packets(self.pack= ets) > + self.match_all_packets(expected_packets, received_packet= s) > + > + shell.stop() > -- > 2.43.0 > > --0000000000007690110626cd229e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Reviewed-by: Patrick Robb <probb@iol.unh.edu>
Tested-by: Patrick Robb <probb@iol.unh.edu>

On Fri, Nov 8,= 2024 at 12:01=E2=80=AFPM Luca Vizzarro <luca.vizzarro@arm.com> 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.

Signed-off-by: Luca Vizzarro <luca.vizzarro@arm.com>
Signed-off-by: Thomas Wilks <thomas.wilks@arm.com>
Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
Reviewed-by: Dean Marx <dmarx@iol.unh.edu>
Reviewed-by: Patrick Robb <probb@iol.unh.edu>
Tested-by: Patrick Robb <probb@iol.unh.edu>
---
=C2=A0dts/tests/TestSuite_l2fwd.py | 63 +++++++++++++++++++++++++++++++++++= +
=C2=A01 file changed, 63 insertions(+)
=C2=A0create mode 100644 dts/tests/TestSuite_l2fwd.py

diff --git a/dts/tests/TestSuite_l2fwd.py b/dts/tests/TestSuite_l2fwd.py new file mode 100644
index 0000000000..0f6ff18907
--- /dev/null
+++ b/dts/tests/TestSuite_l2fwd.py
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2024 Arm Limited
+
+"""Basic L2 forwarding test suite.
+
+This testing suites runs basic L2 forwarding on testpmd across multiple di= fferent queue sizes.
+The forwarding test is performed with several packets being sent at once.<= br> +"""
+
+from framework.params.testpmd import EthPeer, SimpleForwardingModes
+from framework.remote_session.testpmd_shell import TestPmdShell
+from framework.test_suite import TestSuite, func_test
+from framework.testbed_model.capability import requires
+from framework.testbed_model.cpu import LogicalCoreCount
+from framework.testbed_model.topology import TopologyType
+from framework.utils import generate_random_packets
+
+
+@requires(topology_type=3DTopologyType.two_links)
+class TestL2fwd(TestSuite):
+=C2=A0 =C2=A0 """L2 forwarding test suite."""= ;
+
+=C2=A0 =C2=A0 #: The total number of packets to generate and send for forw= arding.
+=C2=A0 =C2=A0 NUMBER_OF_PACKETS_TO_SEND =3D 50
+=C2=A0 =C2=A0 #: The payload size to use for the generated packets in byte= s.
+=C2=A0 =C2=A0 PAYLOAD_SIZE =3D 100
+
+=C2=A0 =C2=A0 def set_up_suite(self) -> None:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Set up the test suite.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Setup:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Generate the random packets that= will be sent.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.packets =3D generate_random_packets(self.= NUMBER_OF_PACKETS_TO_SEND, self.PAYLOAD_SIZE)
+
+=C2=A0 =C2=A0 @func_test
+=C2=A0 =C2=A0 def l2fwd_integrity(self) -> None:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Test the L2 forwarding integ= rity.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Test:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Configure a testpmd shell with a= different numbers of queues (1, 2, 4 and 8) per run.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Start up L2 forwarding, send ran= dom packets from the TG and verify they were all
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 received back.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 queues =3D [1, 2, 4, 8]
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 with TestPmdShell(
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.sut_node,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 lcore_filter_specifier=3DLogical= CoreCount(cores_per_socket=3D4),
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 forward_mode=3DSimpleForwardingM= odes.mac,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 eth_peer=3D[EthPeer(1, self.tg_n= ode.ports[1].mac_address)],
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 disable_device_start=3DTrue,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 ) as shell:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for queues_num in queues:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self._logger.info(f&q= uot;Testing L2 forwarding with {queues_num} queue(s)")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 shell.set_ports_qu= eues(queues_num)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 shell.start()
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 received_packets = =3D self.send_packets_and_capture(self.packets)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 expected_packets = =3D self.get_expected_packets(self.packets)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.match_all_pac= kets(expected_packets, received_packets)
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 shell.stop()
--
2.43.0

--0000000000007690110626cd229e--