Skip to content

Commit 644b843

Browse files
oleremkuba-moo
authored andcommitted
net: stmmac: dwmac4: report Rx checksum errors in status
Propagate hardware checksum failures from the descriptor parser to the caller. Currently, dwmac4_wrback_get_rx_status() updates stats when the Rx descriptor signals an IP header or payload checksum error, but it does not reflect this in its return value. The higher-level stmmac_rx() code therefore cannot tell that hardware checksum validation failed. Set the csum_none flag in the returned status when either RDES1_IP_HDR_ERROR or RDES1_IP_PAYLOAD_ERROR is present. This aligns dwmac4 with enh_desc_coe_rdes0() and lets stmmac_rx() mark the skb as CHECKSUM_NONE for software verification. This is a preparatory step for disabling the hardware filter that drops frames which do not pass checksum validation. Signed-off-by: Oleksij Rempel <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ee0aace commit 644b843

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,20 @@ static int dwmac4_wrback_get_rx_status(struct stmmac_extra_stats *x,
110110

111111
message_type = (rdes1 & ERDES4_MSG_TYPE_MASK) >> 8;
112112

113-
if (rdes1 & RDES1_IP_HDR_ERROR)
113+
if (rdes1 & RDES1_IP_HDR_ERROR) {
114114
x->ip_hdr_err++;
115+
ret |= csum_none;
116+
}
115117
if (rdes1 & RDES1_IP_CSUM_BYPASSED)
116118
x->ip_csum_bypassed++;
117119
if (rdes1 & RDES1_IPV4_HEADER)
118120
x->ipv4_pkt_rcvd++;
119121
if (rdes1 & RDES1_IPV6_HEADER)
120122
x->ipv6_pkt_rcvd++;
121-
if (rdes1 & RDES1_IP_PAYLOAD_ERROR)
123+
if (rdes1 & RDES1_IP_PAYLOAD_ERROR) {
122124
x->ip_payload_err++;
125+
ret |= csum_none;
126+
}
123127

124128
if (message_type == RDES_EXT_NO_PTP)
125129
x->no_ptp_rx_msg_type_ext++;

0 commit comments

Comments
 (0)