Re: [PATCH net-next v7 6/9] net: bcmgenet: split frames that end just past the transmit threshold

From: Nicolai Buchwitz

Date: Tue Nov 17 2026 - 04:06:06 EST


On 15.11.2026 14:01, netdev-bot+sashiko@xxxxxxxxxx wrote:
[...]

[Severity: Medium]
The commit message says the window "is one DMA transfer wide". The TX
DMA burst size, though, is set per platform in bcmgenet_dma_init():

bcmgenet_tdma_writel(priv, priv->dma_max_burst_length,
DMA_SCB_BURST_SIZE);

bcm2711_plat_data uses .dma_max_burst_length = 0x08. The v2, v3, v4, v5
and bcm7712 platform data use DMA_MAX_BURST_LENGTH (0x10).

Suppose the window grows with the programmed burst. On the 0x10 burst
parts, a frame could end 64 bytes or more past tx_thld_len and still
fall inside one transfer. Would bcmgenet_xmit() then skip the split for
it? That would leave the Tx DMA stall and the bcmgenet_init_dma()
failure in place on those cores.

The measurements in the message come from one v5. Once "net: bcmgenet:
allow the MTU to be changed" raises max_mtu on every non-v1 core, this
case becomes reachable.

Should the window be derived from dma_max_burst_length, or has 64 been
checked on a core with a 0x10 burst?

Right, bcm2711 has the reduced burst length. I don't know the details why
this is required, but my tests with 0x10 have confirmed that this quirk is
needed. I will derive it from burst length in v8.

[...]

[Severity: Medium]
Does ENET_THLD_MAX (3840 bytes) fit in the TBUF of every GENET version
that gets it here? bcmgenet_tx_pkt_rdy_thld() returns the same value
for all versions. bcmgenet_set_mtu_regs() then writes it on v2 and
later, with no clamp per version.

init_umac() programs the TBUF size control only on v3 and later:

if (!GENET_IS_V1(priv) && !GENET_IS_V2(priv))
bcmgenet_rbuf_writel(priv, 1, RBUF_TBUF_SIZE_CTRL);

So v2 has different TBUF sizing but gets the same threshold. The
measurements in the commit message are from a v5 only.

Suppose a core's TBUF cannot hold 3840 bytes. Could a frame longer than
that TBUF then never reach the threshold and stall the transmitter?

"net: bcmgenet: allow the MTU to be changed" later sets
dev->max_mtu = ENET_MAX_MTU for every non-v1 core. That would make this
setting reachable on v2 through v4.

I only have tested with v5 (bcm2711).

Florian / Justin: Can you test with older versions or confirm that they will
behave the same. Otherwise I can also cap max_mtu to v5 only.

[ ... ]

--
pw-bot: cr