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=1796438371; b=hgcQeBp+7G0Uw2M5jXdMUIyusgDHHoCpS5eG6wFJJchuuovuTiDOiJQ9IgJzVBamKbhE 23V0DLQIOxVp6B/GuTzfMBR64pbb9bSgIUZ5GXfd/4YMXYRwAbo/+T7zXS7+BT/l0J1mH oBpxFwnh6K/yx3zBFHpe2EpOGZF6APyf5ehljbqLoPDO2g8CtWsyyXK4GRQDmBeotXVkQ 17PuzbitJ1YtAzjyRBehURItzYjmaesLyvYa7OAkBQR4q4ba+gUu7ODlyQBd7/rczU+Ii LfPiemx9hL4sNZq+rkpnW/TLu8YEim5ett0ZIPEiy4iI8qNBxKpG6mzaOwP2wdGpd5w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796438371; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=+sfFagT/JxRfxxalcXDmxa1zFtes2aga8YVZaCc0OpA=; b=daany7/muUljCCMz1kzcjiSEACRIvtfTrqHj9S4umj1vp8RdWtRzXd9J+IBXOs4UA6zC 6JIIKio4QhxtglAkyNlw+lKVsdNjGxllsF7BveYuZ4449gNW8N2orR6vcQVlFZbBvCpfM CIfGWiDuo3wfHXUonGP9ZDxWHkDeW7PxumQSBOQEiyI1gdyFh/lf54vomm+K/5vsKF45C n2qUySLbc17/2EEMz5nLBgU1deVTX/lXo0grzvv84lBOgJFz04oF2yLtHdmQsCLNX6klL 9N+nGrFBzTTCQKUaVbluXpy2cer3XUttj1VN2KKjdof1yZETTpISRFW0JzH491gK3yQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=M3Jb6RN7; 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 77B92606A322 for ; Sat, 5 Dec 2026 02:39:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=M3Jb6RN7 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15BD31F0092B; Sat, 5 Dec 2026 02:39:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796438371; bh=+sfFagT/JxRfxxalcXDmxa1zFtes2aga8YVZaCc0OpA=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=M3Jb6RN7s9bDC2uKa6qAs1tW3/Tqi7DGjnMd7OP2Y2zx47AKqq7fK+L6IphiuSN9W ByNigNavreK94YyR+0iruU2Jmdp1pnwp1NaTj8G07/DO4R4/SKey7cNY3pQaekFFdc MpQ2zXRGeLO6LemWJHmYKa9xz+RyIBmVKbh+R6woCKT3l/FwVUqtPujSvJ74jt1D5A CSMYLtsElPT/XZ7chUl/QiQsLgiWQYzXCnr7wrMIk+ntW75wWGk49Y/tU/B7yeJYaR qgCs3sfV/r2bQxWihaEkT1g6QdE2/byYOAl3olC2w1pDHpfD6Ml4QQSdiHJRtOZSLD P2EuQ/umMQWkg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH net-next v4 1/5] net: stmmac: dwmac-sun8i: deliver RX checksum errors to the stack Reply-To: sashiko-reviews@lists.linux.dev To: "James Hilliard" Cc: linux-sunxi@lists.linux.dev In-Reply-To: <20261203-submit-sun8i-rxall-v1-v4-1-af22aec6ae13@gmail.com> References: <20261203-submit-sun8i-rxall-v1-v4-0-af22aec6ae13@gmail.com> <20261203-submit-sun8i-rxall-v1-v4-1-af22aec6ae13@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 02:39:30 +0000 X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] net: stmmac: sun8i_dwmac_rx_status() counts sub-18-byte runts as rx_desc -- commit 705eeeb953f28a50b2a34c3b376c2df9f061f595 Author: James Hilliard net: stmmac: dwmac-sun8i: deliver RX checksum errors to the stack This commit enables error-frame forwarding on sun8i MACs and adds a sun8i-specific RX descriptor status decoder so frames with IP or transport checksum errors are delivered to the stack with CHECKSUM_NONE instead of being dropped in hardware. > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/= net/ethernet/stmicro/stmmac/dwmac-sun8i.c > index 613199da57c1b..a7e4fca50141f 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c [ ... ] > @@ -1081,6 +1078,83 @@ static const struct stmmac_ops sun8i_dwmac_ops =3D= { [ ... ] > +static int sun8i_dwmac_rx_status(struct stmmac_extra_stats *x, struct dm= a_desc *p) > +{ > + const u32 csum_mask =3D RDES0_IPC_CSUM_ERROR | RDES0_PAYLOAD_CSUM_ERR; > + const u32 dma_errors =3D RDES0_DESCRIPTOR_ERROR | RDES0_OVERFLOW_ERROR; > + const u32 wire_errors =3D RDES0_CRC_ERROR | RDES0_MII_ERROR | > + RDES0_RECEIVE_WATCHDOG | RDES0_COLLISION | > + RDES0_LENGTH_ERROR; > + u32 status =3D le32_to_cpu(READ_ONCE(p->des0)); > + u32 len =3D FIELD_GET(RDES0_FRAME_LEN_MASK, status); > + bool runt =3D len < ETH_ZLEN + ETH_FCS_LEN; [ ... ] > + /* One buffer per chain descriptor; the reported length includes FCS. */ > + if (unlikely(len < ETH_HLEN + ETH_FCS_LEN || > + len > FIELD_GET(RDES1_BUFFER1_SIZE_MASK, le32_to_cpu(p->des1)))) { > + x->rx_desc++; > + return discard_frame; > + } > + if (unlikely(runt || (status & wire_errors))) { > + if (runt && !(status & RDES0_LENGTH_ERROR)) > + x->rx_length++; > + return discard_frame; > + } [Severity: Low] Does combining len < ETH_HLEN + ETH_FCS_LEN with the buffer-size check miscount short frames in x->rx_desc? When EMAC_RX_ERR_FRM forwards a sub-18-byte collision or CRC error fragment with RDES0_DESCRIPTOR_ERROR clear, this branch increments x->rx_desc even though no DMA descriptor error occurred. The early return also skips the runt check below, so sub-18-byte runts without RDES0_LENGTH_ERROR are omitt= ed from x->rx_length (exported as rx_length_errors by stmmac_get_stats64()). Splitting the len < ETH_HLEN + ETH_FCS_LEN check from the buffer-size check would let those frames increment x->rx_length (when RDES0_LENGTH_ERROR is clear) instead of x->rx_desc. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203-submit-sun= 8i-rxall-v1-v4-0-af22aec6ae13@gmail.com?part=3D1