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
Subject: Re: [PATCH net-next 1/2] net: bcmgenet: keep FCS forwarding when exiting Wake-on-LAN
Date: Sat, 05 Dec 2026 23:30:43 +0000 [thread overview]
Message-ID: <179651344306.3148.4944015682516225848@kernel.org> (raw)
In-Reply-To: <20261204230048.3554713-2-florian.fainelli@broadcom.com>
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
next prev parent reply other threads:[~2026-12-05 23:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 23:00 [PATCH net-next 0/2] net: bcmgenet: Support for NETIF_F_RXFCS Florian Fainelli
2026-12-04 23:00 ` [PATCH net-next 1/2] net: bcmgenet: keep FCS forwarding when exiting Wake-on-LAN Florian Fainelli
2026-12-05 12:16 ` Nicolai Buchwitz
2026-12-05 23:30 ` netdev-bot+sashiko [this message]
2026-12-04 23:00 ` [PATCH net-next 2/2] net: bcmgenet: add support for NETIF_F_RXFCS Florian Fainelli
2026-12-05 12:23 ` Nicolai Buchwitz
2026-12-05 23:30 ` netdev-bot+sashiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179651344306.3148.4944015682516225848@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=florian.fainelli@broadcom.com \
--cc=kuba@kernel.org \
--cc=nb@tipi-net.de \
--cc=netdev@vger.kernel.org \
--cc=opendmb@gmail.com \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox