From: Dean Marx <dmarx@iol.unh.edu>
To: probb@iol.unh.edu, npratte@iol.unh.edu, luca.vizzarro@arm.com,
yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com,
paul.szczepanek@arm.com
Cc: dev@dpdk.org, Dean Marx <dmarx@iol.unh.edu>
Subject: [PATCH v1 4/4] change verification field in unified packet suite
Date: Thu, 6 Mar 2025 16:47:47 -0500 [thread overview]
Message-ID: <20250306214747.579340-5-dmarx@iol.unh.edu> (raw)
In-Reply-To: <20250306214747.579340-1-dmarx@iol.unh.edu>
Changes the unified packet testing suite to use layer 4
destination ports as packet verification IDs.
Signed-off-by: Dean Marx <dmarx@iol.unh.edu>
---
dts/tests/TestSuite_uni_pkt.py | 106 ++++++++++++++++-----------------
1 file changed, 51 insertions(+), 55 deletions(-)
diff --git a/dts/tests/TestSuite_uni_pkt.py b/dts/tests/TestSuite_uni_pkt.py
index 656a69b0f1..fdb9c29059 100644
--- a/dts/tests/TestSuite_uni_pkt.py
+++ b/dts/tests/TestSuite_uni_pkt.py
@@ -44,7 +44,7 @@ def check_for_matching_packet(
) -> bool:
"""Returns :data:`True` if the packet in verbose output contains all specified flags."""
for packet in output:
- if packet.dst_mac == "00:00:00:00:00:01":
+ if packet.l4_dport == 50000:
if flags not in packet.hw_ptype and flags not in packet.sw_ptype:
return False
return True
@@ -82,8 +82,8 @@ def test_l2_packet_detect(self) -> None:
Check that each packet has a destination MAC address matching the set ID.
Check the packet type fields in verbose output, verify the flags match.
"""
- mac_id = "00:00:00:00:00:01"
- packet_list = [Ether(dst=mac_id, type=0x88F7) / Raw(), Ether(dst=mac_id) / ARP() / Raw()]
+ dport_id = 50000
+ packet_list = [Ether(type=0x88F7) / UDP(dport=dport_id) / Raw(), Ether() / ARP() / Raw()]
flag_list = [RtePTypes.L2_ETHER_TIMESYNC, RtePTypes.L2_ETHER_ARP]
with TestPmdShell() as testpmd:
self.setup_session(testpmd=testpmd, expected_flags=flag_list, packet_list=packet_list)
@@ -101,14 +101,14 @@ def test_l3_l4_packet_detect(self) -> None:
Check that each packet has a destination MAC address matching the set ID.
Check the packet type fields in verbose output, verify the flags match.
"""
- mac_id = "00:00:00:00:00:01"
+ dport_id = 50000
packet_list = [
- Ether(dst=mac_id) / IP() / Raw(),
- Ether(dst=mac_id) / IP() / UDP() / Raw(),
- Ether(dst=mac_id) / IP() / TCP() / Raw(),
- Ether(dst=mac_id) / IP() / SCTP() / Raw(),
- Ether(dst=mac_id) / IP() / ICMP() / Raw(),
- Ether(dst=mac_id) / IP(frag=5) / TCP() / Raw(),
+ Ether() / UDP(dport=dport_id) / IP() / Raw(),
+ Ether() / IP() / UDP(dport=dport_id) / Raw(),
+ Ether() / IP() / TCP(dport=dport_id) / Raw(),
+ Ether() / UDP(dport=dport_id) / IP() / SCTP() / Raw(),
+ Ether() / UDP(dport=dport_id) / IP() / ICMP() / Raw(),
+ Ether() / IP(frag=5) / TCP(dport=dport_id) / Raw(),
]
flag_list = [
RtePTypes.L3_IPV4 | RtePTypes.L2_ETHER,
@@ -134,12 +134,12 @@ def test_ipv6_l4_packet_detect(self) -> None:
Check that each packet has a destination MAC address matching the set ID.
Check the packet type fields in verbose output, verify the flags match.
"""
- mac_id = "00:00:00:00:00:01"
+ dport_id = 50000
packet_list = [
- Ether(dst=mac_id) / IPv6() / Raw(),
- Ether(dst=mac_id) / IPv6() / UDP() / Raw(),
- Ether(dst=mac_id) / IPv6() / TCP() / Raw(),
- Ether(dst=mac_id) / IPv6() / IPv6ExtHdrFragment() / Raw(),
+ Ether() / UDP(dport=dport_id) / IPv6() / Raw(),
+ Ether() / IPv6() / UDP(dport=dport_id) / Raw(),
+ Ether() / IPv6() / TCP(dport=dport_id) / Raw(),
+ Ether() / UDP(dport=dport_id) / IPv6() / IPv6ExtHdrFragment() / Raw(),
]
flag_list = [
RtePTypes.L2_ETHER | RtePTypes.L3_IPV6,
@@ -163,15 +163,15 @@ def test_l3_tunnel_packet_detect(self) -> None:
Check that each packet has a destination MAC address matching the set ID.
Check the packet type fields in verbose output, verify the flags match.
"""
- mac_id = "00:00:00:00:00:01"
+ dport_id = 50000
packet_list = [
- Ether(dst=mac_id) / IP() / IP(frag=5) / UDP() / Raw(),
- Ether(dst=mac_id) / IP() / IP() / Raw(),
- Ether(dst=mac_id) / IP() / IP() / UDP() / Raw(),
- Ether(dst=mac_id) / IP() / IP() / TCP() / Raw(),
- Ether(dst=mac_id) / IP() / IP() / SCTP() / Raw(),
- Ether(dst=mac_id) / IP() / IP() / ICMP() / Raw(),
- Ether(dst=mac_id) / IP() / IPv6() / IPv6ExtHdrFragment() / Raw(),
+ Ether() / IP() / IP(frag=5) / UDP(dport=dport_id) / Raw(),
+ Ether() / UDP(dport=dport_id) / IP() / IP() / Raw(),
+ Ether() / IP() / IP() / UDP(dport=dport_id) / Raw(),
+ Ether() / IP() / IP() / TCP(dport=dport_id) / Raw(),
+ Ether() / UDP(dport=dport_id) / IP() / IP() / SCTP() / Raw(),
+ Ether() / UDP(dport=dport_id) / IP() / IP() / ICMP() / Raw(),
+ Ether() / UDP(dport=dport_id) / IP() / IPv6() / IPv6ExtHdrFragment() / Raw(),
]
flag_list = [
RtePTypes.TUNNEL_IP | RtePTypes.L3_IPV4_EXT_UNKNOWN | RtePTypes.INNER_L4_FRAG,
@@ -198,14 +198,14 @@ def test_gre_tunnel_packet_detect(self) -> None:
Check that each packet has a destination MAC address matching the set ID.
Check the packet type fields in verbose output, verify the flags match.
"""
- mac_id = "00:00:00:00:00:01"
+ dport_id = 50000
packet_list = [
- Ether(dst=mac_id) / IP() / GRE() / IP(frag=5) / Raw(),
- Ether(dst=mac_id) / IP() / GRE() / IP() / Raw(),
- Ether(dst=mac_id) / IP() / GRE() / IP() / UDP() / Raw(),
- Ether(dst=mac_id) / IP() / GRE() / IP() / TCP() / Raw(),
- Ether(dst=mac_id) / IP() / GRE() / IP() / SCTP() / Raw(),
- Ether(dst=mac_id) / IP() / GRE() / IP() / ICMP() / Raw(),
+ Ether() / UDP(dport=dport_id) / IP() / GRE() / IP(frag=5) / Raw(),
+ Ether() / UDP(dport=dport_id) / IP() / GRE() / IP() / Raw(),
+ Ether() / IP() / GRE() / IP() / UDP(dport=dport_id) / Raw(),
+ Ether() / IP() / GRE() / IP() / TCP(dport=dport_id) / Raw(),
+ Ether() / UDP(dport=dport_id) / IP() / GRE() / IP() / SCTP() / Raw(),
+ Ether() / UDP(dport=dport_id) / IP() / GRE() / IP() / ICMP() / Raw(),
]
flag_list = [
RtePTypes.TUNNEL_GRENAT | RtePTypes.INNER_L4_FRAG | RtePTypes.INNER_L3_IPV4_EXT_UNKNOWN,
@@ -231,15 +231,20 @@ def test_nsh_packet_detect(self) -> None:
Check that each packet has a destination MAC address matching the set ID.
Check the packet type fields in verbose output, verify the flags match.
"""
- mac_id = "00:00:00:00:00:01"
+ dport_id = 50000
packet_list = [
- Ether(dst=mac_id, type=0x894F) / NSH() / IP(),
- Ether(dst=mac_id, type=0x894F) / NSH() / IP() / ICMP(),
- Ether(dst=mac_id, type=0x894F) / NSH() / IP(frag=1, flags="MF"),
- Ether(dst=mac_id, type=0x894F) / NSH() / IP() / TCP(),
- Ether(dst=mac_id, type=0x894F) / NSH() / IP() / UDP(),
- Ether(dst=mac_id, type=0x894F) / NSH() / IP() / SCTP(tag=1) / SCTPChunkData(data="x"),
- Ether(dst=mac_id, type=0x894F) / NSH() / IPv6(),
+ Ether(type=0x894F) / UDP(dport=dport_id) / NSH() / IP(),
+ Ether(type=0x894F) / UDP(dport=dport_id) / NSH() / IP() / ICMP(),
+ Ether(type=0x894F) / UDP(dport=dport_id) / NSH() / IP(frag=1, flags="MF"),
+ Ether(type=0x894F) / NSH() / IP() / TCP(dport=dport_id),
+ Ether(type=0x894F) / NSH() / IP() / UDP(dport=dport_id),
+ Ether(type=0x894F)
+ / UDP(dport=dport_id)
+ / NSH()
+ / IP()
+ / SCTP(tag=1)
+ / SCTPChunkData(data="x"),
+ Ether(type=0x894F) / UDP(dport=dport_id) / NSH() / IPv6(),
]
flag_list = [
RtePTypes.L2_ETHER_NSH | RtePTypes.L3_IPV4_EXT_UNKNOWN | RtePTypes.L4_NONFRAG,
@@ -267,24 +272,15 @@ def test_vxlan_tunnel_packet_detect(self) -> None:
Check that each packet has a destination MAC address matching the set ID.
Check the packet type fields in verbose output, verify the flags match.
"""
- mac_id = "00:00:00:00:00:01"
+ dport_id = 50000
packet_list = [
- Ether(dst=mac_id) / IP() / UDP() / VXLAN() / Ether() / IP(frag=5) / Raw(),
- Ether(dst=mac_id) / IP() / UDP() / VXLAN() / Ether() / IP() / Raw(),
- Ether(dst=mac_id) / IP() / UDP() / VXLAN() / Ether() / IP() / UDP() / Raw(),
- Ether(dst=mac_id) / IP() / UDP() / VXLAN() / Ether() / IP() / TCP() / Raw(),
- Ether(dst=mac_id) / IP() / UDP() / VXLAN() / Ether() / IP() / SCTP() / Raw(),
- Ether(dst=mac_id) / IP() / UDP() / VXLAN() / Ether() / IP() / ICMP() / Raw(),
- (
- Ether(dst=mac_id)
- / IP()
- / UDP()
- / VXLAN()
- / Ether()
- / IPv6()
- / IPv6ExtHdrFragment()
- / Raw()
- ),
+ Ether() / IP() / UDP(dport=dport_id) / VXLAN() / Ether() / IP(frag=5) / Raw(),
+ Ether() / IP() / UDP(dport=dport_id) / VXLAN() / Ether() / IP() / Raw(),
+ Ether() / IP() / UDP(dport=dport_id) / VXLAN() / Ether() / IP() / UDP() / Raw(),
+ Ether() / IP() / UDP(dport=dport_id) / VXLAN() / Ether() / IP() / TCP() / Raw(),
+ Ether() / IP() / UDP(dport=dport_id) / VXLAN() / Ether() / IP() / SCTP() / Raw(),
+ Ether() / IP() / UDP(dport=dport_id) / VXLAN() / Ether() / IP() / ICMP() / Raw(),
+ (Ether() / IP() / UDP() / VXLAN() / Ether() / IPv6() / IPv6ExtHdrFragment() / Raw()),
]
flag_list = [
RtePTypes.TUNNEL_GRENAT | RtePTypes.INNER_L4_FRAG | RtePTypes.INNER_L3_IPV4_EXT_UNKNOWN,
--
2.48.1
prev parent reply other threads:[~2025-03-06 21:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-06 21:47 [PATCH v1 0/4] dts: change verbose packet verification to layer 4 ports Dean Marx
2025-03-06 21:47 ` [PATCH v1 1/4] dts: add layer 4 port field to verbose parser Dean Marx
2025-03-06 21:47 ` [PATCH v1 2/4] dts: change verification field in checksum offload suite Dean Marx
2025-03-06 21:47 ` [PATCH v1 3/4] dts: remove unnecessary capability requirement Dean Marx
2025-03-06 21:47 ` Dean Marx [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250306214747.579340-5-dmarx@iol.unh.edu \
--to=dmarx@iol.unh.edu \
--cc=Honnappa.Nagarahalli@arm.com \
--cc=dev@dpdk.org \
--cc=luca.vizzarro@arm.com \
--cc=npratte@iol.unh.edu \
--cc=paul.szczepanek@arm.com \
--cc=probb@iol.unh.edu \
--cc=yoan.picchi@foss.arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).