dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: Prashant Gupta <prashant.gupta_3@nxp.com>
To: dev@dpdk.org, stephen@networkplumber.org, david.marchand@redhat.com
Cc: stable@dpdk.org, Gagandeep Singh <g.singh@nxp.com>,
	Brick Yang <brick.yang@nxp.com>
Subject: [PATCH 03/15] net/dpaa2: fix L3/L4 csum results in packet parse
Date: Tue, 14 Oct 2025 12:10:23 +0530	[thread overview]
Message-ID: <20251014064035.1312896-4-prashant.gupta_3@nxp.com> (raw)
In-Reply-To: <20251014064035.1312896-1-prashant.gupta_3@nxp.com>

From: Brick Yang <brick.yang@nxp.com>

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 <g.singh@nxp.com>
Signed-off-by: Brick Yang <brick.yang@nxp.com>
---
 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


  parent reply	other threads:[~2025-10-14  7:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-14  6:40 [PATCH 00/15] dpaa2: Fixes and enhancements for DPMAC, stats, and parser Prashant Gupta
2025-10-14  6:40 ` [PATCH 01/15] net/dpaa2: fix uninitialized variable issue Prashant Gupta
2025-10-14  6:40 ` [PATCH 02/15] net/dpaa2: fix to free buffers from error queue Prashant Gupta
2025-10-14  6:40 ` Prashant Gupta [this message]
2025-10-14  6:40 ` [PATCH 04/15] net/dpaa2: fix to recv packets with additional parse errors Prashant Gupta
2025-10-14  6:40 ` [PATCH 05/15] net/dpaa2: fix error frame dump issue Prashant Gupta
2025-10-14  6:40 ` [PATCH 06/15] net/dpaa2: fix flow rule's resizing issue Prashant Gupta
2025-10-14  6:40 ` [PATCH 07/15] net/dpaa2: add dpmac MC header file Prashant Gupta
2025-10-14  6:40 ` [PATCH 08/15] net/dpaa2: support dpmac counters in stats Prashant Gupta
2025-10-14  6:40 ` [PATCH 09/15] net/dpaa2: setup the speed cap based on the actual MAC Prashant Gupta
2025-10-14  6:40 ` [PATCH 10/15] drivers: dpaa2 upgrade fslmc base FW to 10.39.0 Prashant Gupta
2025-10-14  6:40 ` [PATCH 11/15] net/dpaa2: replace global variable to driver flag Prashant Gupta
2025-10-14  6:40 ` [PATCH 12/15] net/dpaa2: add devargs to drop parse packets in HW Prashant Gupta
2025-10-14  6:40 ` [PATCH 13/15] net/dpaa2: optimize to prefetch next parser result Prashant Gupta
2025-10-14  6:40 ` [PATCH 14/15] net/dpaa2: add eCPRI header and message dump Prashant Gupta
2025-10-14  6:40 ` [PATCH 15/15] net/dpaa2: add Policer stats for each TC Prashant Gupta
  -- strict thread matches above, loose matches on Subject: below --
2025-10-14  6:00 [PATCH 00/15] dpaa2: Fixes and enhancements for DPMAC, stats, and parser Prashant Gupta
2025-10-14  6:00 ` [PATCH 03/15] net/dpaa2: fix L3/L4 csum results in packet parse Prashant Gupta

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=20251014064035.1312896-4-prashant.gupta_3@nxp.com \
    --to=prashant.gupta_3@nxp.com \
    --cc=brick.yang@nxp.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=g.singh@nxp.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    /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).