DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dean Marx <dmarx@iol.unh.edu>
To: probb@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 2/2] dts: add exception handling to checksum verify method
Date: Tue, 22 Jul 2025 13:22:14 -0400	[thread overview]
Message-ID: <20250722172214.202308-2-dmarx@iol.unh.edu> (raw)
In-Reply-To: <20250722172214.202308-1-dmarx@iol.unh.edu>

Current implementation of the checksum offload test suite
contains a section in the verify checksum method
that causes NameError exceptions when the packet is
dropped. Add a try block to encapsulate this section
and handle any errors created.

Fixes: 8c9a7471a0e6 ("dts: add checksum offload test suite")

Signed-off-by: Dean Marx <dmarx@iol.unh.edu>
---
 dts/tests/TestSuite_checksum_offload.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dts/tests/TestSuite_checksum_offload.py b/dts/tests/TestSuite_checksum_offload.py
index b03c3d46ed..9dfbcb8028 100644
--- a/dts/tests/TestSuite_checksum_offload.py
+++ b/dts/tests/TestSuite_checksum_offload.py
@@ -89,8 +89,11 @@ def send_packet_and_verify_checksum(
             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.")
-        self.verify(is_IP == good_IP, "IP checksum flag did not match expected checksum flag.")
+        try:
+            self.verify(is_L4 == good_L4, "Layer 4 checksum flag did not match expected checksum flag.")
+            self.verify(is_IP == good_IP, "IP checksum flag did not match expected checksum flag.")
+        except NameError:
+            self.verify(False, "Test packet was dropped when it should have been received.")
 
     def setup_hw_offload(self, testpmd: TestPmdShell) -> None:
         """Sets IP, UDP, and TCP layers to hardware offload.
-- 
2.50.1


      reply	other threads:[~2025-07-22 17:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-22 17:22 [PATCH v1 1/2] dts: fix docstring typo in checksum suite Dean Marx
2025-07-22 17:22 ` 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=20250722172214.202308-2-dmarx@iol.unh.edu \
    --to=dmarx@iol.unh.edu \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=dev@dpdk.org \
    --cc=luca.vizzarro@arm.com \
    --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).