🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by Mohd Ayaan Anwar Mon, 23 Nov 2026 18:41
[PATCH RFC net-next 1/2] net: stmmac: dwmac4: accept dribble-only receive frames
#21231
Author: Mohd Ayaan Anwar
Date: Mon, 23 Nov 2026 18:41
46 lines
17727 bytes
Commit 1cc5a735185a ("stmmac: do not discard frame on dribbling bit
assert") removed the packet drop condition for descriptors which report
only a dribble error for Normal and Enhanced descriptors, since a
dribble error with the correct FCS doesn't necessarily mean a bad
packet.

Do the same for dwmac4; accept receive frames with dribble-only errors
while still counting them in the error statistics.

Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c | 4 +++-
 drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.h | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
index c6a8f8d73501..2549ffaf9cef 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
@@ -102,7 +102,9 @@ static int dwmac4_wrback_get_rx_status(struct stmmac_extra_stats *x,
 		if (unlikely(rdes3 & RDES3_DRIBBLE_ERROR))
 			x->dribbling_bit++;
 
-		ret = discard_frame;
+		if ((rdes3 & RDES3_ERROR_SUMMARY_MASK) !=
+		    RDES3_DRIBBLE_ERROR)
+			ret = discard_frame;
 	}
 
 	message_type = FIELD_GET(RDES1_PTP_MSG_TYPE_MASK, rdes1);
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.h b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.h
index fb1fea5b0e6e..8e8762f9e0c8 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.h
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.h
@@ -120,6 +120,7 @@
 #define RDES3_RECEIVE_WATCHDOG		BIT(22)
 #define RDES3_GIANT_PACKET		BIT(23)
 #define RDES3_CRC_ERROR			BIT(24)
+#define RDES3_ERROR_SUMMARY_MASK	GENMASK(24, 19)
 #define RDES3_RDES0_VALID		BIT(25)
 #define RDES3_RDES1_VALID		BIT(26)
 #define RDES3_RDES2_VALID		BIT(27)

-- 
2.34.1
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads