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 A2E7246A55; Wed, 25 Jun 2025 19:30:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A20440E03; Wed, 25 Jun 2025 19:30:31 +0200 (CEST) Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by mails.dpdk.org (Postfix) with ESMTP id D7AB840B90 for ; Wed, 25 Jun 2025 19:30:29 +0200 (CEST) Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-b26f7d2c1f1so143958a12.0 for ; Wed, 25 Jun 2025 10:30:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1750872629; x=1751477429; 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=Tkl0Dd2y1LPKTlmO1vXFkU9fBfwkKdJt2yk4PtMS7vk=; b=QUk3eUDahFvyk70to6kwJpSE4uGebPnCI2+waq8dmqMrb0tjPBJ3pmCi65Y/EB3UPx CeIjNf5HppxZvJxLMZIGHqpRIg4Xz2x43zKI4+Zh8H9wonYqYpxOKfs9KUpGZn2d0YCx 1j6O8kNbESUlrWoHXCoCgvhcRSzdEA0PhYzT0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750872629; x=1751477429; 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=Tkl0Dd2y1LPKTlmO1vXFkU9fBfwkKdJt2yk4PtMS7vk=; b=SpWVwYKIqkN5qPxwAVJndn6WYf2y7u9AuwbZ+6dfpkawXWK/3KtasHolXHKhC9bg4N 1qOpME/5kaij0W+b/pdXIFiMTQoLBj+3Z3RmEowbOpuJOaIoCke0PyHvU3tU88Zh1I32 eyguGNnF/i74LLt+ztOJEyR0SCPx7dvo+T2zMnQUac/KaAiMLK9iSStuJzpCN4xBaepi ZE6TdFjus8FbqbSGR7Voxb5mPiMbh8hzrBhjEk+JwZ0+BDWKoAPw/7oMNd93Z4wGrg6p GxK0uxi/e+bxxNOOapui77JNdNz33hDlM2+baX10l9t7SSa+Pno1sbtATIMfWqPL1slv y/Zg== X-Forwarded-Encrypted: i=1; AJvYcCXqOpzvf9W3qR3eezHOX8S8YdmNv7VVU9RdLJf2KukluVvnLcqV2JeQqsUnMrOJ1uenifE=@dpdk.org X-Gm-Message-State: AOJu0YxG438s+HW3ui7/dpDFxsdU2w5Txv1Mz49LtqzbPy11g3goPi8y g2yDe7R8I8kmKNPINi+NCA0KT6zI/0C68i7GEaeZPGpLq5L/CnR3V67JBXEKaz8FKDcFlnao7pO IZTxz+pUwpJAT86wWNFVhwdcK3U70rlm/xDznapx2VA== X-Gm-Gg: ASbGncvZAm5MyBKIEVZ42eHZnb5m4tnXwh0bIFzY73XKRkgWVMXyYcMLtRhCcrr4d3k i2ca875FhvmT1H+3Ctchpw+lMBETaa9N5jU3Gy5nrvrF+C1BPV7qRy6RjyLJzz8dG6WUNig2Erj LF4Ib6ffI+xXNMmj2dpixz6bqKLK4jucup8zG6pYxMZyq6NudiigHXZXI7CoOBxpzkxICh2nYNj UBR X-Google-Smtp-Source: AGHT+IFjGglj0Y7yYXccFQNtqjgQb/0D84GzkAUpDGB/K2Z04VXHkI7TpS5FMDAfT1ojzwWLtwVeMUYv8CbZxnvelM4= X-Received: by 2002:a17:90b:4fcb:b0:312:e279:9ccf with SMTP id 98e67ed59e1d1-315f25caa70mr5253154a91.5.1750872628752; Wed, 25 Jun 2025 10:30:28 -0700 (PDT) MIME-Version: 1.0 References: <20250519181957.228084-1-dmarx@iol.unh.edu> <20250521192629.294265-1-dmarx@iol.unh.edu> <20250521192629.294265-2-dmarx@iol.unh.edu> In-Reply-To: <20250521192629.294265-2-dmarx@iol.unh.edu> From: Patrick Robb Date: Wed, 25 Jun 2025 13:25:03 -0400 X-Gm-Features: AX0GCFvV4h3mW4Fc86w2Resf_1Gah_IJdwPYYbhwge89Ync_em3Vb0cnZIPu81U Message-ID: Subject: Re: [PATCH v2 2/3] dts: add jump and priority tests to flow suite To: Dean Marx Cc: luca.vizzarro@arm.com, yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com, dev@dpdk.org Content-Type: multipart/alternative; boundary="000000000000159003063868cd98" 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 --000000000000159003063868cd98 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, May 21, 2025 at 3:26=E2=80=AFPM Dean Marx wrote= : > Add jump action verification method and test case to Flow API test suite, > as well as a case for validating flows with different priority levels. > > Signed-off-by: Dean Marx > --- > dts/tests/TestSuite_flow.py | 187 +++++++++++++++++++++++++++++++----- > 1 file changed, 165 insertions(+), 22 deletions(-) > > diff --git a/dts/tests/TestSuite_flow.py b/dts/tests/TestSuite_flow.py > index 15566205c9..06bd3bedc5 100644 > --- a/dts/tests/TestSuite_flow.py > +++ b/dts/tests/TestSuite_flow.py > @@ -29,7 +29,7 @@ > class TestFlow(TestSuite): > """RTE Flow test suite. > > > + > + @func_test > + def test_jump_action(self) -> None: > + """Validate flow rules with different group levels and jump > actions. > + > + Steps: > + Create a list of packets to test, with a corresponding flow > list. > + Launch testpmd with the necessary configuration. > + Create each flow rule in testpmd. > + Send each packet in the list, check Rx queue ID. > + > + Verify: > + Check that each packet is received on the appropriate Rx > queue. > + """ > + packet_list =3D [Ether() / IP(), Ether() / IP() / TCP(), Ether()= / > IP() / UDP()] > + flow_list =3D [ > + FlowRule(direction=3D"ingress", group_id=3D0, pattern=3D["et= h"], > actions=3D["jump group 1"]), > + FlowRule(direction=3D"ingress", group_id=3D0, pattern=3D["ip= v4"], > actions=3D["jump group 2"]), > + FlowRule( > + direction=3D"ingress", group_id=3D0, pattern=3D["eth / i= pv4"], > actions=3D["queue index 1"] > + ), > + FlowRule( > + direction=3D"ingress", > + group_id=3D0, > + pattern=3D["eth / ipv4 / tcp"], > + actions=3D["queue index 2"], > + ), > + FlowRule( > + direction=3D"ingress", > + group_id=3D0, > + pattern=3D["eth / ipv4 / udp"], > + actions=3D["queue index 3"], > + ), > + ] > + expected_queue_list =3D [1, 2, 3] > + with TestPmdShell(rx_queues=3D4, tx_queues=3D4) as testpmd: > + self.send_packet_and_verify_jump( > + packets=3Dpacket_list, > + flow_rules=3Dflow_list, > + test_queues=3Dexpected_queue_list, > + testpmd=3Dtestpmd, > + ) > It looks like the 2nd and 3rd flow rule need to be added to group_id 1 and 2 respectively, instead of 0 and 0, in order for the jumps to groups 1 and 2 to have the desired effect you are validating on. > + > + @func_test > + def test_priority_attribute(self) -> None: > + """Validate flow rules with queue actions and ethernet patterns. > + > + Steps: > + Create a list of packets to test, with a corresponding flow > list. > + Launch testpmd. > + Create first flow rule in flow list. > + Send first packet in packet list, capture verbose output. > + Delete flow rule, repeat for all flows/packets. > + > + Verify: > + Check that each packet is received on the appropriate queue. > + """ > + test_packet =3D Ether() / IP() / Raw() > + flow_list =3D [ > + FlowRule( > + direction=3D"ingress", > + priority_level=3D3, > + pattern=3D["eth / ipv4"], > + actions=3D["queue index 1"], > + ), > + FlowRule( > + direction=3D"ingress", > + priority_level=3D2, > + pattern=3D["eth / ipv4"], > + actions=3D["queue index 2"], > + ), > + FlowRule( > + direction=3D"ingress", > + priority_level=3D1, > + pattern=3D["eth / ipv4"], > + actions=3D["queue index 3"], > + ), > + ] > + expected_queue_list =3D [1, 2, 3] > + with TestPmdShell(rx_queues=3D4, tx_queues=3D4) as testpmd: > + testpmd.set_verbose(level=3D1) > + for flow, expected_queue in zip(flow_list, > expected_queue_list): > + testpmd.flow_create(flow_rule=3Dflow, port_id=3D0) > + testpmd.start() > + self.send_packet_and_capture(test_packet) > + verbose_output =3D > testpmd.extract_verbose_output(testpmd.stop()) > + received =3D False > + for testpmd_packet in verbose_output: > + if testpmd_packet.queue_id =3D=3D expected_queue: > + received =3D True > + self.verify(received, f"Packet was not received on queue > {expected_queue}") > -- > 2.49.0 > Reviewed-by: Patrick Robb --000000000000159003063868cd98 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Wed, May 21,= 2025 at 3:26=E2=80=AFPM Dean Marx <dmarx@iol.unh.edu> wrote:
Add jump action verification method and test case to Flow= API test suite,
as well as a case for validating flows with different priority levels.

Signed-off-by: Dean Marx <dmarx@iol.unh.edu>
---
=C2=A0dts/tests/TestSuite_flow.py | 187 +++++++++++++++++++++++++++++++----= -
=C2=A01 file changed, 165 insertions(+), 22 deletions(-)

diff --git a/dts/tests/TestSuite_flow.py b/dts/tests/TestSuite_flow.py
index 15566205c9..06bd3bedc5 100644
--- a/dts/tests/TestSuite_flow.py
+++ b/dts/tests/TestSuite_flow.py
@@ -29,7 +29,7 @@
=C2=A0class TestFlow(TestSuite):
=C2=A0 =C2=A0 =C2=A0"""RTE Flow test suite.


+
+=C2=A0 =C2=A0 @func_test
+=C2=A0 =C2=A0 def test_jump_action(self) -> None:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Validate flow rules with dif= ferent group levels and jump actions.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Steps:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Create a list of packets to test= , with a corresponding flow list.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Launch testpmd with the necessar= y configuration.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Create each flow rule in testpmd= .
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Send each packet in the list, ch= eck Rx queue ID.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Verify:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Check that each packet is receiv= ed on the appropriate Rx queue.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 packet_list =3D [Ether() / IP(), Ether() / IP(= ) / TCP(), Ether() / IP() / UDP()]
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 flow_list =3D [
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FlowRule(direction=3D"ingre= ss", group_id=3D0, pattern=3D["eth"], actions=3D["jump = group 1"]),
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FlowRule(direction=3D"ingre= ss", group_id=3D0, pattern=3D["ipv4"], actions=3D["jump= group 2"]),
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FlowRule(
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 direction=3D"= ingress", group_id=3D0, pattern=3D["eth / ipv4"], actions=3D= ["queue index 1"]
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ),
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FlowRule(
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 direction=3D"= ingress",
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 group_id=3D0,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pattern=3D["e= th / ipv4 / tcp"],
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 actions=3D["q= ueue index 2"],
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ),
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FlowRule(
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 direction=3D"= ingress",
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 group_id=3D0,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pattern=3D["e= th / ipv4 / udp"],
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 actions=3D["q= ueue index 3"],
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ),
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 ]
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 expected_queue_list =3D [1, 2, 3]
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 with TestPmdShell(rx_queues=3D4, tx_queues=3D4= ) as testpmd:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.send_packet_and_verify_jump= (
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 packets=3Dpacket_l= ist,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 flow_rules=3Dflow_= list,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 test_queues=3Dexpe= cted_queue_list,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 testpmd=3Dtestpmd,=
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 )

It looks like the 2nd and 3rd flow rule need to be added to group_id = 1 and 2 respectively, instead of 0 and 0, in order for the jumps to groups = 1 and 2 to have the desired effect you are validating on.
=C2=A0<= /div>
+
+=C2=A0 =C2=A0 @func_test
+=C2=A0 =C2=A0 def test_priority_attribute(self) -> None:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Validate flow rules with que= ue actions and ethernet patterns.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Steps:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Create a list of packets to test= , with a corresponding flow list.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Launch testpmd.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Create first flow rule in flow l= ist.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Send first packet in packet list= , capture verbose output.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Delete flow rule, repeat for all= flows/packets.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Verify:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Check that each packet is receiv= ed on the appropriate queue.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 test_packet =3D Ether() / IP() / Raw()
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 flow_list =3D [
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FlowRule(
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 direction=3D"= ingress",
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 priority_level=3D3= ,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pattern=3D["e= th / ipv4"],
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 actions=3D["q= ueue index 1"],
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ),
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FlowRule(
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 direction=3D"= ingress",
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 priority_level=3D2= ,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pattern=3D["e= th / ipv4"],
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 actions=3D["q= ueue index 2"],
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ),
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FlowRule(
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 direction=3D"= ingress",
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 priority_level=3D1= ,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pattern=3D["e= th / ipv4"],
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 actions=3D["q= ueue index 3"],
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ),
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 ]
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 expected_queue_list =3D [1, 2, 3]
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 with TestPmdShell(rx_queues=3D4, tx_queues=3D4= ) as testpmd:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 testpmd.set_verbose(level=3D1) +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for flow, expected_queue in zip(= flow_list, expected_queue_list):
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 testpmd.flow_creat= e(flow_rule=3Dflow, port_id=3D0)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 testpmd.start() +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.send_packet_a= nd_capture(test_packet)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 verbose_output =3D= testpmd.extract_verbose_output(testpmd.stop())
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 received =3D False=
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for testpmd_packet= in verbose_output:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if t= estpmd_packet.queue_id =3D=3D expected_queue:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 received =3D True
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify(receiv= ed, f"Packet was not received on queue {expected_queue}")
--
2.49.0


Reviewed-by: Patr= ick Robb <probb@iol.unh.edu>= =C2=A0
--000000000000159003063868cd98--