DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/4] net/axgbe: fix scattered Rx function
@ 2022-09-01  5:33 Bhagyada Modali
  2022-09-01  5:33 ` [PATCH 2/4] " Bhagyada Modali
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Bhagyada Modali @ 2022-09-01  5:33 UTC (permalink / raw)
  To: ferruh.yigit, chandu; +Cc: dev, Bhagyada Modali

Error check needs to be done only for last segment of Jumbo packet.
Freed first_seg and reset eop to 0 in error case

Fixes: 965b3127d425 ("net/axgbe: support scattered Rx")

Signed-off-by: Bhagyada Modali <bhagyada.modali@amd.com>
---
 drivers/net/axgbe/axgbe_rxtx.c | 32 +++++++++++++++++++-------------
 1 file changed, 19 insertions(+), 13 deletions(-)

diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c
index f38bb64fab..6909d3a852 100644
--- a/drivers/net/axgbe/axgbe_rxtx.c
+++ b/drivers/net/axgbe/axgbe_rxtx.c
@@ -381,19 +381,6 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
 		}
 
 		mbuf = rxq->sw_ring[idx];
-		/* Check for any errors and free mbuf*/
-		err = AXGMAC_GET_BITS_LE(desc->write.desc3,
-					 RX_NORMAL_DESC3, ES);
-		error_status = 0;
-		if (unlikely(err)) {
-			error_status = desc->write.desc3 & AXGBE_ERR_STATUS;
-			if ((error_status != AXGBE_L3_CSUM_ERR)
-					&& (error_status != AXGBE_L4_CSUM_ERR)) {
-				rxq->errors++;
-				rte_pktmbuf_free(mbuf);
-				goto err_set;
-			}
-		}
 		rte_prefetch1(rte_pktmbuf_mtod(mbuf, void *));
 
 		if (!AXGMAC_GET_BITS_LE(desc->write.desc3,
@@ -406,6 +393,25 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
 			pkt_len = AXGMAC_GET_BITS_LE(desc->write.desc3,
 					RX_NORMAL_DESC3, PL);
 			data_len = pkt_len - rxq->crc_len;
+			/* Check for any errors and free mbuf*/
+			err = AXGMAC_GET_BITS_LE(desc->write.desc3,
+					RX_NORMAL_DESC3, ES);
+			error_status = 0;
+			if (unlikely(err)) {
+				error_status = desc->write.desc3 &
+					AXGBE_ERR_STATUS;
+				if ((error_status != AXGBE_L3_CSUM_ERR) &&
+						(error_status !=
+						 AXGBE_L4_CSUM_ERR)) {
+					rxq->errors++;
+					rte_pktmbuf_free(mbuf);
+					rte_pktmbuf_free(first_seg);
+					first_seg = NULL;
+					eop = 0;
+					goto err_set;
+				}
+			}
+
 		}
 
 		if (first_seg != NULL) {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-09-05 16:48 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-01  5:33 [PATCH 1/4] net/axgbe: fix scattered Rx function Bhagyada Modali
2022-09-01  5:33 ` [PATCH 2/4] " Bhagyada Modali
2022-09-01  5:33 ` [PATCH 3/4] " Bhagyada Modali
2022-09-01  5:33 ` [PATCH 4/4] " Bhagyada Modali
2022-09-01 12:49 ` [PATCH v2 1/4] net/axgbe: fix scattered Rx Bhagyada Modali
2022-09-01 12:49   ` [PATCH v2 2/4] net/axgbe: fix mbuf lengths in " Bhagyada Modali
2022-09-01 12:49   ` [PATCH v2 3/4] net/axgbe: fix length of each segment " Bhagyada Modali
2022-09-01 12:49   ` [PATCH v2 4/4] net/axgbe: fix checksum and RSS " Bhagyada Modali
2022-09-01 15:03   ` [PATCH v2 1/4] net/axgbe: fix " Ferruh Yigit
2022-09-02  8:47   ` [PATCH v3 " Bhagyada Modali
2022-09-02  8:47     ` [PATCH v3 2/4] net/axgbe: fix mbuf lengths in " Bhagyada Modali
2022-09-02  8:47     ` [PATCH v3 3/4] net/axgbe: fix length of each segment " Bhagyada Modali
2022-09-02  8:47     ` [PATCH v3 4/4] net/axgbe: fix checksum and RSS " Bhagyada Modali
2022-09-05  5:00     ` [PATCH v3 1/4] net/axgbe: fix " Namburu, Chandu-babu
2022-09-05 16:48       ` Ferruh Yigit

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).