Skip to content

Commit 3342bd3

Browse files
dmarxIOLSevenarth
authored andcommitted
dts: add reception check to checksum offload suite
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: 8c9a747 ("dts: add checksum offload test suite") Signed-off-by: Dean Marx <[email protected]> Reviewed-by: Patrick Robb <[email protected]> Reviewed-by: Luca Vizzarro <[email protected]>
1 parent 389611c commit 3342bd3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dts/tests/TestSuite_checksum_offload.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,15 @@ def send_packet_and_verify_checksum(
8585
testpmd.start()
8686
self.send_packet_and_capture(packet=packet)
8787
verbose_output = testpmd.extract_verbose_output(testpmd.stop())
88+
is_IP = is_L4 = None
8889
for testpmd_packet in verbose_output:
8990
if testpmd_packet.l4_dport == id:
9091
is_IP = PacketOffloadFlag.RTE_MBUF_F_RX_IP_CKSUM_GOOD in testpmd_packet.ol_flags
9192
is_L4 = PacketOffloadFlag.RTE_MBUF_F_RX_L4_CKSUM_GOOD in testpmd_packet.ol_flags
93+
self.verify(
94+
is_IP is not None and is_L4 is not None,
95+
"Test packet was dropped when it should have been received.",
96+
)
9297
self.verify(is_L4 == good_L4, "Layer 4 checksum flag did not match expected checksum flag.")
9398
self.verify(is_IP == good_IP, "IP checksum flag did not match expected checksum flag.")
9499

0 commit comments

Comments
 (0)