From: Nicolai Buchwitz <nb@tipi-net.de>
To: Daniel Machon <daniel.machon@microchip.com>
Cc: Doug Berger <opendmb@gmail.com>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Florian Fainelli <f.fainelli@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Dave Stevenson <dave.stevenson@raspberrypi.com>
Subject: Re: [PATCH net-next v9 7/8] net: bcmgenet: allow the MTU to be changed
Date: Fri, 27 Nov 2026 11:22:49 +0100 [thread overview]
Message-ID: <3a85abf16fd109d255b4d9bd1c40558d@tipi-net.de> (raw)
In-Reply-To: <20261126121541.6gybeqbkxsvjav5i@DEN-DL-M70577>
Hi Daniel,
On 26.11.2026 13:15, Daniel Machon wrote:
> [...]
>> +static int bcmgenet_change_mtu(struct net_device *dev, int new_mtu)
>> +{
>> + struct bcmgenet_priv *priv = netdev_priv(dev);
>> + unsigned int old_mtu = dev->mtu;
>> + struct bcmgenet_dma_set set;
>> + int ret;
>> +
>> + /* A failed resume left the datapath down, nothing to reprogram */
>> + if (!netif_running(dev) || !priv->tx_cbs) {
>> + WRITE_ONCE(dev->mtu, new_mtu);
>> + priv->rx_buf_len = bcmgenet_rx_buf_len(new_mtu);
>> + return 0;
>> + }
>> +
>> + /* Below ETH_DATA_LEN everything is floored, so there is nothing to
>> + * reprogram and rx_buf_len stays as the receive path reads it.
>> + */
>> + if (max_t(unsigned int, old_mtu, ETH_DATA_LEN) ==
>> + max_t(unsigned int, new_mtu, ETH_DATA_LEN)) {
>> + WRITE_ONCE(dev->mtu, new_mtu);
>> + return 0;
>> + }
>
> What about a similar check for MTUs above ETH_DATA_LEN? AFAICT, there
> are
> ranges where you don't need to do a full replacement of the buffers,
> yet
> you still do.
Makes sense. I will add this in the next version!
> [...]
Thanks,
Nicolai
next prev parent reply other threads:[~2026-11-27 10:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 9:17 [PATCH net-next v9 0/8] net: bcmgenet: support larger MTUs Nicolai Buchwitz
2026-11-23 9:17 ` [PATCH net-next v9 1/8] net: bcmgenet: let the caller decide whether to start the PHY Nicolai Buchwitz
2026-11-23 9:17 ` [PATCH net-next v9 2/8] net: bcmgenet: allow a continuation descriptor without the alignment pad Nicolai Buchwitz
2026-11-23 9:17 ` [PATCH net-next v9 3/8] net: bcmgenet: rename ENET_MAX_MTU_SIZE to ENET_MAX_FRAME_LEN Nicolai Buchwitz
2026-11-23 9:17 ` [PATCH net-next v9 4/8] net: bcmgenet: derive the receive buffer length from the MTU Nicolai Buchwitz
2026-11-23 9:17 ` [PATCH net-next v9 5/8] net: bcmgenet: split frames that end just past the transmit threshold Nicolai Buchwitz
2026-11-23 9:17 ` [PATCH net-next v9 6/8] net: bcmgenet: build the DMA rings before giving up the running ones Nicolai Buchwitz
2026-11-23 9:17 ` [PATCH net-next v9 7/8] net: bcmgenet: allow the MTU to be changed Nicolai Buchwitz
2026-11-26 12:15 ` Daniel Machon
2026-11-27 10:22 ` Nicolai Buchwitz [this message]
2026-11-23 9:17 ` [PATCH net-next v9 8/8] net: bcmgenet: reassemble jumbo frames from status block fragments Nicolai Buchwitz
2026-11-26 12:07 ` Daniel Machon
2026-11-27 10:46 ` Nicolai Buchwitz
2026-11-23 14:23 ` [PATCH net-next v9 0/8] net: bcmgenet: support larger MTUs Nicolai Buchwitz
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=3a85abf16fd109d255b4d9bd1c40558d@tipi-net.de \
--to=nb@tipi-net.de \
--cc=andrew+netdev@lunn.ch \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=daniel.machon@microchip.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=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.