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=1796513444; b=hfI1gQqh7JbmSGpF5J3r2fEzam96tJxBjsiZ6pTL+rrfSl9pBZ5D9VaGB8pmcerDx10k H6saBS173kWIrH4iybkI0+c28GpF620vAUrGb33cwe39I9tGVTcnKvGEd9rLgioyEdT2Q twD7RRThmD1tSVBTblTdjcqX/QiZeyk3j1+UJnPz/NqB2ydezoBBrw3+53GpTvOdIOgsm Qcar1oRddTXS8YJeBq9gbh9ft0NwRqH1tkxFiPfESuyI71uEswQv0lgyXrVIT0D+Rd1/q 59LbKNhmBWP+XqY/Nsrnx0Md69ktHgemwUZ9nBn+bUe+qyPyvaYZnKytcIAT45KmTkw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796513444; 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=oSDWWTRoWhvW8And9pSwzs8X2+EczAG7TWeDn5Vb6YU=; b=ENgplqFgopqwIi2aciJ/PzM98alyEyE4Tz0Rs54A50YL0hObDnjxUFiYPbI+2jQ0D9yI 6kn2hw1MXa/yNOkiEgcdbRckV63XImWylBXlAz/NhZJneV5UiGdM1AGtAHdwHCfCIsYdm +MMknYR7oGQ0y7MpvQtbkoB4Kd87GtFZn3gB2xvrapzpxZwb5xYn5LSAlhgT90uQoCg+3 nNfx5lJczgITqaQRVcYTEquadDN1ZWvcAfVqghWtiIv6VIm9h+1388uap5EaNLXiWVeix Fu9GrgbXCZ976sJC6nDQWCG1S6OrHd8kmgngkJTq5m2IklaJfIQES635wa2yDMGQO6A== 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=bECTnVXm; 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 49F3B606A31F for ; Sat, 5 Dec 2026 23:30:44 +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=bECTnVXm Received: by smtp.kernel.org (Postfix) with ESMTPSA id 824BB1F0092B; Sat, 5 Dec 2026 23:30:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796513444; bh=oSDWWTRoWhvW8And9pSwzs8X2+EczAG7TWeDn5Vb6YU=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=bECTnVXmafqXwioi7suYCnEpTPbAr6F5GM1S2nGCIyDTdQTnhyLHfE6TreX/p+uKA 7xX6HtOTJQI5GbzLHnRii/0b2s0EeRdo6+dbIHJ61E7otJlE+glq4yqFEDEKuGjw9U YYr9DUq1yqAMvq1xpnEHMzXf0Q8E3ckT8PbJ9VapNpunIb9HEThsjpgswyXZI5JBcG 4VPCkrBp4PjJILR9s/Rd7p8TQeucIqtk7IeXITsBfpLIPH1kW8/IHSI81F9oFvknU6 Zm9tIu5ixWxofUSbthxwtWjWVchfWY3Rg2ztOe8NRM3IMc+xbXVGkCEqcl2WpxdVqw lozmLWnflqm0g== Subject: Re: [PATCH net-next 1/2] net: bcmgenet: keep FCS forwarding when exiting Wake-on-LAN From: netdev-bot+sashiko@kernel.org To: florian.fainelli@broadcom.com Cc: netdev@vger.kernel.org, opendmb@gmail.com, nb@tipi-net.de, bcm-kernel-feedback-list@broadcom.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com Date: Sat, 05 Dec 2026 23:30:43 +0000 Message-ID: <179651344306.3148.4944015682516225848@kernel.org> In-Reply-To: <20261204230048.3554713-2-florian.fainelli@broadcom.com> References: <20261204230048.3554713-2-florian.fainelli@broadcom.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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] Not a bug in the final state of the series; kept only because requires_validation=true. - [Low] Not a bug in the final state of the series; kept only because requires_validation=true. -- net: bcmgenet: keep FCS forwarding when exiting Wake-on-LAN Before this change, bcmgenet_wol_power_up_cfg() always cleared priv->crc_fwd_en. It now sets it from NETIF_F_RXFCS in dev->features and clears CMD_CRC_FWD in UMAC_CMD only when the FCS is not wanted. This prepares for a later change that adds NETIF_F_RXFCS support. > diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c > index 984432952963a..ff34c4df4f4ab 100644 > --- a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c > +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c > @@ -223,7 +223,8 @@ int bcmgenet_wol_power_up_cfg(struct bcmgenet_priv *priv, > } > > clk_disable_unprepare(priv->clk_wol); > - priv->crc_fwd_en = 0; > + /* Keep forwarding the FCS if the user asked for it */ > + priv->crc_fwd_en = !!(dev->features & NETIF_F_RXFCS); [Severity: Low] In bcmgenet_wol_power_up_cfg(), this assignment runs before the two "already reset" early returns: reg = bcmgenet_umac_readl(priv, UMAC_MPD_CTRL); if (!(reg & MPD_EN)) return -EPERM; /* already reset so skip the rest */ ... reg = bcmgenet_hfb_reg_readl(priv, HFB_CTRL); if (!(reg & RBUF_ACPI_EN)) return -EPERM; /* already reset so skip the rest */ If either return is taken, bcmgenet_resume_noirq() falls through to bcmgenet_umac_reset(). bcmgenet_resume() then takes the "MAC was reset" path and calls init_umac(). In init_umac(), reset_umac() clears CMD_CRC_FWD. RBUF_SKIP_FCS, though, is set from crc_fwd_en: if (priv->crc_fwd_en) reg |= RBUF_SKIP_FCS; else reg &= ~RBUF_SKIP_FCS; Once RXFCS can be turned on, could RBUF_SKIP_FCS end up set while CMD_CRC_FWD is clear? At this commit, crc_fwd_en is always 0 on this path, because NETIF_F_RXFCS is not in hw_features. The follow-up patch "net: bcmgenet: add support for NETIF_F_RXFCS" covers this. bcmgenet_resume() calls bcmgenet_set_features(dev, dev->features) after init_umac() and before bcmgenet_netif_start() enables RX. After that patch, this call writes CMD_CRC_FWD, crc_fwd_en and RBUF_SKIP_FCS together. So by the end of the series, received frames should never see the mismatch. [ ... ] > @@ -248,10 +249,11 @@ int bcmgenet_wol_power_up_cfg(struct bcmgenet_priv *priv, > reg &= ~RBUF_ACPI_EN; > bcmgenet_hfb_reg_writel(priv, reg, HFB_CTRL); > > - /* Disable CRC Forward */ > + /* Disable CRC Forward unless NETIF_F_RXFCS needs it */ > spin_lock_bh(&priv->reg_lock); > reg = bcmgenet_umac_readl(priv, UMAC_CMD); > - reg &= ~CMD_CRC_FWD; > + if (!priv->crc_fwd_en) > + reg &= ~CMD_CRC_FWD; > bcmgenet_umac_writel(priv, reg, UMAC_CMD); [Severity: Low] With this change, priv->crc_fwd_en is set from two different sources. bcmgenet_wol_power_up_cfg() sets it from the user's NETIF_F_RXFCS setting. bcmgenet_set_features() still reads it back from the hardware and never writes CMD_CRC_FWD: /* Make sure we reflect the value of CRC_CMD_FWD */ reg = bcmgenet_umac_readl(priv, UMAC_CMD); priv->crc_fwd_en = !!(reg & CMD_CRC_FWD); bcmgenet_desc_rx() also strips the FCS whenever crc_fwd_en is set: if (priv->crc_fwd_en) { skb_trim(skb, skb->len - ETH_FCS_LEN); } Looking at this commit alone, wouldn't bcmgenet_desc_rx() trim the FCS that the new comment says the user asked to keep? As the commit message says, this has no runtime effect at this commit. NETIF_F_RXFCS is not in hw_features, so the expression always evaluates to 0. The follow-up patch "net: bcmgenet: add support for NETIF_F_RXFCS" resolves this by the end of the series. It makes bcmgenet_set_features() program CMD_CRC_FWD from NETIF_F_RXFCS. It also changes bcmgenet_desc_rx() to trim only when crc_fwd_en is set and NETIF_F_RXFCS is not. [ ... ] -- Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204230048.3554713-1-florian.fainelli%40broadcom.com