From: netdev-bot+sashiko@kernel.org
To: nb@tipi-net.de
Cc: opendmb@gmail.com, florian.fainelli@broadcom.com,
bcm-kernel-feedback-list@broadcom.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, f.fainelli@gmail.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, pierremarinleclercq88@gmail.com,
dave.stevenson@raspberrypi.com, justin.chen@broadcom.com
Subject: Re: [PATCH net-next v7 5/9] net: bcmgenet: derive the receive buffer length from the MTU
Date: Sun, 15 Nov 2026 13:01:50 +0000 [thread overview]
Message-ID: <179474771091.2199510.12424783948813016163@kernel.org> (raw)
In-Reply-To: <20261112-nb-genet-mtu-nn-v2-v7-5-43a5d90b3256@tipi-net.de>
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] In bcmgenet_init_tx_ring()
(drivers/net/ethernet/broadcom/genet/bcmgenet.c), the buffer-size…
--
net: bcmgenet: derive the receive buffer length from the MTU
This patch replaces the fixed 2048 byte receive buffer length with a value
taken from the MTU. The RBUF packet ready threshold is computed from the
MTU and programmed into RBUF, and the buffer length is that threshold
plus the status block. UMAC_MAX_FRAME_LEN and the TX flow period are
also derived from the MTU, with a floor at ETH_DATA_LEN.
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> index b0b0d9b423482..1bb5fed4a8b4d 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
[ ... ]
> +/* A buffer has to hold everything the threshold lets the hardware deliver */
> +static unsigned int bcmgenet_rx_buf_len(unsigned int mtu)
> +{
> + return sizeof(struct status_64) +
> + bcmgenet_pkt_rdy_thld(mtu) * ENET_THLD_UNIT;
> +}
[ ... ]
> @@ -2792,7 +2845,7 @@ static void bcmgenet_init_tx_ring(struct bcmgenet_priv *priv,
> TDMA_FLOW_PERIOD);
> bcmgenet_tdma_ring_writel(priv, index,
> ((size << DMA_RING_SIZE_SHIFT) |
> - RX_BUF_LENGTH), DMA_RING_BUF_SIZE);
> + priv->rx_buf_len), DMA_RING_BUF_SIZE);
[Severity: Low]
Is this change to the TX ring intended?
In bcmgenet_init_tx_ring(), the buffer size field of the TDMA
DMA_RING_BUF_SIZE register now gets priv->rx_buf_len. That value comes
from bcmgenet_rx_buf_len(), which only uses RX quantities: the RX status
block plus the RBUF packet ready threshold.
At the default MTU this is 64 + 0x80 * 16 = 2112, so the TDMA register
value goes from 0x800 to 0x840 on every interface init.
The commit message only talks about the receive side:
"The MTU is still fixed at ETH_DATA_LEN, so the threshold comes out at
the reset default and the buffer only grows by the status block the
hardware already wrote."
It doesn't mention that a TX DMA register changes as well.
The TX ring already used the RX constant RX_BUF_LENGTH before this patch.
What is new here is the changed value, and the fact that the TX
programming now follows the MTU through the RX threshold and its
page-size clamp.
This line is unchanged in the later patches of the series. So once the MTU
can grow, the TDMA field keeps following bcmgenet_rx_buf_len(mtu) and not
any value picked for TX.
No functional effect has been shown. The per-descriptor TX length is in
length_status. The last patch in the series, "net: bcmgenet: reassemble
jumbo frames from status block fragments", reports 16361 byte frames
sent byte-exact over UMAC loopback while this field stays at rx_buf_len
(about 3.9K at most). That suggests the field does not limit TX.
Would it be clearer to keep a TX-specific value here? If the change is
intentional, could the commit message say so?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112-nb-genet-mtu-nn-v2-v7-0-43a5d90b3256%40tipi-net.de
next prev parent reply other threads:[~2026-11-15 13:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 10:45 [PATCH net-next v7 0/9] net: bcmgenet: support larger MTUs Nicolai Buchwitz
2026-11-12 10:45 ` [PATCH net-next v7 1/9] net: bcmgenet: ring the doorbell when the last frame of a batch is dropped Nicolai Buchwitz
2026-11-12 10:45 ` [PATCH net-next v7 2/9] net: bcmgenet: let the caller decide whether to start the PHY Nicolai Buchwitz
2026-11-12 10:45 ` [PATCH net-next v7 3/9] net: bcmgenet: allow a continuation descriptor without the alignment pad Nicolai Buchwitz
2026-11-12 10:45 ` [PATCH net-next v7 4/9] net: bcmgenet: rename ENET_MAX_MTU_SIZE to ENET_MAX_FRAME_LEN Nicolai Buchwitz
2026-11-12 10:45 ` [PATCH net-next v7 5/9] net: bcmgenet: derive the receive buffer length from the MTU Nicolai Buchwitz
2026-11-15 13:01 ` netdev-bot+sashiko [this message]
2026-11-12 10:45 ` [PATCH net-next v7 6/9] net: bcmgenet: split frames that end just past the transmit threshold Nicolai Buchwitz
2026-11-15 13:01 ` netdev-bot+sashiko
2026-11-12 10:45 ` [PATCH net-next v7 7/9] net: bcmgenet: build the DMA rings before giving up the running ones Nicolai Buchwitz
2026-11-12 10:45 ` [PATCH net-next v7 8/9] net: bcmgenet: allow the MTU to be changed Nicolai Buchwitz
2026-11-15 13:01 ` netdev-bot+sashiko
2026-11-12 10:45 ` [PATCH net-next v7 9/9] net: bcmgenet: reassemble jumbo frames from status block fragments Nicolai Buchwitz
2026-11-15 13:01 ` 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=179474771091.2199510.12424783948813016163@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=dave.stevenson@raspberrypi.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=f.fainelli@gmail.com \
--cc=florian.fainelli@broadcom.com \
--cc=justin.chen@broadcom.com \
--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=pierremarinleclercq88@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®