Article View: linux.kernel.netdev
Article #21923Re: [PATCH net-next 2/2] net: stmmac: dwmac-sun8i: support ethtool rx-all
From: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 15:47
Date: Tue, 24 Nov 2026 15:47
84 lines
11497 bytes
11497 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The patch adds a `set_rx_all` member to `struct stmmac_ops`
(drivers/net/ethernet/stmicro/stmmac/hwif.h:322) but noโฆ
--
net: stmmac: dwmac-sun8i: support ethtool rx-all
This adds opt-in NETIF_F_RXALL support for dwmac-sun8i. With it, complete
frames with a reported wire error, and runts the MAC can forward, are
delivered to the stack and are not counted in the good packet and byte
totals. A new set_rx_all op in struct stmmac_ops updates the runt
forwarding bit in RX_CTL1, and a new spinlock serializes those updates
against the DMA start/stop bits.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ethernet/stmicro/stmmac/hwif.h
> index 047d809b8b889..2cfadc6861047 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/hwif.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h
> @@ -319,6 +319,7 @@ struct stmmac_ops {
> void (*set_mac)(void __iomem *ioaddr, bool enable);
> /* Enable and verify that the IPC module is supported */
> int (*rx_ipc)(struct mac_device_info *hw);
> + void (*set_rx_all)(struct stmmac_priv *priv, bool enable);
> /* Enable RX Queues */
> void (*rx_queue_enable)(struct mac_device_info *hw, u8 mode, u32 queue);
> /* RX Queues Priority */
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 2f33fc0126b11..0a893c2cea78b 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
[ ... ]
> @@ -6453,6 +6466,11 @@ static int stmmac_set_features(struct net_device *netdev,
> {
> struct stmmac_priv *priv = netdev_priv(netdev);
>
> + if (((netdev->features ^ features) & NETIF_F_RXALL) &&
> + netif_running(netdev) && netif_device_present(netdev) &&
> + priv->hw->mac->set_rx_all)
> + priv->hw->mac->set_rx_all(priv, features & NETIF_F_RXALL);
> +
[Severity: Low]
This isn't a bug, but should the new op get a stmmac_set_rx_all() wrapper
in hwif.h like the other struct stmmac_ops members have?
Every other MAC op in that table goes through stmmac_do_callback() or
stmmac_do_void_callback(), which checks both hw->mac and the op pointer
for NULL:
drivers/net/ethernet/stmicro/stmmac/hwif.h:
#define stmmac_core_init(__priv, __args...) \
stmmac_do_void_callback(__priv, mac, core_init, __args)
...
#define stmmac_rx_ipc(__priv, __args...) \
stmmac_do_callback(__priv, mac, rx_ipc, __args)
Here stmmac_set_features() calls priv->hw->mac->set_rx_all() directly
and does its own NULL check. A few lines below, the same function calls
stmmac_rx_ipc() through the wrapper.
__stmmac_dvr_probe() also reads priv->hw->mac->set_rx_all directly to
decide whether to advertise NETIF_F_RXALL.
Both sites check for NULL today, so nothing breaks now. Only
sun8i_dwmac_ops sets this op, though. If a later caller copies the
direct call without the NULL check, could it oops on every other MAC?
> /* Keep the COE Type in case of csum is supporting */
> if (features & NETIF_F_RXCSUM)
> priv->hw->rx_csum = priv->plat->rx_coe;
[ ... ]
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261120-submit-sun8i-rx-features-v1-v1-0-5058fecba6b3%40gmail.com
Technical Details
Message-ID:
<179553523359.3135.5161173895419384474@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370534-linux-kernel-netdev=dewy.ruReferences:
<20261120-submit-sun8i-rx-features-v1-v1-2-5058fecba6b3@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370534-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 2/2] net: stmmac: dwmac-sun8i: support ethtool rx-all Date: Tue, 24 Nov 2026 15:47:13 +0000 Organization: Usenet Network Message-ID: <179553523359.3135.5161173895419384474@kernel.org> References: <20261120-submit-sun8i-rx-features-v1-v1-2-5058fecba6b3@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="4172774"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:8Uw7+2WR+l0zFWBL3/ngzjttCys= sha256:GOUJoI8pvmkiytEKFUwwyuamxzLK6AX6d21EZ9opuu4= sha1:NYzs1uGb7//80j5Os+uR7nen+UI= sha256:KBZ2aEAytyE19Sg377BVt8cGDsW1H6XA1SX6XU3dQXg= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id B3F14125E1D; Tue, 24 Nov 2026 18:47:31 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PAoV4mv5IzNF; Tue, 24 Nov 2026 18:47:27 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-370534-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 6015D125E1E; Tue, 24 Nov 2026 18:47:18 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 27CFF2A423; Tue, 24 Nov 2026 15:47:17 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795535236; b=j4lU/yc/cqEztnZ8YC9HAicuCThoP6/Dw6itlf8Ie9NGUSEyxbt/2poS2NQbLPaFuPGJ uxeofdO0ZzGNfeKZId+PVDrf3InG/Oz2l4BLyHc+Cl06sfM/BNd+P43vwEJzjkOuKrFLF ANNHPhG066M7+Mfp4MHxVIHJaUaFfowittGXjKtaK0O67xSn3QXC+JTlw4zblXDEhcuVv d0jpW5FErGoFqkj7tu6Qk/HDG3ZaiUtNzkns8A96hV/AnDNvOW9FpvxacMaNypaksN4O4 jwqZjgPyq/tKq7OJZBj/KAjm1nHPGdLLx7csJzLNyaYQc+t+cofVvpar7IKhMG196Aw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795535236; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=mnw6E1h7bjfHhFgcDHd+fVMgItD42/KW+vwcJIrj1Cs=; b=bWKPRoSrZtfGSwzgfIsUKMD0nANcq8pgWiFx1AGfXBZfgidApOVNvxMnELWY/HTH5lDF LP2hjUFs2h/w668MBx0egh4XXKFauP8sGR5+7ssJqCzvWzXCc3LJVvjxX64ZSpTLjsxkt FkbmIM+thz3nR/ig6mLCnj0wHpmhzPzm6pHVLozeBI5Tdw8zFWyfXBPuUYlQC42FjmxZw yGe5NcZO9wSHNXYUsbzZoucu5g2a7gP80/takcMJH5yFH+gP2GlVsTpddmnzFOuosgpWI qquUKhvMtyyqOs7EAWqiNQ9afCmrAy7CEXTNNSXN7KM/5HPEUiYdI33CDEggVeV+4cw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VWwl+S8x; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 41F12606A327; Tue, 24 Nov 2026 15:47:16 +0000 (UTC) X-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=VWwl+S8x X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795535235; b=cv4Cf2MspfEzfJ77Um0Gt5p7JwZjO4UIyHRMu6KhLHvj/4Yx3yrkVMpoPCP3kvCV+m/L mV8Z5gq4wpYGIJBbZMFEdrV3f3Om91RpP6o1Xxmy+MPTtcAzWTerJm2FVGBPdW3Mc8K0n zNnB528HhHr/kQloMSpsQYTy4cZJnGQ33zFXFtodEgQMpHASs8R1w7tA+eP8VjoEcgOos Z69OeRMf5q6k3hyr7b1Y5EnGagU1toFbcUH0OD1Z9+lrFp7UgR4c2J9lklAa4ds8B3Ecz 0bnC14P5d4YEbNq8bEx8j1sHDklycNH2LWc0jPj/iihBSd8v7WUImR1WMLqflGyeTIQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795535235; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=mnw6E1h7bjfHhFgcDHd+fVMgItD42/KW+vwcJIrj1Cs=; b=2ylh3EM5NUDARZwuBhMPVF4wfE4EUyy67oEBtRgZDldQN7XTYx1M0HDKawZ7+poHxCD6 hiRJ3DgqpWGNv+US0HCTcjj/NFrR6omNjGS3iXZewBXos9wOvR35QlfQ0eFxAvrQhgkO1 3RUVgxe9Z4BO1boN28FhG/Zn4JDDQPXzibJysnCniYxhxNau2/Iv0Q0dM0HwbRMy2Iz87 ZY27hU5W9swiW31aLHQ8PO2bAogwj/C5IvtkxXQqcDrx1A5HOaA4cNNXN7CTg3q0SAG5S /9JnvPb4mbfPQ2ophGTA0bJ5F98l3Q6JOJ8Fk9fGIF0ubW7StOKQlPM/eRyJHG49+zA== X-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=VWwl+S8x; arc=none smtp.remote-ip=100.103.45.18 X-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 634C1606A33D; Tue, 24 Nov 2026 15:47:15 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04D121F000C0; Tue, 24 Nov 2026 15:47:13 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795535234; bh=mnw6E1h7bjfHhFgcDHd+fVMgItD42/KW+vwcJIrj1Cs=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=VWwl+S8xDi+iSPm5J3H3Y2yII0plP3fQQHf4974Vo5SIvkxXxysZJoHbrcEW65xuA qQc69KmjxB/6YUCFSTUeXTiJSp2FUKd+POPfrBpSy+u/WhcZM8rl2gROZUAUKFdWak eFVWuL4qBHQ7hgjI437RDB65un0cSDswsEqM59HAAtj2Yqu4CfJ0rLvLaciTCkwmtc 4EyBdZqLYf07592ekZKOcqirdHwGypFCymgTlmZrUy7EC0lXVlZn5DihWla8hujsUK st08k68Op6Gm/OtFEhXGaUygAi4Svc8AaJixgEv626Ko25b5rKDNOR87+4JOPionKJ gg3VwJhUlZsNw== X-Cc: netdev@vger.kernel.org, maxime.chevallier@bootlin.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, boon.leong.ong@intel.com, wens@kernel.org, jernej.skrabec@gmail.com, samuel@sholland.org, clabbe.montjoie@gmail.com, kuba@kernel.org, o.rempel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev X-In-Reply-To: <20261120-submit-sun8i-rx-features-v1-v1-2-5058fecba6b3@gmail.com> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list