From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: dev@dpdk.org, stephen@networkplumber.org, david.marchand@redhat.com
Cc: stable@dpdk.org
Subject: [PATCH 05/11] net/enetfec: fix checksum flag handling and error return
Date: Mon, 6 Oct 2025 13:34:04 +0530 [thread overview]
Message-ID: <20251006080410.1433284-6-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <20251006080410.1433284-1-hemant.agrawal@nxp.com>
- Corrects the logic for setting RX checksum flags based on error status.
- Updates TX checksum offload condition to check for TX flags.
- Fixes incorrect error return in RX queue setup by replacing `errno`
with `-ENOMEM`.
Fixes: ecae71571b0d ("net/enetfec: support Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/net/enetfec/enet_rxtx.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/net/enetfec/enet_rxtx.c b/drivers/net/enetfec/enet_rxtx.c
index 0aea8b240d..ea2c28a26b 100644
--- a/drivers/net/enetfec/enet_rxtx.c
+++ b/drivers/net/enetfec/enet_rxtx.c
@@ -121,10 +121,11 @@ enetfec_recv_pkts(void *rxq1, struct rte_mbuf **rx_pkts,
(rxq->fep->flag_csum & RX_FLAG_CSUM_EN)) {
if ((rte_read32(&ebdp->bd_esc) &
rte_cpu_to_le_32(RX_FLAG_CSUM_ERR)) == 0) {
- /* don't check it */
- mbuf->ol_flags = RTE_MBUF_F_RX_IP_CKSUM_BAD;
- } else {
+ /* No checksum error - checksum is good */
mbuf->ol_flags = RTE_MBUF_F_RX_IP_CKSUM_GOOD;
+ } else {
+ /* Checksum error detected */
+ mbuf->ol_flags = RTE_MBUF_F_RX_IP_CKSUM_BAD;
}
}
@@ -238,7 +239,8 @@ enetfec_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
if (txq->fep->bufdesc_ex) {
struct bufdesc_ex *ebdp = (struct bufdesc_ex *)bdp;
- if (mbuf->ol_flags == RTE_MBUF_F_RX_IP_CKSUM_GOOD)
+ if (mbuf->ol_flags & (RTE_MBUF_F_TX_IP_CKSUM | RTE_MBUF_F_TX_TCP_CKSUM |
+ RTE_MBUF_F_TX_UDP_CKSUM | RTE_MBUF_F_TX_SCTP_CKSUM))
estatus |= TX_BD_PINS | TX_BD_IINS;
rte_write32(0, &ebdp->bd_bdu);
--
2.25.1
next prev parent reply other threads:[~2025-10-06 8:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-06 8:03 [PATCH 00/11] net/enetc: various fixes and enhancements Hemant Agrawal
2025-10-06 8:04 ` [PATCH 01/11] net/enetfec: fix file descriptor leak on read error Hemant Agrawal
2025-10-06 8:04 ` [PATCH 02/11] net/enetfec: fix out-of-bounds access in UIO mapping Hemant Agrawal
2025-10-06 8:04 ` [PATCH 03/11] net/enetfec: fix buffer descriptor size configuration Hemant Agrawal
2025-10-06 8:04 ` [PATCH 04/11] net/enetfec: fix incorrect Tx queue free logic Hemant Agrawal
2025-10-06 8:04 ` Hemant Agrawal [this message]
2025-10-06 8:04 ` [PATCH 06/11] net/enetfec: fix to reject multi-queue configuration Hemant Agrawal
2025-10-06 8:04 ` [PATCH 07/11] net/enetfec: fix memory leak in Rx buffer cleanup Hemant Agrawal
2025-10-06 8:04 ` [PATCH 08/11] net/enetfec: fix to add check for Rx/Tx deferred queue Hemant Agrawal
2025-10-06 8:04 ` [PATCH 09/11] net/enetfec: handle cache for forwarded packets Hemant Agrawal
2025-10-06 8:04 ` [PATCH 10/11] net/enetfec: support to set MAC address Hemant Agrawal
2025-10-06 8:04 ` [PATCH 11/11] net/enetfec: add software packet type parsing and cleanup Hemant Agrawal
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=20251006080410.1433284-6-hemant.agrawal@nxp.com \
--to=hemant.agrawal@nxp.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--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).