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 EF7E443335; Wed, 15 Nov 2023 08:05:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BE4A740261; Wed, 15 Nov 2023 08:05:09 +0100 (CET) Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) by mails.dpdk.org (Postfix) with ESMTP id 5F54A400EF for ; Wed, 15 Nov 2023 08:05:08 +0100 (CET) Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-6d33298f8fdso3766184a34.1 for ; Tue, 14 Nov 2023 23:05:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1700031907; x=1700636707; 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=0Ntvnr5SAG17W/4wpuefbmHFNENMH5ZljmeanEnX0zA=; b=eE/Xn5mF4R6CVQPZwi99rW+Us1KOC8cBk99ofJwmcPNtMazx7kCiTG+fwH1gRg0HS+ XGj3Iq1RGhYK6LYo03qbBNvTTfBqlnyq+QXu7H1AvhUL+JTMNyY79VqtsV8RC/K70GiC XKM5T6jveye0jsfyamwSI9+tpqE+zRT4j04AU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700031907; x=1700636707; 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=0Ntvnr5SAG17W/4wpuefbmHFNENMH5ZljmeanEnX0zA=; b=VeVHsBjJNk/68lDKujTNcuR4q9NtFk0fIDhKdaFu89a/4cEGGm5rCF85fcI1qvd6SK aziD40A8DtIAORXS1TrcPH3vzyTndu76e61aLsoBQ4bKiXegbFwFy7jD5I7t0pcFAVGb tYxnkEJt+s7AYHBiI/oGqiIAVAK/HHCWWi1AEJsXan+I+cVxFeS0H0yBZN5otdwLCoy3 0Qk+Gbk3hAOXHzYsr1dsoKA5t1DlwaZW1HjGAnWKtIw9/pIahzEqAdSrHUfCvPn1YSwN CQkLY08i/RXWKWQG84BAXIPkUAfl9LCicL+semexCsbZVVatPk6aOvl5YEtTc5RmWD5A 9Rbw== X-Gm-Message-State: AOJu0YyUtt13WNnm1rfC1nG1h2XlGllDVtFx/MyYuTz9wshX4MGY9pTs m7NGnp+3f8fUW0OVodKSiHthykdhNMeS4kV6linldQ== X-Google-Smtp-Source: AGHT+IGZQF+2HS9WZLJpiuZvU9lLCoNgeMdsLfP2AmfxslNnzlFM5IT5RdBDXihLWax3KZi4j70TA0uZ2QDiMFGoucA= X-Received: by 2002:a9d:744f:0:b0:6bd:b5f7:187a with SMTP id p15-20020a9d744f000000b006bdb5f7187amr5261742otk.20.1700031906830; Tue, 14 Nov 2023 23:05:06 -0800 (PST) MIME-Version: 1.0 References: <20231113202833.12900-1-jspewock@iol.unh.edu> <20231113202833.12900-2-jspewock@iol.unh.edu> In-Reply-To: <20231113202833.12900-2-jspewock@iol.unh.edu> From: Patrick Robb Date: Wed, 15 Nov 2023 02:04:56 -0500 Message-ID: Subject: Re: [PATCH v3 1/7] dts: Add scatter test suite To: jspewock@iol.unh.edu Cc: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru, dev@dpdk.org Content-Type: multipart/alternative; boundary="000000000000e9f6e0060a2b85e9" 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 --000000000000e9f6e0060a2b85e9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Nov 13, 2023 at 3:28=E2=80=AFPM wrote: > From: Jeremy Spewock > > This test suite provides testing the support of scattered packets by > Poll Mode Drivers using testpmd. It incorporates 5 different test cases > which test the sending and receiving of packets with lengths that are > less than the mbuf data buffer size, the same as the mbuf data buffer > size, and the mbuf data buffer size plus 1, 4, and 5. The goal of this > test suite is to align with the existing dts test plan for scattered > packets within DTS. > > Signed-off-by: Jeremy Spewock > --- > dts/tests/TestSuite_scatter.py | 86 ++++++++++++++++++++++++++++++++++ > 1 file changed, 86 insertions(+) > create mode 100644 dts/tests/TestSuite_scatter.py > > diff --git a/dts/tests/TestSuite_scatter.py > b/dts/tests/TestSuite_scatter.py > new file mode 100644 > index 0000000000..217f465e92 > --- /dev/null > +++ b/dts/tests/TestSuite_scatter.py > @@ -0,0 +1,86 @@ > +# SPDX-License-Identifier: BSD-3-Clause > +# Copyright(c) 2023 University of New Hampshire > + > +import struct > + > +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 scapy.utils import hexstr # type: ignore[import] > + > +from framework.remote_session import TestPmdShell > +from framework.test_suite import TestSuite > + > + > +class Scatter(TestSuite): > + mbsize: int > + > + def set_up_suite(self) -> None: > + self.verify( > + len(self._port_links) > 1, > + "Must have at least two port links to run scatter", > + ) > + if self._sut_port_egress.os_driver in ["i40e", "ixgbe", "ice"]: + self.mbsize =3D 2048 > + else: > + self.mbsize =3D 1024 > In old DTS there existed a registry of devices, and the scatter suite defined mbsize based on the specific NIC in use. I agree that using the os_driver accomplishes the same thing, and is a simpler implementation, but am just noting this change. > + > + self.tg_node.main_session.configure_port_mtu(9000, > self._tg_port_egress) > + self.tg_node.main_session.configure_port_mtu(9000, > self._tg_port_ingress) > + > + def scatter_pktgen_send_packet(self, pktsize: int) -> str: > + """Generate and send packet to the SUT. > + > + Functional test for scatter packets. > + > + Args: > + pktsize: Size of the packet to generate and send. > + """ > + packet =3D Ether() / IP() / Raw() > + packet.getlayer(2).load =3D "" > + payload_len =3D pktsize - len(packet) - 4 > + payload =3D ["58"] * payload_len > + # pack the payload > + for X_in_hex in payload: > + packet.load +=3D struct.pack( > + "=3DB", int("%s%s" % (X_in_hex[0], X_in_hex[1]), 16) > + ) > + load =3D hexstr(packet.getlayer(2), onlyhex=3D1) > + received_packets =3D self.send_packet_and_capture(packet) > + self.verify(len(received_packets) > 0, "Did not receive any > packets.") > + load =3D hexstr(received_packets[0].getlayer(2), onlyhex=3D1) > + > + return load > + > + def test_scatter_mbuf_2048(self) -> None: > + """ > + Test: > + Start testpmd and run functional test with preset mbsize. > + """ > + testpmd =3D self.sut_node.create_interactive_shell( > + TestPmdShell, > + app_parameters=3D( > + "--mbcache=3D200 " > + f"--mbuf-size=3D{self.mbsize} " > + "--max-pkt-len=3D9000 " > + "--port-topology=3Dpaired " > + "--tx-offloads=3D0x00008000" > + ), > + privileged=3DTrue, > + ) > Just noting that when starting testpmd, --port-topology=3Dloop from the original scatter suite is changed to --port-topology=3Dpaired in order to align with the recommended test topology for the new DTS framework, and thus is appropriate. Of course, it shouldn't affect the salient aspect of this test (checking scattered rx support). > + testpmd.send_command("set fwd mac") > + testpmd.send_command("start") > + link_is_up =3D testpmd.wait_link_status_up(0) and > testpmd.wait_link_status_up(1) > + self.verify(link_is_up, "Links never came up in TestPMD.") > + > + for offset in [-1, 0, 1, 4, 5]: > + recv_payload =3D self.scatter_pktgen_send_packet(self.mbsize= + > offset) > + self.verify( > + ("58 " * 8).strip() in recv_payload, > + "Received packet had incorrect payload", > + ) > + testpmd.send_command("stop") > + > + def tear_down_suite(self) -> None: > + self.tg_node.main_session.configure_port_mtu(1500, > self._tg_port_egress) > + self.tg_node.main_session.configure_port_mtu(1500, > self._tg_port_ingress) > -- > 2.42.0 > > In my opinion it looks like a good port of the scatter suite[1], with som= e inconsequential modifications made according to the design of the new DTS framework. Acked-by: Patrick Robb [1] https://git.dpdk.org/tools/dts/tree/tests/TestSuite_scatter.py --000000000000e9f6e0060a2b85e9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Mon, Nov 13, 2023 at 3:28=E2=80=AFPM &= lt;jspewock@iol.unh.edu> wro= te:
From: Jeremy= Spewock <jspe= wock@iol.unh.edu>

This test suite provides testing the support of scattered packets by
Poll Mode Drivers using testpmd. It incorporates 5 different test cases
which test the sending and receiving of packets with lengths that are
less than the mbuf data buffer size, the same as the mbuf data buffer
size, and the mbuf data buffer size plus 1, 4, and 5. The goal of this
test suite is to align with the existing dts test plan for scattered
packets within DTS.

Signed-off-by: Jeremy Spewock <jspewock@iol.unh.edu>
---
=C2=A0dts/tests/TestSuite_scatter.py | 86 +++++++++++++++++++++++++++++++++= +
=C2=A01 file changed, 86 insertions(+)
=C2=A0create mode 100644 dts/tests/TestSuite_scatter.py

diff --git a/dts/tests/TestSuite_scatter.py b/dts/tests/TestSuite_scatter.p= y
new file mode 100644
index 0000000000..217f465e92
--- /dev/null
+++ b/dts/tests/TestSuite_scatter.py
@@ -0,0 +1,86 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2023 University of New Hampshire
+
+import struct
+
+from scapy.layers.inet import IP=C2=A0 # type: ignore[import]
+from scapy.layers.l2 import Ether=C2=A0 # type: ignore[import]
+from scapy.packet import Raw=C2=A0 # type: ignore[import]
+from scapy.utils import hexstr=C2=A0 # type: ignore[import]
+
+from framework.remote_session import TestPmdShell
+from framework.test_suite import TestSuite
+
+
+class Scatter(TestSuite):
+=C2=A0 =C2=A0 mbsize: int
+
+=C2=A0 =C2=A0 def set_up_suite(self) -> None:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify(
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 len(self._port_links) > 1, +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "Must have at least two por= t links to run scatter",
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 )
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if self._sut_port_egress.os_driver in ["i= 40e", "ixgbe", "ice"]:=C2=A0
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.mbsize =3D 2048
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 else:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.mbsize =3D 1024

In old DTS there existed a registry of devices, an= d the scatter suite defined mbsize=C2=A0based on the specific NIC in use. I= agree that using the os_driver accomplishes the same thing, and is a simpl= er implementation, but am just noting this change.=C2=A0
=C2= =A0
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.tg_node.main_session.configure_port_mtu(9= 000, self._tg_port_egress)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.tg_node.main_session.configure_port_mtu(9= 000, self._tg_port_ingress)
+
+=C2=A0 =C2=A0 def scatter_pktgen_send_packet(self, pktsize: int) -> str= :
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Generate and send packet to = the SUT.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Functional test for scatter packets.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Args:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pktsize: Size of the packet to g= enerate and send.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 packet =3D Ether() / IP() / Raw()
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 packet.getlayer(2).load =3D ""
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 payload_len =3D pktsize - len(packet) - 4
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 payload =3D ["58"] * payload_len
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 # pack the payload
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 for X_in_hex in payload:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 packet.load +=3D struct.pack( +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "=3DB", = int("%s%s" % (X_in_hex[0], X_in_hex[1]), 16)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 )
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 load =3D hexstr(packet.getlayer(2), onlyhex=3D= 1)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 received_packets =3D self.send_packet_and_capt= ure(packet)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify(len(received_packets) > 0, &quo= t;Did not receive any packets.")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 load =3D hexstr(received_packets[0].getlayer(2= ), onlyhex=3D1)
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 return load
+
+=C2=A0 =C2=A0 def test_scatter_mbuf_2048(self) -> None:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Test:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Start testpmd and run functional= test with preset mbsize.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 testpmd =3D self.sut_node.create_interactive_s= hell(
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 TestPmdShell,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 app_parameters=3D(
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "--mbcache=3D= 200 "
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f"--mbuf-size= =3D{self.mbsize} "
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "--max-pkt-le= n=3D9000 "
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "--port-topol= ogy=3Dpaired "
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "--tx-offload= s=3D0x00008000"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ),
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 privileged=3DTrue,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 )

Just not= ing that when starting testpmd, --port-topology=3Dloop from the original sc= atter suite is changed to --port-topology=3Dpaired in order to align with t= he recommended test topology for the new DTS framework, and thus is appropr= iate. Of course, it shouldn't affect the salient aspect of this test (c= hecking scattered rx support).=C2=A0
=C2=A0
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 testpmd.send_command("set fwd mac")<= br> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 testpmd.send_command("start")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 link_is_up =3D testpmd.wait_link_status_up(0) = and testpmd.wait_link_status_up(1)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify(link_is_up, "Links never came= up in TestPMD.")
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 for offset in [-1, 0, 1, 4, 5]:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 recv_payload =3D self.scatter_pk= tgen_send_packet(self.mbsize + offset)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify(
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ("58 " *= 8).strip() in recv_payload,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "Received pac= ket had incorrect payload",
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 )
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 testpmd.send_command("stop")
+
+=C2=A0 =C2=A0 def tear_down_suite(self) -> None:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.tg_node.main_session.configure_port_mtu(1= 500, self._tg_port_egress)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.tg_node.main_session.configure_port_mtu(1= 500, self._tg_port_ingress)
--
2.42.0

In my opinion it looks like a good port of the scatter s= uite[1], with some inconsequential modifications made according to the desi= gn of the new DTS framework.=C2=A0

Acked-by: Patrick Rob= b <probb@iol.unh.edu>

--000000000000e9f6e0060a2b85e9--