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 9B7FB48958 for ; Thu, 16 Oct 2025 21:23:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6EA16427BE; Thu, 16 Oct 2025 21:23:19 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by mails.dpdk.org (Postfix) with ESMTP id E6C3240288 for ; Tue, 14 Oct 2025 07:56:07 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id C9DDD1A1BCF; Tue, 14 Oct 2025 07:56:07 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 9E5B51A1BD8; Tue, 14 Oct 2025 07:56:07 +0200 (CEST) Received: from lsv031405.swis.in-blr01.nxp.com (lsv031405.swis.in-blr01.nxp.com [92.120.147.93]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 1DBBA1800086; Tue, 14 Oct 2025 13:56:07 +0800 (+08) From: Prashant Gupta To: Hemant.agrawal@nxp.com, g.singh@nxp.com Cc: stable@dpdk.org, Brick Yang Subject: [PATCH 03/15] net/dpaa2: fix L3/L4 csum results in packet parse Date: Tue, 14 Oct 2025 11:25:53 +0530 Message-ID: <20251014055605.1303410-4-prashant.gupta_3@nxp.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251014055605.1303410-1-prashant.gupta_3@nxp.com> References: <20251014055605.1303410-1-prashant.gupta_3@nxp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP X-Mailman-Approved-At: Thu, 16 Oct 2025 21:23:18 +0200 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 From: Brick Yang Layer3 and layer4 checksum validation and error status is part of word1 of annotation area, but driver is looking into wrong word. This patch fixes the checksum error status in packet parsing. Fixes: 94d31549c380 ("net/dpaa2: support Rx checksum offload in slow parsing") Cc: stable@dpdk.org Signed-off-by: Gagandeep Singh Signed-off-by: Brick Yang --- drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h | 10 +++++----- drivers/net/dpaa2/dpaa2_rxtx.c | 17 ++--------------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h b/drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h index d156b07087..a670098958 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved. - * Copyright 2016,2019 NXP + * Copyright 2016,2019,2022,2024 NXP * */ @@ -304,13 +304,13 @@ struct dpaa2_faead { #define DPAA2_ETH_FAS_PHE 0x00000020 #define DPAA2_ETH_FAS_BLE 0x00000010 /* L3 csum validation performed */ -#define DPAA2_ETH_FAS_L3CV 0x00000008 +#define DPAA2_ETH_FAS_L3CV 0x0000000800000000 /* L3 csum error */ -#define DPAA2_ETH_FAS_L3CE 0x00000004 +#define DPAA2_ETH_FAS_L3CE 0x0000000400000000 /* L4 csum validation performed */ -#define DPAA2_ETH_FAS_L4CV 0x00000002 +#define DPAA2_ETH_FAS_L4CV 0x0000000200000000 /* L4 csum error */ -#define DPAA2_ETH_FAS_L4CE 0x00000001 +#define DPAA2_ETH_FAS_L4CE 0x0000000100000000 #ifdef __cplusplus } diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index 656a3a423f..6cb91e67d4 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -201,14 +201,10 @@ dpaa2_dev_rx_parse_slow(struct rte_mbuf *mbuf, goto parse_done; } - if (BIT_ISSET_AT_POS(annotation->word8, DPAA2_ETH_FAS_L3CE)) + if (BIT_ISSET_AT_POS(annotation->word1, DPAA2_ETH_FAS_L3CE)) mbuf->ol_flags |= RTE_MBUF_F_RX_IP_CKSUM_BAD; - else - mbuf->ol_flags |= RTE_MBUF_F_RX_IP_CKSUM_GOOD; - if (BIT_ISSET_AT_POS(annotation->word8, DPAA2_ETH_FAS_L4CE)) + else if (BIT_ISSET_AT_POS(annotation->word1, DPAA2_ETH_FAS_L4CE)) mbuf->ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_BAD; - else - mbuf->ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_GOOD; if (BIT_ISSET_AT_POS(annotation->word4, L3_IP_1_FIRST_FRAGMENT | L3_IP_1_MORE_FRAGMENT | @@ -248,15 +244,6 @@ dpaa2_dev_rx_parse(struct rte_mbuf *mbuf, void *hw_annot_addr) DPAA2_PMD_DP_DEBUG("(fast parse) Annotation = 0x%" PRIx64 "\t", annotation->word4); - if (BIT_ISSET_AT_POS(annotation->word8, DPAA2_ETH_FAS_L3CE)) - mbuf->ol_flags |= RTE_MBUF_F_RX_IP_CKSUM_BAD; - else - mbuf->ol_flags |= RTE_MBUF_F_RX_IP_CKSUM_GOOD; - if (BIT_ISSET_AT_POS(annotation->word8, DPAA2_ETH_FAS_L4CE)) - mbuf->ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_BAD; - else - mbuf->ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_GOOD; - if (unlikely(dpaa2_print_parser_result)) dpaa2_print_parse_result(annotation); -- 2.43.0