* [PATCH 24.11] dts: add reception check to checksum suite
@ 2025-10-31 17:44 Dean Marx
2025-10-31 18:02 ` Kevin Traynor
0 siblings, 1 reply; 2+ messages in thread
From: Dean Marx @ 2025-10-31 17:44 UTC (permalink / raw)
To: probb, ktraynor; +Cc: stable, Dean Marx, Luca Vizzarro
[ upstream commit 89b634c9cf001570a7a1b1992ea6992c4181b8d7 ]
In the current implementation of Checksum Offload, the variables
is_L4 and is_IP are not initialized outside of the loop that
checks the received packet, so if the packet is dropped these
variables cause a NameError in the verification steps.
Add a line that sets these variables to None prior to the check,
then verifies they are not None directly after.
Fixes: 8c9a7471a0e6 ("dts: add checksum offload test suite")
Signed-off-by: Dean Marx <dmarx@iol.unh.edu>
Reviewed-by: Patrick Robb <probb@iol.unh.edu>
Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
---
dts/tests/TestSuite_checksum_offload.py | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/dts/tests/TestSuite_checksum_offload.py b/dts/tests/TestSuite_checksum_offload.py
index 1a933563b6..f94d12232b 100644
--- a/dts/tests/TestSuite_checksum_offload.py
+++ b/dts/tests/TestSuite_checksum_offload.py
@@ -86,12 +86,17 @@ def send_packet_and_verify_checksum(
testpmd.start()
self.send_packet_and_capture(packet=packet)
verbose_output = testpmd.extract_verbose_output(testpmd.stop())
+ is_IP = is_L4 = None
for packet in verbose_output:
if packet.dst_mac == id:
- isIP = PacketOffloadFlag.RTE_MBUF_F_RX_IP_CKSUM_GOOD in packet.ol_flags
- isL4 = PacketOffloadFlag.RTE_MBUF_F_RX_L4_CKSUM_GOOD in packet.ol_flags
- self.verify(isL4 == goodL4, "Layer 4 checksum flag did not match expected checksum flag.")
- self.verify(isIP == goodIP, "IP checksum flag did not match expected checksum flag.")
+ is_IP = PacketOffloadFlag.RTE_MBUF_F_RX_IP_CKSUM_GOOD in packet.ol_flags
+ is_L4 = PacketOffloadFlag.RTE_MBUF_F_RX_L4_CKSUM_GOOD in packet.ol_flags
+ self.verify(
+ is_IP is not None and is_L4 is not None,
+ "Test packet was dropped when it should have been received.",
+ )
+ self.verify(is_L4 == goodL4, "Layer 4 checksum flag did not match expected checksum flag.")
+ self.verify(is_IP == goodIP, "IP checksum flag did not match expected checksum flag.")
def setup_hw_offload(self, testpmd: TestPmdShell) -> None:
"""Sets IP, UDP, and TCP layers to hardware offload.
--
2.51.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 24.11] dts: add reception check to checksum suite
2025-10-31 17:44 [PATCH 24.11] dts: add reception check to checksum suite Dean Marx
@ 2025-10-31 18:02 ` Kevin Traynor
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Traynor @ 2025-10-31 18:02 UTC (permalink / raw)
To: Dean Marx, probb; +Cc: stable, Luca Vizzarro
On 31/10/2025 17:44, Dean Marx wrote:
> [ upstream commit 89b634c9cf001570a7a1b1992ea6992c4181b8d7 ]
>
> In the current implementation of Checksum Offload, the variables
> is_L4 and is_IP are not initialized outside of the loop that
> checks the received packet, so if the packet is dropped these
> variables cause a NameError in the verification steps.
> Add a line that sets these variables to None prior to the check,
> then verifies they are not None directly after.
>
> Fixes: 8c9a7471a0e6 ("dts: add checksum offload test suite")
>
> Signed-off-by: Dean Marx <dmarx@iol.unh.edu>
> Reviewed-by: Patrick Robb <probb@iol.unh.edu>
> Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
> ---
> dts/tests/TestSuite_checksum_offload.py | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
Thanks Dean. I have queued this up and will push to the branch next week.
regards,
Kevin.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-10-31 18:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-31 17:44 [PATCH 24.11] dts: add reception check to checksum suite Dean Marx
2025-10-31 18:02 ` Kevin Traynor
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).