From: netdev-bot+sashiko@kernel.org
To: florian.fainelli@broadcom.com
Cc: netdev@vger.kernel.org, cursoragent@cursor.com,
opendmb@gmail.com, bcm-kernel-feedback-list@broadcom.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, zakkemble@gmail.com,
horms@kernel.org, ryotkkr98@gmail.com,
linux-kernel@vger.kernel.org, nb@tipi-net.de
Subject: Re: [PATCH net 8/8] net: bcmgenet: mask DMA_TIMEOUT_MASK when reading DMA_RING0_TIMEOUT
Date: Tue, 22 Sep 2026 00:58:54 +0000 [thread overview]
Message-ID: <179003873467.2160803.416450150516822587@kernel.org> (raw)
In-Reply-To: <20260918000732.276506-9-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] Submission metadata is not upstream-acceptable: the commit has no
Signed-off-by line (mandatory DCO certification per…
Pre-existing issues:
- [Medium] This problem wasn't introduced by this patch, but the patched
conversion line makes it visible: bcmgenet_get_coalesce() can report…
--
net: bcmgenet: mask DMA_TIMEOUT_MASK when reading DMA_RING0_TIMEOUT
This patch makes bcmgenet_get_coalesce() mask the DMA_RING0_TIMEOUT
register read with DMA_TIMEOUT_MASK before converting the tick count
into microseconds, so bits outside the 16-bit timeout field no longer
affect the rx_coalesce_usecs value reported to userspace.
Two observations below, one on the commit trailers and one on the
get/set round trip through this conversion.
[Severity: Low]
Looking at the trailers in the commit message:
Fixes: 4a29645bfe6c ("net: bcmgenet: Implement RX coalescing control knobs")
Assisted-by: LLM
Co-authored-by: Cursor <cursoragent@cursor.com>
Change-Id: I4c5b5019e764dbd0c7e51bd8c7365939a4736e44
There is no Signed-off-by line, which
Documentation/process/submitting-patches.rst requires for the DCO
certification.
Should the Gerrit "Change-Id:" trailer and the
"Co-authored-by: Cursor <cursoragent@cursor.com>" trailer be dropped as
well, given a tool account cannot certify the DCO?
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> index 3a6a2f0759598..b15e64a484b43 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> @@ -852,7 +852,8 @@ static int bcmgenet_get_coalesce(struct net_device *dev,
> ec->rx_max_coalesced_frames =
> bcmgenet_rdma_ring_readl(priv, 0, DMA_MBUF_DONE_THRESH);
> ec->rx_coalesce_usecs =
> - bcmgenet_rdma_readl(priv, DMA_RING0_TIMEOUT) * 8192 / 1000;
> + (bcmgenet_rdma_readl(priv, DMA_RING0_TIMEOUT) &
> + DMA_TIMEOUT_MASK) * 8192 / 1000;
[Severity: Medium]
This isn't a bug introduced by this patch, but since the conversion on
this line is being touched: can the value reported here be rejected by
bcmgenet_set_coalesce()?
bcmgenet_set_coalesce() accepts up to (DMA_TIMEOUT_MASK * 8) + 1, i.e.
524281 us:
if (ec->tx_max_coalesced_frames > DMA_INTR_THRESHOLD_MASK ||
ec->tx_max_coalesced_frames == 0 ||
ec->rx_max_coalesced_frames > DMA_INTR_THRESHOLD_MASK ||
ec->rx_coalesce_usecs > (DMA_TIMEOUT_MASK * 8) + 1)
return -EINVAL;
bcmgenet_set_rx_coalesce() then rounds that up:
reg |= DIV_ROUND_UP(usecs * 1000, 8192);
8192 * 63999 = 524279808, which is below 524281000, so 524281 us is
programmed as 64000 ticks.
Reading it back through the patched conversion gives
64000 * 8192 / 1000 = 524288, which is larger than the 524281 the
setter accepts.
Since the ethtool utility does ETHTOOL_GCOALESCE, modifies one field and
then issues ETHTOOL_SCOALESCE with the full structure, after
"ethtool -C eth0 rx-usecs 524281" a later "ethtool -C eth0 rx-frames N"
would return -EINVAL until rx-usecs is lowered.
Would it make sense to derive the range check in
bcmgenet_set_coalesce() from the same tick conversion and rounding used
by bcmgenet_set_rx_coalesce() and this getter, so the round trip is
consistent?
>
> for (i = 0; i <= priv->hw_params->rx_queues; i++) {
> ring = &priv->rx_rings[i];
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260918000732.276506-1-florian.fainelli%40broadcom.com
next prev parent reply other threads:[~2026-09-22 0:58 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 0:07 [PATCH net 0/8] net: bcmgenet: Collection of bug fixes Florian Fainelli
2026-09-18 0:07 ` [PATCH net 1/8] net: bcmgenet: fix 64-bit RTNL stats reading in ethtool on 32-bit systems Florian Fainelli
2026-09-18 10:13 ` Nicolai Buchwitz
2026-09-22 0:58 ` netdev-bot+sashiko
2026-09-18 0:07 ` [PATCH net 2/8] net: bcmgenet: initialize u64 stats seq counter for all queues Florian Fainelli
2026-09-18 10:13 ` Nicolai Buchwitz
2026-09-22 0:58 ` netdev-bot+sashiko
2026-09-18 0:07 ` [PATCH net 3/8] net: bcmgenet: do not skip WoL power up on GENET V1 Florian Fainelli
2026-09-18 10:16 ` Nicolai Buchwitz
2026-09-22 0:58 ` netdev-bot+sashiko
2026-09-18 0:07 ` [PATCH net 4/8] net: bcmgenet: clean up RX NAPI on bcmgenet_init_rx_queues failure Florian Fainelli
2026-09-18 10:43 ` Nicolai Buchwitz
2026-09-18 17:39 ` Florian Fainelli
2026-09-22 0:58 ` netdev-bot+sashiko
2026-09-18 0:07 ` [PATCH net 5/8] net: bcmgenet: acquire ring lock with BH disabled in bcmgenet_dump_tx_queue Florian Fainelli
2026-09-18 10:57 ` Nicolai Buchwitz
2026-09-18 17:40 ` Florian Fainelli
2026-09-22 0:58 ` netdev-bot+sashiko
2026-09-18 0:07 ` [PATCH net 6/8] net: bcmgenet: validate Ethernet address in bcmgenet_set_mac_addr Florian Fainelli
2026-09-18 11:00 ` Nicolai Buchwitz
2026-09-22 0:58 ` netdev-bot+sashiko
2026-09-18 0:07 ` [PATCH net 7/8] net: bcmgenet: zero-initialize Transmit Status Block in bcmgenet_add_tsb Florian Fainelli
2026-09-18 11:03 ` Nicolai Buchwitz
2026-09-18 17:41 ` Florian Fainelli
2026-09-22 0:58 ` netdev-bot+sashiko
2026-09-18 0:07 ` [PATCH net 8/8] net: bcmgenet: mask DMA_TIMEOUT_MASK when reading DMA_RING0_TIMEOUT Florian Fainelli
2026-09-18 10:13 ` Nicolai Buchwitz
2026-09-22 0:58 ` netdev-bot+sashiko [this message]
2026-09-18 0:12 ` [PATCH net 0/8] net: bcmgenet: Collection of bug fixes Florian Fainelli
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=179003873467.2160803.416450150516822587@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=cursoragent@cursor.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=florian.fainelli@broadcom.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nb@tipi-net.de \
--cc=netdev@vger.kernel.org \
--cc=opendmb@gmail.com \
--cc=pabeni@redhat.com \
--cc=ryotkkr98@gmail.com \
--cc=zakkemble@gmail.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
all inboxes | Powered by JetHome®