From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382674; b=Jp4/1SGISNC5bGwxj1wFI/Wsk7DjMA9Nd+3uiVomQ4gmlf9bUp3gLixGk/SJQmAgMshX qaoNl4ynyVTO1ggjNwqlyRVG9FwhvLyL0EhClpsjKDaeGXfnzz+A4PIundu60x41UOXEV f0+L9MVYguwyIC/FKoiTySmbP358Fw+W3OsQ5YjZQCxSu7GgGWoI9+dp7NTXQCI2pZcqm oGGUbdA19EjMwLZztkFOsA75Io9Cy86LtF0JIiEsp5aQjI8cbbtZ2d6SDeUDNXaOazpcm EXQgZfktgj4XVV+Ice6byl5g47W0J5hXwLUFrxcATarX3gn1Oji+LMr4i9JMu3ebB/Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382674; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=xQJGeLj4iFJjpO6RKthrDxmRwXsCtxo7g0ETmSCtxA0=; b=4k7MUWxN6rYBm+dpnOLbQrrIql0d0ugrURrdij0Xz9nw7+XPTG+beClqPIGjkOJRI1vq blKY73xGhSd+bgiuG2fojGKjWUVzMkfRrrwdOrDo51nJPM0cjZcwkz9KVIKNXvC9Nd2em tcwyJ2TU6ZtqARROFKzzQPkfg6UazycZyIuJU0Z84rgBE9vHml+VY8GWCPsPh4wBsz6+I SAd/ICtgmSD71Nb1F68cZR+08/Kp084zoj6sGj5+RBrX2s0trpC5w8aShyxHYf+DKxMpW YLYVwMySUOjyzDSgfAgP//C8A0TxdbsYiPF8Qm85U7hvV5QXjkR+w1QlHsZJbG95PZg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=VqJDM5xF; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E640E606A336; Fri, 4 Dec 2026 11:11:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=VqJDM5xF Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E17A1F000C2; Fri, 4 Dec 2026 11:11:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382673; bh=xQJGeLj4iFJjpO6RKthrDxmRwXsCtxo7g0ETmSCtxA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=VqJDM5xFqC9wlcHsnHBoJvlI5aDu0l/oAzcihZJMkqdp1t5L+375gDiPmQe3NNR1X iAD92+WonkZN/hgQhKEOCNJC3Ss7l8DyNjgHoR10PXjx5pxVdMPRvrMr1Qmurtg4A6 m7eZ3hhR0deF5/GCnU8Ur7BaIdJUkdj5yymt8Fps= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Christian Schmidbauer , Maxime Chevallier , Paolo Abeni Subject: [PATCH 6.18 556/703] net: stmmac: dwmac1000: dont discard frames with only a checksum error Date: Fri, 4 Dec 2026 19:07:35 +0900 Message-ID: <20261204100642.570612622@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christian Schmidbauer commit 596c9408682feba536d7f39de97959807eb3ba1c upstream. On dwmac1000 with enhanced descriptors, the hardware sets the Error Summary (ES) bit of the Rx descriptor not only for L2 errors but also for an L3/L4 checksum error. enh_desc_get_rx_status() returns discard_frame whenever ES is set, and since commit 1b746ce8b397 ("net: stmmac: don't overwrite discard_frame status") the checksum status is only evaluated for good frames. Return discard_frame only when ES comes with one of the L2 error bits. A frame with only a checksum error is then reported as csum_none and reaches the stack as CHECKSUM_NONE, so the stack verifies the checksum itself. This matches dwmac4, whose Error Summary bit does not cover checksum errors. RDES0 bit 7 is not in the mask, because depending on the core and on Rx checksum offload it reports a timestamp, an IP header checksum error or a giant frame, and enh_desc_get_rx_status() cannot tell which. In threshold Rx mode, a giant frame that fits one buffer therefore reaches the stack with a verified FCS. Also remove the pr_err that enh_desc_get_rx_status() prints when bit 7 is set. Once the MAC stops dropping checksum-error frames, any host on the link can flood the kernel log by sending frames with a bad IPv4 header checksum. This prepares for setting DMA_CONTROL_DT, which makes the MAC deliver checksum-error frames instead of dropping them in its Rx FIFO. Fixes: 1b746ce8b397 ("net: stmmac: don't overwrite discard_frame status") Cc: # 6.6.x: ee0aace5f844: net: stmmac: Correctly handle Rx checksum offload errors Cc: # 6.6.x Signed-off-by: Christian Schmidbauer Reviewed-by: Maxime Chevallier Tested-by: Maxime Chevallier Link: https://patch.msgid.link/20261114133640.3285413-3-opensource@grische.xyz Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/enh_desc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c +++ b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c @@ -221,9 +221,6 @@ static int enh_desc_get_rx_status(struct if (unlikely(rdes0 & RDES0_OVERFLOW_ERROR)) x->rx_gmac_overflow++; - if (unlikely(rdes0 & RDES0_IPC_CSUM_ERROR)) - pr_err("\tIPC Csum Error/Giant frame\n"); - if (unlikely(rdes0 & RDES0_COLLISION)) x->rx_collision++; if (unlikely(rdes0 & RDES0_RECEIVE_WATCHDOG)) @@ -235,7 +232,10 @@ static int enh_desc_get_rx_status(struct if (unlikely(rdes0 & RDES0_CRC_ERROR)) { x->rx_crc_errors++; } - ret = discard_frame; + if (rdes0 & (RDES0_DESCRIPTOR_ERROR | RDES0_OVERFLOW_ERROR | + RDES0_COLLISION | RDES0_RECEIVE_WATCHDOG | + RDES0_MII_ERROR | RDES0_CRC_ERROR)) + ret = discard_frame; } /* After a payload csum error, the ES bit is set.