* [PATCH v1 0/4] dts: change verbose packet verification to layer 4 ports
@ 2025-03-06 21:47 Dean Marx
2025-03-06 21:47 ` [PATCH v1 1/4] dts: add layer 4 port field to verbose parser Dean Marx
` (3 more replies)
0 siblings, 4 replies; 13+ messages in thread
From: Dean Marx @ 2025-03-06 21:47 UTC (permalink / raw)
To: probb, npratte, luca.vizzarro, yoan.picchi, Honnappa.Nagarahalli,
paul.szczepanek
Cc: dev, Dean Marx
Currently, the unified packet and checksum offload test suites
use a random MAC destination address as a way to find sent
packets in testpmd verbose output. However, this does not work
for certain NICs that change the MAC address prior to reception.
The new verification involves setting a random UDP/TCP destination
port, and scanning the verbose output for the port.
This series depends on a testpmd verbose output patch, which
is listed below.
Fixes: patch-146043 ("dts: checksum offload test suite")
Fixes: patch-150118 ("dts: port over unified packet suite")
Depends-on: patch-143194 ("app/testpmd: add L4 port to verbose output")
Dean Marx (4):
dts: add layer 4 port field to verbose parser
dts: change verification field in checksum offload suite
dts: remove unnecessary capability requirement
change verification field in unified packet suite
dts/framework/remote_session/testpmd_shell.py | 5 +
dts/tests/TestSuite_checksum_offload.py | 131 ++++++++++--------
dts/tests/TestSuite_uni_pkt.py | 106 +++++++-------
3 files changed, 133 insertions(+), 109 deletions(-)
--
2.48.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v1 1/4] dts: add layer 4 port field to verbose parser
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 ` Dean Marx
2025-05-14 15:37 ` Luca Vizzarro
2025-05-14 20:12 ` Nicholas Pratte
2025-03-06 21:47 ` [PATCH v1 2/4] dts: change verification field in checksum offload suite Dean Marx
` (2 subsequent siblings)
3 siblings, 2 replies; 13+ messages in thread
From: Dean Marx @ 2025-03-06 21:47 UTC (permalink / raw)
To: probb, npratte, luca.vizzarro, yoan.picchi, Honnappa.Nagarahalli,
paul.szczepanek
Cc: dev, Dean Marx
Add a field to the TestPmdVerbosePacket text parser
that stores destination port values for TCP/UDP packets.
Signed-off-by: Dean Marx <dmarx@iol.unh.edu>
---
dts/framework/remote_session/testpmd_shell.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py
index 1f291fcb68..f99c24bb04 100644
--- a/dts/framework/remote_session/testpmd_shell.py
+++ b/dts/framework/remote_session/testpmd_shell.py
@@ -1278,6 +1278,11 @@ class TestPmdVerbosePacket(TextParser):
l3_len: int | None = field(default=None, metadata=TextParser.find_int(r"l3_len=(\d+)"))
#:
l4_len: int | None = field(default=None, metadata=TextParser.find_int(r"l4_len=(\d+)"))
+ #:
+ l4_dport: int | None = field(
+ default=None,
+ metadata=TextParser.find_int(r"(?:Destination TCP port=|Destination UDP port=)(\d+)"),
+ )
class RxOffloadCapability(Flag):
--
2.48.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v1 2/4] dts: change verification field in checksum offload suite
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 ` Dean Marx
2025-05-14 15:38 ` Luca Vizzarro
2025-05-14 20:20 ` Nicholas Pratte
2025-03-06 21:47 ` [PATCH v1 3/4] dts: remove unnecessary capability requirement Dean Marx
2025-03-06 21:47 ` [PATCH v1 4/4] change verification field in unified packet suite Dean Marx
3 siblings, 2 replies; 13+ messages in thread
From: Dean Marx @ 2025-03-06 21:47 UTC (permalink / raw)
To: probb, npratte, luca.vizzarro, yoan.picchi, Honnappa.Nagarahalli,
paul.szczepanek
Cc: dev, Dean Marx
Changes the checksum offload testing suite to use layer 4
destination ports as packet verification IDs.
Signed-off-by: Dean Marx <dmarx@iol.unh.edu>
---
dts/tests/TestSuite_checksum_offload.py | 130 ++++++++++++++----------
1 file changed, 77 insertions(+), 53 deletions(-)
diff --git a/dts/tests/TestSuite_checksum_offload.py b/dts/tests/TestSuite_checksum_offload.py
index b38d73421b..83879b0512 100644
--- a/dts/tests/TestSuite_checksum_offload.py
+++ b/dts/tests/TestSuite_checksum_offload.py
@@ -70,7 +70,7 @@ def send_packets_and_verify(
)
def send_packet_and_verify_checksum(
- self, packet: Packet, good_L4: bool, good_IP: bool, testpmd: TestPmdShell, id: str
+ self, packet: Packet, good_L4: bool, good_IP: bool, testpmd: TestPmdShell, id: int
) -> None:
"""Send packet and verify verbose output matches expected output.
@@ -81,13 +81,13 @@ def send_packet_and_verify_checksum(
good_IP: Verifies RTE_MBUF_F_RX_IP_CKSUM_GOOD in verbose output
if :data:`True`, or RTE_MBUF_F_RX_IP_CKSUM_UNKNOWN if :data:`False`.
testpmd: Testpmd shell session to analyze verbose output of.
- id: The destination mac address that matches the sent packet in verbose output.
+ id: The destination port that matches the sent packet in verbose output.
"""
testpmd.start()
self.send_packet_and_capture(packet=packet)
verbose_output = testpmd.extract_verbose_output(testpmd.stop())
for testpmd_packet in verbose_output:
- if testpmd_packet.dst_mac == id:
+ if testpmd_packet.l4_dport == id:
is_IP = PacketOffloadFlag.RTE_MBUF_F_RX_IP_CKSUM_GOOD in testpmd_packet.ol_flags
is_L4 = PacketOffloadFlag.RTE_MBUF_F_RX_L4_CKSUM_GOOD in testpmd_packet.ol_flags
self.verify(is_L4 == good_L4, "Layer 4 checksum flag did not match expected checksum flag.")
@@ -120,13 +120,13 @@ def test_insert_checksums(self) -> None:
Verify packets are received.
Verify packet checksums match the expected flags.
"""
- mac_id = "00:00:00:00:00:01"
+ dport_id = 50000
payload = b"xxxxx"
packet_list = [
- Ether(dst=mac_id) / IP() / UDP() / Raw(payload),
- Ether(dst=mac_id) / IP() / TCP() / Raw(payload),
- Ether(dst=mac_id) / IPv6(src="::1") / UDP() / Raw(payload),
- Ether(dst=mac_id) / IPv6(src="::1") / TCP() / Raw(payload),
+ Ether() / IP() / UDP(dport=dport_id) / Raw(payload),
+ Ether() / IP() / TCP(dport=dport_id) / Raw(payload),
+ Ether() / IPv6(src="::1") / UDP(dport=dport_id) / Raw(payload),
+ Ether() / IPv6(src="::1") / TCP(dport=dport_id) / Raw(payload),
]
with TestPmdShell(enable_rx_cksum=True) as testpmd:
testpmd.set_forward_mode(SimpleForwardingModes.csum)
@@ -136,7 +136,7 @@ def test_insert_checksums(self) -> None:
self.send_packets_and_verify(packet_list=packet_list, load=payload, should_receive=True)
for i in range(0, len(packet_list)):
self.send_packet_and_verify_checksum(
- packet=packet_list[i], good_L4=True, good_IP=True, testpmd=testpmd, id=mac_id
+ packet=packet_list[i], good_L4=True, good_IP=True, testpmd=testpmd, id=dport_id
)
@func_test
@@ -152,13 +152,13 @@ def test_no_insert_checksums(self) -> None:
Verify packets are received.
Verify packet checksums match the expected flags.
"""
- mac_id = "00:00:00:00:00:01"
+ dport_id = 50000
payload = b"xxxxx"
packet_list = [
- Ether(dst=mac_id) / IP() / UDP() / Raw(payload),
- Ether(dst=mac_id) / IP() / TCP() / Raw(payload),
- Ether(dst=mac_id) / IPv6(src="::1") / UDP() / Raw(payload),
- Ether(dst=mac_id) / IPv6(src="::1") / TCP() / Raw(payload),
+ Ether() / IP() / UDP(dport=dport_id) / Raw(payload),
+ Ether() / IP() / TCP(dport=dport_id) / Raw(payload),
+ Ether() / IPv6(src="::1") / UDP(dport=dport_id) / Raw(payload),
+ Ether() / IPv6(src="::1") / TCP(dport=dport_id) / Raw(payload),
]
with TestPmdShell(enable_rx_cksum=True) as testpmd:
testpmd.set_forward_mode(SimpleForwardingModes.csum)
@@ -167,7 +167,7 @@ def test_no_insert_checksums(self) -> None:
self.send_packets_and_verify(packet_list=packet_list, load=payload, should_receive=True)
for i in range(0, len(packet_list)):
self.send_packet_and_verify_checksum(
- packet=packet_list[i], good_L4=True, good_IP=True, testpmd=testpmd, id=mac_id
+ packet=packet_list[i], good_L4=True, good_IP=True, testpmd=testpmd, id=dport_id
)
@func_test
@@ -183,12 +183,12 @@ def test_l4_rx_checksum(self) -> None:
Verify:
Verify packet checksums match the expected flags.
"""
- mac_id = "00:00:00:00:00:01"
+ dport_id = 50000
packet_list = [
- Ether(dst=mac_id) / IP() / UDP(),
- Ether(dst=mac_id) / IP() / TCP(),
- Ether(dst=mac_id) / IP() / UDP(chksum=0xF),
- Ether(dst=mac_id) / IP() / TCP(chksum=0xF),
+ Ether() / IP() / UDP(dport=dport_id),
+ Ether() / IP() / TCP(dport=dport_id),
+ Ether() / IP() / UDP(chksum=0xF, dport=dport_id),
+ Ether() / IP() / TCP(chksum=0xF, dport=dport_id),
]
with TestPmdShell(enable_rx_cksum=True) as testpmd:
testpmd.set_forward_mode(SimpleForwardingModes.csum)
@@ -196,11 +196,11 @@ def test_l4_rx_checksum(self) -> None:
self.setup_hw_offload(testpmd=testpmd)
for i in range(0, 2):
self.send_packet_and_verify_checksum(
- packet=packet_list[i], good_L4=True, good_IP=True, testpmd=testpmd, id=mac_id
+ packet=packet_list[i], good_L4=True, good_IP=True, testpmd=testpmd, id=dport_id
)
for i in range(2, 4):
self.send_packet_and_verify_checksum(
- packet=packet_list[i], good_L4=False, good_IP=True, testpmd=testpmd, id=mac_id
+ packet=packet_list[i], good_L4=False, good_IP=True, testpmd=testpmd, id=dport_id
)
@func_test
@@ -216,12 +216,12 @@ def test_l3_rx_checksum(self) -> None:
Verify:
Verify packet checksums match the expected flags.
"""
- mac_id = "00:00:00:00:00:01"
+ dport_id = 50000
packet_list = [
- Ether(dst=mac_id) / IP() / UDP(),
- Ether(dst=mac_id) / IP() / TCP(),
- Ether(dst=mac_id) / IP(chksum=0xF) / UDP(),
- Ether(dst=mac_id) / IP(chksum=0xF) / TCP(),
+ Ether() / IP() / UDP(dport=dport_id),
+ Ether() / IP() / TCP(dport=dport_id),
+ Ether() / IP(chksum=0xF) / UDP(dport=dport_id),
+ Ether() / IP(chksum=0xF) / TCP(dport=dport_id),
]
with TestPmdShell(enable_rx_cksum=True) as testpmd:
testpmd.set_forward_mode(SimpleForwardingModes.csum)
@@ -229,11 +229,11 @@ def test_l3_rx_checksum(self) -> None:
self.setup_hw_offload(testpmd=testpmd)
for i in range(0, 2):
self.send_packet_and_verify_checksum(
- packet=packet_list[i], good_L4=True, good_IP=True, testpmd=testpmd, id=mac_id
+ packet=packet_list[i], good_L4=True, good_IP=True, testpmd=testpmd, id=dport_id
)
for i in range(2, 4):
self.send_packet_and_verify_checksum(
- packet=packet_list[i], good_L4=True, good_IP=False, testpmd=testpmd, id=mac_id
+ packet=packet_list[i], good_L4=True, good_IP=False, testpmd=testpmd, id=dport_id
)
@func_test
@@ -249,16 +249,16 @@ def test_validate_rx_checksum(self) -> None:
Verify:
Verify packet checksums match the expected flags.
"""
- mac_id = "00:00:00:00:00:01"
+ dport_id = 50000
packet_list = [
- Ether(dst=mac_id) / IP() / UDP(),
- Ether(dst=mac_id) / IP() / TCP(),
- Ether(dst=mac_id) / IPv6(src="::1") / UDP(),
- Ether(dst=mac_id) / IPv6(src="::1") / TCP(),
- Ether(dst=mac_id) / IP(chksum=0x0) / UDP(chksum=0xF),
- Ether(dst=mac_id) / IP(chksum=0x0) / TCP(chksum=0xF),
- Ether(dst=mac_id) / IPv6(src="::1") / UDP(chksum=0xF),
- Ether(dst=mac_id) / IPv6(src="::1") / TCP(chksum=0xF),
+ Ether() / IP() / UDP(dport=dport_id),
+ Ether() / IP() / TCP(dport=dport_id),
+ Ether() / IPv6(src="::1") / UDP(dport=dport_id),
+ Ether() / IPv6(src="::1") / TCP(dport=dport_id),
+ Ether() / IP(chksum=0x0) / UDP(chksum=0xF, dport=dport_id),
+ Ether() / IP(chksum=0x0) / TCP(chksum=0xF, dport=dport_id),
+ Ether() / IPv6(src="::1") / UDP(chksum=0xF, dport=dport_id),
+ Ether() / IPv6(src="::1") / TCP(chksum=0xF, dport=dport_id),
]
with TestPmdShell(enable_rx_cksum=True) as testpmd:
testpmd.set_forward_mode(SimpleForwardingModes.csum)
@@ -266,15 +266,19 @@ def test_validate_rx_checksum(self) -> None:
self.setup_hw_offload(testpmd=testpmd)
for i in range(0, 4):
self.send_packet_and_verify_checksum(
- packet=packet_list[i], good_L4=True, good_IP=True, testpmd=testpmd, id=mac_id
+ packet=packet_list[i], good_L4=True, good_IP=True, testpmd=testpmd, id=dport_id
)
for i in range(4, 6):
self.send_packet_and_verify_checksum(
- packet=packet_list[i], good_L4=False, good_IP=False, testpmd=testpmd, id=mac_id
+ packet=packet_list[i],
+ good_L4=False,
+ good_IP=False,
+ testpmd=testpmd,
+ id=dport_id,
)
for i in range(6, 8):
self.send_packet_and_verify_checksum(
- packet=packet_list[i], good_L4=False, good_IP=True, testpmd=testpmd, id=mac_id
+ packet=packet_list[i], good_L4=False, good_IP=True, testpmd=testpmd, id=dport_id
)
@requires(NicCapability.RX_OFFLOAD_VLAN)
@@ -291,13 +295,29 @@ def test_vlan_checksum(self) -> None:
Verify:
Verify packet checksums match the expected flags.
"""
- mac_id = "00:00:00:00:00:01"
+ dport_id = 50000
payload = b"xxxxx"
packet_list = [
- Ether(dst=mac_id) / Dot1Q(vlan=1) / IP(chksum=0x0) / UDP(chksum=0xF) / Raw(payload),
- Ether(dst=mac_id) / Dot1Q(vlan=1) / IP(chksum=0x0) / TCP(chksum=0xF) / Raw(payload),
- Ether(dst=mac_id) / Dot1Q(vlan=1) / IPv6(src="::1") / UDP(chksum=0xF) / Raw(payload),
- Ether(dst=mac_id) / Dot1Q(vlan=1) / IPv6(src="::1") / TCP(chksum=0xF) / Raw(payload),
+ Ether()
+ / Dot1Q(vlan=1)
+ / IP(chksum=0x0)
+ / UDP(chksum=0xF, dport=dport_id)
+ / Raw(payload),
+ Ether()
+ / Dot1Q(vlan=1)
+ / IP(chksum=0x0)
+ / TCP(chksum=0xF, dport=dport_id)
+ / Raw(payload),
+ Ether()
+ / Dot1Q(vlan=1)
+ / IPv6(src="::1")
+ / UDP(chksum=0xF, dport=dport_id)
+ / Raw(payload),
+ Ether()
+ / Dot1Q(vlan=1)
+ / IPv6(src="::1")
+ / TCP(chksum=0xF, dport=dport_id)
+ / Raw(payload),
]
with TestPmdShell(enable_rx_cksum=True) as testpmd:
testpmd.set_forward_mode(SimpleForwardingModes.csum)
@@ -307,11 +327,15 @@ def test_vlan_checksum(self) -> None:
self.send_packets_and_verify(packet_list=packet_list, load=payload, should_receive=True)
for i in range(0, 2):
self.send_packet_and_verify_checksum(
- packet=packet_list[i], good_L4=False, good_IP=False, testpmd=testpmd, id=mac_id
+ packet=packet_list[i],
+ good_L4=False,
+ good_IP=False,
+ testpmd=testpmd,
+ id=dport_id,
)
for i in range(2, 4):
self.send_packet_and_verify_checksum(
- packet=packet_list[i], good_L4=False, good_IP=True, testpmd=testpmd, id=mac_id
+ packet=packet_list[i], good_L4=False, good_IP=True, testpmd=testpmd, id=dport_id
)
@requires(NicCapability.RX_OFFLOAD_SCTP_CKSUM)
@@ -328,10 +352,10 @@ def test_validate_sctp_checksum(self) -> None:
Verify:
Verify packet checksums match the expected flags.
"""
- mac_id = "00:00:00:00:00:01"
+ dport_id = 50000
packet_list = [
- Ether(dst=mac_id) / IP() / SCTP(),
- Ether(dst=mac_id) / IP() / SCTP(chksum=0xF),
+ Ether() / IP() / UDP(dport=dport_id) / SCTP(),
+ Ether() / IP() / UDP(dport=dport_id) / SCTP(chksum=0xF),
]
with TestPmdShell(enable_rx_cksum=True) as testpmd:
testpmd.set_forward_mode(SimpleForwardingModes.csum)
@@ -339,8 +363,8 @@ def test_validate_sctp_checksum(self) -> None:
testpmd.csum_set_hw(layers=ChecksumOffloadOptions.sctp)
testpmd.start()
self.send_packet_and_verify_checksum(
- packet=packet_list[0], good_L4=True, good_IP=True, testpmd=testpmd, id=mac_id
+ packet=packet_list[0], good_L4=True, good_IP=True, testpmd=testpmd, id=dport_id
)
self.send_packet_and_verify_checksum(
- packet=packet_list[1], good_L4=False, good_IP=True, testpmd=testpmd, id=mac_id
+ packet=packet_list[1], good_L4=False, good_IP=True, testpmd=testpmd, id=dport_id
)
--
2.48.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v1 3/4] dts: remove unnecessary capability requirement
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 ` Dean Marx
2025-05-14 15:38 ` Luca Vizzarro
2025-05-14 20:21 ` Nicholas Pratte
2025-03-06 21:47 ` [PATCH v1 4/4] change verification field in unified packet suite Dean Marx
3 siblings, 2 replies; 13+ messages in thread
From: Dean Marx @ 2025-03-06 21:47 UTC (permalink / raw)
To: probb, npratte, luca.vizzarro, yoan.picchi, Honnappa.Nagarahalli,
paul.szczepanek
Cc: dev, Dean Marx
Remove capability requirement from checksum offload test suite
that was not required to run the test cases.
Signed-off-by: Dean Marx <dmarx@iol.unh.edu>
---
dts/tests/TestSuite_checksum_offload.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/dts/tests/TestSuite_checksum_offload.py b/dts/tests/TestSuite_checksum_offload.py
index 83879b0512..c9efdcaa1c 100644
--- a/dts/tests/TestSuite_checksum_offload.py
+++ b/dts/tests/TestSuite_checksum_offload.py
@@ -30,7 +30,6 @@
@requires(topology_type=TopologyType.two_links)
-@requires(NicCapability.RX_OFFLOAD_CHECKSUM)
@requires(NicCapability.RX_OFFLOAD_IPV4_CKSUM)
@requires(NicCapability.RX_OFFLOAD_UDP_CKSUM)
@requires(NicCapability.RX_OFFLOAD_TCP_CKSUM)
--
2.48.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v1 4/4] change verification field in unified packet suite
2025-03-06 21:47 [PATCH v1 0/4] dts: change verbose packet verification to layer 4 ports Dean Marx
` (2 preceding siblings ...)
2025-03-06 21:47 ` [PATCH v1 3/4] dts: remove unnecessary capability requirement Dean Marx
@ 2025-03-06 21:47 ` Dean Marx
2025-05-14 15:42 ` Luca Vizzarro
2025-05-14 20:23 ` Nicholas Pratte
3 siblings, 2 replies; 13+ messages in thread
From: Dean Marx @ 2025-03-06 21:47 UTC (permalink / raw)
To: probb, npratte, luca.vizzarro, yoan.picchi, Honnappa.Nagarahalli,
paul.szczepanek
Cc: dev, Dean Marx
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v1 1/4] dts: add layer 4 port field to verbose parser
2025-03-06 21:47 ` [PATCH v1 1/4] dts: add layer 4 port field to verbose parser Dean Marx
@ 2025-05-14 15:37 ` Luca Vizzarro
2025-05-14 20:12 ` Nicholas Pratte
1 sibling, 0 replies; 13+ messages in thread
From: Luca Vizzarro @ 2025-05-14 15:37 UTC (permalink / raw)
To: Dean Marx, probb, npratte, yoan.picchi, Honnappa.Nagarahalli,
paul.szczepanek
Cc: dev
Hi Dean,
looks good to me. Just a minor optional nit.
Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
On 06/03/2025 22:47, Dean Marx wrote:
> + #:
> + l4_dport: int | None = field(
> + default=None,
> + metadata=TextParser.find_int(r"(?:Destination TCP port=|Destination UDP port=)(\d+)"),
> + )
the regex can be simplified:
r"Destination (?:TCP|UDP) port=(\d+)"
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v1 2/4] dts: change verification field in checksum offload suite
2025-03-06 21:47 ` [PATCH v1 2/4] dts: change verification field in checksum offload suite Dean Marx
@ 2025-05-14 15:38 ` Luca Vizzarro
2025-05-14 20:20 ` Nicholas Pratte
1 sibling, 0 replies; 13+ messages in thread
From: Luca Vizzarro @ 2025-05-14 15:38 UTC (permalink / raw)
To: Dean Marx, probb, npratte, yoan.picchi, Honnappa.Nagarahalli,
paul.szczepanek
Cc: dev
Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v1 3/4] dts: remove unnecessary capability requirement
2025-03-06 21:47 ` [PATCH v1 3/4] dts: remove unnecessary capability requirement Dean Marx
@ 2025-05-14 15:38 ` Luca Vizzarro
2025-05-14 20:21 ` Nicholas Pratte
1 sibling, 0 replies; 13+ messages in thread
From: Luca Vizzarro @ 2025-05-14 15:38 UTC (permalink / raw)
To: Dean Marx, probb, npratte, yoan.picchi, Honnappa.Nagarahalli,
paul.szczepanek
Cc: dev
Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v1 4/4] change verification field in unified packet suite
2025-03-06 21:47 ` [PATCH v1 4/4] change verification field in unified packet suite Dean Marx
@ 2025-05-14 15:42 ` Luca Vizzarro
2025-05-14 20:23 ` Nicholas Pratte
1 sibling, 0 replies; 13+ messages in thread
From: Luca Vizzarro @ 2025-05-14 15:42 UTC (permalink / raw)
To: Dean Marx, probb, npratte, yoan.picchi, Honnappa.Nagarahalli,
paul.szczepanek
Cc: dev
The changes look fine, so this is for them:
Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
But the commit subject/body need amendment. The `dts: ` component prefix
is missing in the subject
On 06/03/2025 22:47, Dean Marx wrote:
> Changes the unified packet testing suite to use layer 4
> destination ports as packet verification IDs.
and the body is not following an imperative form. This actually also
applies for the commit 2/4.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v1 1/4] dts: add layer 4 port field to verbose parser
2025-03-06 21:47 ` [PATCH v1 1/4] dts: add layer 4 port field to verbose parser Dean Marx
2025-05-14 15:37 ` Luca Vizzarro
@ 2025-05-14 20:12 ` Nicholas Pratte
1 sibling, 0 replies; 13+ messages in thread
From: Nicholas Pratte @ 2025-05-14 20:12 UTC (permalink / raw)
To: Dean Marx
Cc: probb, luca.vizzarro, yoan.picchi, Honnappa.Nagarahalli,
paul.szczepanek, dev
Makes sense to me!
Reviewed-by: Nicholas Pratte <npratte@iol.unh.edu>
On Thu, Mar 6, 2025 at 4:47 PM Dean Marx <dmarx@iol.unh.edu> wrote:
>
> Add a field to the TestPmdVerbosePacket text parser
> that stores destination port values for TCP/UDP packets.
>
> Signed-off-by: Dean Marx <dmarx@iol.unh.edu>
> ---
> dts/framework/remote_session/testpmd_shell.py | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py
> index 1f291fcb68..f99c24bb04 100644
> --- a/dts/framework/remote_session/testpmd_shell.py
> +++ b/dts/framework/remote_session/testpmd_shell.py
> @@ -1278,6 +1278,11 @@ class TestPmdVerbosePacket(TextParser):
> l3_len: int | None = field(default=None, metadata=TextParser.find_int(r"l3_len=(\d+)"))
> #:
> l4_len: int | None = field(default=None, metadata=TextParser.find_int(r"l4_len=(\d+)"))
> + #:
> + l4_dport: int | None = field(
> + default=None,
> + metadata=TextParser.find_int(r"(?:Destination TCP port=|Destination UDP port=)(\d+)"),
> + )
>
>
> class RxOffloadCapability(Flag):
> --
> 2.48.1
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v1 2/4] dts: change verification field in checksum offload suite
2025-03-06 21:47 ` [PATCH v1 2/4] dts: change verification field in checksum offload suite Dean Marx
2025-05-14 15:38 ` Luca Vizzarro
@ 2025-05-14 20:20 ` Nicholas Pratte
1 sibling, 0 replies; 13+ messages in thread
From: Nicholas Pratte @ 2025-05-14 20:20 UTC (permalink / raw)
To: Dean Marx
Cc: probb, luca.vizzarro, yoan.picchi, Honnappa.Nagarahalli,
paul.szczepanek, dev
Reviewed-by: Nicholas Pratte <npratte@iol.unh.edu>
On Thu, Mar 6, 2025 at 4:47 PM Dean Marx <dmarx@iol.unh.edu> wrote:
>
> Changes the checksum offload testing suite to use layer 4
> destination ports as packet verification IDs.
>
> Signed-off-by: Dean Marx <dmarx@iol.unh.edu>
> ---
> dts/tests/TestSuite_checksum_offload.py | 130 ++++++++++++++----------
> 1 file changed, 77 insertions(+), 53 deletions(-)
>
> diff --git a/dts/tests/TestSuite_checksum_offload.py b/dts/tests/TestSuite_checksum_offload.py
> index b38d73421b..83879b0512 100644
> --- a/dts/tests/TestSuite_checksum_offload.py
> +++ b/dts/tests/TestSuite_checksum_offload.py
> @@ -70,7 +70,7 @@ def send_packets_and_verify(
> )
>
> def send_packet_and_verify_checksum(
> - self, packet: Packet, good_L4: bool, good_IP: bool, testpmd: TestPmdShell, id: str
> + self, packet: Packet, good_L4: bool, good_IP: bool, testpmd: TestPmdShell, id: int
> ) -> None:
> """Send packet and verify verbose output matches expected output.
>
> @@ -81,13 +81,13 @@ def send_packet_and_verify_checksum(
> good_IP: Verifies RTE_MBUF_F_RX_IP_CKSUM_GOOD in verbose output
> if :data:`True`, or RTE_MBUF_F_RX_IP_CKSUM_UNKNOWN if :data:`False`.
> testpmd: Testpmd shell session to analyze verbose output of.
> - id: The destination mac address that matches the sent packet in verbose output.
> + id: The destination port that matches the sent packet in verbose output.
> """
> testpmd.start()
> self.send_packet_and_capture(packet=packet)
> verbose_output = testpmd.extract_verbose_output(testpmd.stop())
> for testpmd_packet in verbose_output:
> - if testpmd_packet.dst_mac == id:
> + if testpmd_packet.l4_dport == id:
> is_IP = PacketOffloadFlag.RTE_MBUF_F_RX_IP_CKSUM_GOOD in testpmd_packet.ol_flags
> is_L4 = PacketOffloadFlag.RTE_MBUF_F_RX_L4_CKSUM_GOOD in testpmd_packet.ol_flags
> self.verify(is_L4 == good_L4, "Layer 4 checksum flag did not match expected checksum flag.")
> @@ -120,13 +120,13 @@ def test_insert_checksums(self) -> None:
> Verify packets are received.
> Verify packet checksums match the expected flags.
> """
> - mac_id = "00:00:00:00:00:01"
> + dport_id = 50000
> payload = b"xxxxx"
> packet_list = [
> - Ether(dst=mac_id) / IP() / UDP() / Raw(payload),
> - Ether(dst=mac_id) / IP() / TCP() / Raw(payload),
> - Ether(dst=mac_id) / IPv6(src="::1") / UDP() / Raw(payload),
> - Ether(dst=mac_id) / IPv6(src="::1") / TCP() / Raw(payload),
> + Ether() / IP() / UDP(dport=dport_id) / Raw(payload),
> + Ether() / IP() / TCP(dport=dport_id) / Raw(payload),
> + Ether() / IPv6(src="::1") / UDP(dport=dport_id) / Raw(payload),
> + Ether() / IPv6(src="::1") / TCP(dport=dport_id) / Raw(payload),
> ]
> with TestPmdShell(enable_rx_cksum=True) as testpmd:
> testpmd.set_forward_mode(SimpleForwardingModes.csum)
> @@ -136,7 +136,7 @@ def test_insert_checksums(self) -> None:
> self.send_packets_and_verify(packet_list=packet_list, load=payload, should_receive=True)
> for i in range(0, len(packet_list)):
> self.send_packet_and_verify_checksum(
> - packet=packet_list[i], good_L4=True, good_IP=True, testpmd=testpmd, id=mac_id
> + packet=packet_list[i], good_L4=True, good_IP=True, testpmd=testpmd, id=dport_id
> )
>
> @func_test
> @@ -152,13 +152,13 @@ def test_no_insert_checksums(self) -> None:
> Verify packets are received.
> Verify packet checksums match the expected flags.
> """
> - mac_id = "00:00:00:00:00:01"
> + dport_id = 50000
> payload = b"xxxxx"
> packet_list = [
> - Ether(dst=mac_id) / IP() / UDP() / Raw(payload),
> - Ether(dst=mac_id) / IP() / TCP() / Raw(payload),
> - Ether(dst=mac_id) / IPv6(src="::1") / UDP() / Raw(payload),
> - Ether(dst=mac_id) / IPv6(src="::1") / TCP() / Raw(payload),
> + Ether() / IP() / UDP(dport=dport_id) / Raw(payload),
> + Ether() / IP() / TCP(dport=dport_id) / Raw(payload),
> + Ether() / IPv6(src="::1") / UDP(dport=dport_id) / Raw(payload),
> + Ether() / IPv6(src="::1") / TCP(dport=dport_id) / Raw(payload),
> ]
> with TestPmdShell(enable_rx_cksum=True) as testpmd:
> testpmd.set_forward_mode(SimpleForwardingModes.csum)
> @@ -167,7 +167,7 @@ def test_no_insert_checksums(self) -> None:
> self.send_packets_and_verify(packet_list=packet_list, load=payload, should_receive=True)
> for i in range(0, len(packet_list)):
> self.send_packet_and_verify_checksum(
> - packet=packet_list[i], good_L4=True, good_IP=True, testpmd=testpmd, id=mac_id
> + packet=packet_list[i], good_L4=True, good_IP=True, testpmd=testpmd, id=dport_id
> )
>
> @func_test
> @@ -183,12 +183,12 @@ def test_l4_rx_checksum(self) -> None:
> Verify:
> Verify packet checksums match the expected flags.
> """
> - mac_id = "00:00:00:00:00:01"
> + dport_id = 50000
> packet_list = [
> - Ether(dst=mac_id) / IP() / UDP(),
> - Ether(dst=mac_id) / IP() / TCP(),
> - Ether(dst=mac_id) / IP() / UDP(chksum=0xF),
> - Ether(dst=mac_id) / IP() / TCP(chksum=0xF),
> + Ether() / IP() / UDP(dport=dport_id),
> + Ether() / IP() / TCP(dport=dport_id),
> + Ether() / IP() / UDP(chksum=0xF, dport=dport_id),
> + Ether() / IP() / TCP(chksum=0xF, dport=dport_id),
> ]
> with TestPmdShell(enable_rx_cksum=True) as testpmd:
> testpmd.set_forward_mode(SimpleForwardingModes.csum)
> @@ -196,11 +196,11 @@ def test_l4_rx_checksum(self) -> None:
> self.setup_hw_offload(testpmd=testpmd)
> for i in range(0, 2):
> self.send_packet_and_verify_checksum(
> - packet=packet_list[i], good_L4=True, good_IP=True, testpmd=testpmd, id=mac_id
> + packet=packet_list[i], good_L4=True, good_IP=True, testpmd=testpmd, id=dport_id
> )
> for i in range(2, 4):
> self.send_packet_and_verify_checksum(
> - packet=packet_list[i], good_L4=False, good_IP=True, testpmd=testpmd, id=mac_id
> + packet=packet_list[i], good_L4=False, good_IP=True, testpmd=testpmd, id=dport_id
> )
>
> @func_test
> @@ -216,12 +216,12 @@ def test_l3_rx_checksum(self) -> None:
> Verify:
> Verify packet checksums match the expected flags.
> """
> - mac_id = "00:00:00:00:00:01"
> + dport_id = 50000
> packet_list = [
> - Ether(dst=mac_id) / IP() / UDP(),
> - Ether(dst=mac_id) / IP() / TCP(),
> - Ether(dst=mac_id) / IP(chksum=0xF) / UDP(),
> - Ether(dst=mac_id) / IP(chksum=0xF) / TCP(),
> + Ether() / IP() / UDP(dport=dport_id),
> + Ether() / IP() / TCP(dport=dport_id),
> + Ether() / IP(chksum=0xF) / UDP(dport=dport_id),
> + Ether() / IP(chksum=0xF) / TCP(dport=dport_id),
> ]
> with TestPmdShell(enable_rx_cksum=True) as testpmd:
> testpmd.set_forward_mode(SimpleForwardingModes.csum)
> @@ -229,11 +229,11 @@ def test_l3_rx_checksum(self) -> None:
> self.setup_hw_offload(testpmd=testpmd)
> for i in range(0, 2):
> self.send_packet_and_verify_checksum(
> - packet=packet_list[i], good_L4=True, good_IP=True, testpmd=testpmd, id=mac_id
> + packet=packet_list[i], good_L4=True, good_IP=True, testpmd=testpmd, id=dport_id
> )
> for i in range(2, 4):
> self.send_packet_and_verify_checksum(
> - packet=packet_list[i], good_L4=True, good_IP=False, testpmd=testpmd, id=mac_id
> + packet=packet_list[i], good_L4=True, good_IP=False, testpmd=testpmd, id=dport_id
> )
>
> @func_test
> @@ -249,16 +249,16 @@ def test_validate_rx_checksum(self) -> None:
> Verify:
> Verify packet checksums match the expected flags.
> """
> - mac_id = "00:00:00:00:00:01"
> + dport_id = 50000
> packet_list = [
> - Ether(dst=mac_id) / IP() / UDP(),
> - Ether(dst=mac_id) / IP() / TCP(),
> - Ether(dst=mac_id) / IPv6(src="::1") / UDP(),
> - Ether(dst=mac_id) / IPv6(src="::1") / TCP(),
> - Ether(dst=mac_id) / IP(chksum=0x0) / UDP(chksum=0xF),
> - Ether(dst=mac_id) / IP(chksum=0x0) / TCP(chksum=0xF),
> - Ether(dst=mac_id) / IPv6(src="::1") / UDP(chksum=0xF),
> - Ether(dst=mac_id) / IPv6(src="::1") / TCP(chksum=0xF),
> + Ether() / IP() / UDP(dport=dport_id),
> + Ether() / IP() / TCP(dport=dport_id),
> + Ether() / IPv6(src="::1") / UDP(dport=dport_id),
> + Ether() / IPv6(src="::1") / TCP(dport=dport_id),
> + Ether() / IP(chksum=0x0) / UDP(chksum=0xF, dport=dport_id),
> + Ether() / IP(chksum=0x0) / TCP(chksum=0xF, dport=dport_id),
> + Ether() / IPv6(src="::1") / UDP(chksum=0xF, dport=dport_id),
> + Ether() / IPv6(src="::1") / TCP(chksum=0xF, dport=dport_id),
> ]
> with TestPmdShell(enable_rx_cksum=True) as testpmd:
> testpmd.set_forward_mode(SimpleForwardingModes.csum)
> @@ -266,15 +266,19 @@ def test_validate_rx_checksum(self) -> None:
> self.setup_hw_offload(testpmd=testpmd)
> for i in range(0, 4):
> self.send_packet_and_verify_checksum(
> - packet=packet_list[i], good_L4=True, good_IP=True, testpmd=testpmd, id=mac_id
> + packet=packet_list[i], good_L4=True, good_IP=True, testpmd=testpmd, id=dport_id
> )
> for i in range(4, 6):
> self.send_packet_and_verify_checksum(
> - packet=packet_list[i], good_L4=False, good_IP=False, testpmd=testpmd, id=mac_id
> + packet=packet_list[i],
> + good_L4=False,
> + good_IP=False,
> + testpmd=testpmd,
> + id=dport_id,
> )
> for i in range(6, 8):
> self.send_packet_and_verify_checksum(
> - packet=packet_list[i], good_L4=False, good_IP=True, testpmd=testpmd, id=mac_id
> + packet=packet_list[i], good_L4=False, good_IP=True, testpmd=testpmd, id=dport_id
> )
>
> @requires(NicCapability.RX_OFFLOAD_VLAN)
> @@ -291,13 +295,29 @@ def test_vlan_checksum(self) -> None:
> Verify:
> Verify packet checksums match the expected flags.
> """
> - mac_id = "00:00:00:00:00:01"
> + dport_id = 50000
> payload = b"xxxxx"
> packet_list = [
> - Ether(dst=mac_id) / Dot1Q(vlan=1) / IP(chksum=0x0) / UDP(chksum=0xF) / Raw(payload),
> - Ether(dst=mac_id) / Dot1Q(vlan=1) / IP(chksum=0x0) / TCP(chksum=0xF) / Raw(payload),
> - Ether(dst=mac_id) / Dot1Q(vlan=1) / IPv6(src="::1") / UDP(chksum=0xF) / Raw(payload),
> - Ether(dst=mac_id) / Dot1Q(vlan=1) / IPv6(src="::1") / TCP(chksum=0xF) / Raw(payload),
> + Ether()
> + / Dot1Q(vlan=1)
> + / IP(chksum=0x0)
> + / UDP(chksum=0xF, dport=dport_id)
> + / Raw(payload),
> + Ether()
> + / Dot1Q(vlan=1)
> + / IP(chksum=0x0)
> + / TCP(chksum=0xF, dport=dport_id)
> + / Raw(payload),
> + Ether()
> + / Dot1Q(vlan=1)
> + / IPv6(src="::1")
> + / UDP(chksum=0xF, dport=dport_id)
> + / Raw(payload),
> + Ether()
> + / Dot1Q(vlan=1)
> + / IPv6(src="::1")
> + / TCP(chksum=0xF, dport=dport_id)
> + / Raw(payload),
> ]
> with TestPmdShell(enable_rx_cksum=True) as testpmd:
> testpmd.set_forward_mode(SimpleForwardingModes.csum)
> @@ -307,11 +327,15 @@ def test_vlan_checksum(self) -> None:
> self.send_packets_and_verify(packet_list=packet_list, load=payload, should_receive=True)
> for i in range(0, 2):
> self.send_packet_and_verify_checksum(
> - packet=packet_list[i], good_L4=False, good_IP=False, testpmd=testpmd, id=mac_id
> + packet=packet_list[i],
> + good_L4=False,
> + good_IP=False,
> + testpmd=testpmd,
> + id=dport_id,
> )
> for i in range(2, 4):
> self.send_packet_and_verify_checksum(
> - packet=packet_list[i], good_L4=False, good_IP=True, testpmd=testpmd, id=mac_id
> + packet=packet_list[i], good_L4=False, good_IP=True, testpmd=testpmd, id=dport_id
> )
>
> @requires(NicCapability.RX_OFFLOAD_SCTP_CKSUM)
> @@ -328,10 +352,10 @@ def test_validate_sctp_checksum(self) -> None:
> Verify:
> Verify packet checksums match the expected flags.
> """
> - mac_id = "00:00:00:00:00:01"
> + dport_id = 50000
> packet_list = [
> - Ether(dst=mac_id) / IP() / SCTP(),
> - Ether(dst=mac_id) / IP() / SCTP(chksum=0xF),
> + Ether() / IP() / UDP(dport=dport_id) / SCTP(),
> + Ether() / IP() / UDP(dport=dport_id) / SCTP(chksum=0xF),
> ]
> with TestPmdShell(enable_rx_cksum=True) as testpmd:
> testpmd.set_forward_mode(SimpleForwardingModes.csum)
> @@ -339,8 +363,8 @@ def test_validate_sctp_checksum(self) -> None:
> testpmd.csum_set_hw(layers=ChecksumOffloadOptions.sctp)
> testpmd.start()
> self.send_packet_and_verify_checksum(
> - packet=packet_list[0], good_L4=True, good_IP=True, testpmd=testpmd, id=mac_id
> + packet=packet_list[0], good_L4=True, good_IP=True, testpmd=testpmd, id=dport_id
> )
> self.send_packet_and_verify_checksum(
> - packet=packet_list[1], good_L4=False, good_IP=True, testpmd=testpmd, id=mac_id
> + packet=packet_list[1], good_L4=False, good_IP=True, testpmd=testpmd, id=dport_id
> )
> --
> 2.48.1
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v1 3/4] dts: remove unnecessary capability requirement
2025-03-06 21:47 ` [PATCH v1 3/4] dts: remove unnecessary capability requirement Dean Marx
2025-05-14 15:38 ` Luca Vizzarro
@ 2025-05-14 20:21 ` Nicholas Pratte
1 sibling, 0 replies; 13+ messages in thread
From: Nicholas Pratte @ 2025-05-14 20:21 UTC (permalink / raw)
To: Dean Marx
Cc: probb, luca.vizzarro, yoan.picchi, Honnappa.Nagarahalli,
paul.szczepanek, dev
Reviewed-by: Nicholas Pratte <npratte@iol.unh.edu>
On Thu, Mar 6, 2025 at 4:47 PM Dean Marx <dmarx@iol.unh.edu> wrote:
>
> Remove capability requirement from checksum offload test suite
> that was not required to run the test cases.
>
> Signed-off-by: Dean Marx <dmarx@iol.unh.edu>
> ---
> dts/tests/TestSuite_checksum_offload.py | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/dts/tests/TestSuite_checksum_offload.py b/dts/tests/TestSuite_checksum_offload.py
> index 83879b0512..c9efdcaa1c 100644
> --- a/dts/tests/TestSuite_checksum_offload.py
> +++ b/dts/tests/TestSuite_checksum_offload.py
> @@ -30,7 +30,6 @@
>
>
> @requires(topology_type=TopologyType.two_links)
> -@requires(NicCapability.RX_OFFLOAD_CHECKSUM)
> @requires(NicCapability.RX_OFFLOAD_IPV4_CKSUM)
> @requires(NicCapability.RX_OFFLOAD_UDP_CKSUM)
> @requires(NicCapability.RX_OFFLOAD_TCP_CKSUM)
> --
> 2.48.1
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v1 4/4] change verification field in unified packet suite
2025-03-06 21:47 ` [PATCH v1 4/4] change verification field in unified packet suite Dean Marx
2025-05-14 15:42 ` Luca Vizzarro
@ 2025-05-14 20:23 ` Nicholas Pratte
1 sibling, 0 replies; 13+ messages in thread
From: Nicholas Pratte @ 2025-05-14 20:23 UTC (permalink / raw)
To: Dean Marx
Cc: probb, luca.vizzarro, yoan.picchi, Honnappa.Nagarahalli,
paul.szczepanek, dev
Looks good!
Reviewed-by: Nicholas Pratte <npratte@iol.unh.edu>
On Thu, Mar 6, 2025 at 4:47 PM Dean Marx <dmarx@iol.unh.edu> wrote:
>
> 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
>
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2025-05-14 20:23 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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-05-14 15:37 ` Luca Vizzarro
2025-05-14 20:12 ` Nicholas Pratte
2025-03-06 21:47 ` [PATCH v1 2/4] dts: change verification field in checksum offload suite Dean Marx
2025-05-14 15:38 ` Luca Vizzarro
2025-05-14 20:20 ` Nicholas Pratte
2025-03-06 21:47 ` [PATCH v1 3/4] dts: remove unnecessary capability requirement Dean Marx
2025-05-14 15:38 ` Luca Vizzarro
2025-05-14 20:21 ` Nicholas Pratte
2025-03-06 21:47 ` [PATCH v1 4/4] change verification field in unified packet suite Dean Marx
2025-05-14 15:42 ` Luca Vizzarro
2025-05-14 20:23 ` Nicholas Pratte
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).