From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CCFDA48A46 for ; Fri, 31 Oct 2025 18:44:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B171140150; Fri, 31 Oct 2025 18:44:19 +0100 (CET) Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) by mails.dpdk.org (Postfix) with ESMTP id 2CC3040150 for ; Fri, 31 Oct 2025 18:44:18 +0100 (CET) Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-891208f6185so218432985a.1 for ; Fri, 31 Oct 2025 10:44:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1761932657; x=1762537457; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=gjpxV3zoAUVS+pfD66mUDvJjOnKojAqsYwikJeq48kc=; b=XV1QjjtrQZVi1nyr8pDMRcEoS0e+sU0bA+pb1ZgRPnLuSh1HvY5DSdeLBJG3qrXVMG AW8e/tnNJihlH3UQBzbKiKVA2nx9O6W+Nr9LxIZxvuRP9Hrf/+vqElYlBMCRUDe6nOta qNAuvQA8UcBVXrGEB4JjjkMsjOGjhioLGbnOk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761932657; x=1762537457; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gjpxV3zoAUVS+pfD66mUDvJjOnKojAqsYwikJeq48kc=; b=VRKzXibvvsbP8cDQcvHaPLoVh55B94JI59S2RDJ0R83GaU+XnloGYbl8JhdQpB1CYd /qo0aeoieo0GZch6OEPqGZvz1VQUqZrCWfX5yweUwX5PyTjKCBCJt8bPtPyLDlG/xT3G PaofgUdgO+29uCB+8m1vQFvEdIpVrv+2FkJjdWpRd4f7RXhNUgWqhCokTcP8pd8Zo/3f 6TREAcxCeHruLDrfILTLPEd2OWzWdvOkb1o3rysWVW0dYPMHFS3rfHn2ZFRsSBTYT5z+ Fx3Hf2Zuqd57lf5j4uLC03nUmM13xS4xC8JKV61QnLZccV66bnt2TRXW8GjdqEUxQxwV c3Vg== X-Gm-Message-State: AOJu0Yz9z4Hf3y3IOPyzpKqq5vJLVN259QAVGEK+dDfah5JZjpMcTvdK z2X2gYvxoHJMBHwH3ZOKTRm4rHf6Qo5gRi7haK+g9+wKFfUKchvFP7WoOKNtTeL28F8= X-Gm-Gg: ASbGncvubi3z8+HIXPXixjCjIzwi+MODmMpNYjz3fSKQ0R67b7CT1hEr82Kdo81SQK1 wV+n1VtEnvdEQq26IJ397cMISojyvZJTtbAipfYuM5e13QrZIuZS0c0K1LWRgsnqsNkezbDZ5+H xnhdKQYx60qNtx7Brto3tCD4/huNWuJWkGQzx2iQeOsaZ3QlJSOJ5HZRep/fVGI1bjlupVy2IIf CojiCVGBqgt4vegtKBuvWPLIicuCsVEJae34XK23oCzdhsl7+v8boPDcofURWqtQMSvNEg8uNXH XsHpKSmels+SOByxhwNIR64kUEb5PKK+fHAUq/u16BHPMpHg1LN+DhibsUJIC11tiuPunHsU1nl 08KTBGEuGBm+ou1kJhpz6czYPJZCnhaHDpooCRFVq5ECOiJnycMiH+F2mviYN9qbDtTal X-Google-Smtp-Source: AGHT+IFrq0XrbfieYojB0lncMV2ZDgndoVU8xcixa1zWAaOitbzm36AtiwhPZN9klQ2hq1/cbTRDOg== X-Received: by 2002:a05:620a:1a10:b0:892:3a21:7f06 with SMTP id af79cd13be357-8ab99c67c95mr538102585a.37.1761932657346; Fri, 31 Oct 2025 10:44:17 -0700 (PDT) Received: from d121016.iol.unh.edu ([2606:4100:3880:1210::202]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8ac005b1521sm147188085a.2.2025.10.31.10.44.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Oct 2025 10:44:16 -0700 (PDT) From: Dean Marx To: probb@iol.unh.edu, ktraynor@redhat.com Cc: stable@dpdk.org, Dean Marx , Luca Vizzarro Subject: [PATCH 24.11] dts: add reception check to checksum suite Date: Fri, 31 Oct 2025 13:44:14 -0400 Message-ID: <20251031174414.85492-1-dmarx@iol.unh.edu> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org [ 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 Reviewed-by: Patrick Robb Reviewed-by: Luca Vizzarro --- 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