[PATCH 03/15] net/dpaa2: fix L3/L4 csum results in packet parse
Hemant Agrawal
hemant.agrawal at oss.nxp.com
Wed Oct 15 17:34:55 CEST 2025
On 14-10-2025 12:10, Prashant Gupta wrote:
> [Some people who received this message don't often get email from prashant.gupta_3 at nxp.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> From: Brick Yang <brick.yang at 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 at dpdk.org
>
> Signed-off-by: Gagandeep Singh <g.singh at nxp.com>
> Signed-off-by: Brick Yang <brick.yang at 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;
> -
why the checksum parsing code is removed from dpaa2_dev_rx_parse?
> if (unlikely(dpaa2_print_parser_result))
> dpaa2_print_parse_result(annotation);
>
> --
> 2.43.0
>
More information about the dev
mailing list