All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolai Buchwitz <nb@tipi-net.de>
To: "Théo Lebrun" <theo.lebrun@bootlin.com>
Cc: "Conor Dooley" <conor.dooley@microchip.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>,
	"Richard Cochran" <richardcochran@gmail.com>,
	"Russell King" <linux@armlinux.org.uk>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Paolo Valerio" <pvalerio@redhat.com>,
	"Vladimir Kondratiev" <vladimir.kondratiev@mobileye.com>,
	"Gregory CLEMENT" <gregory.clement@bootlin.com>,
	"Benoît Monin" <benoit.monin@bootlin.com>,
	"Tawfik Bayouk" <tawfik.bayouk@mobileye.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	stable+noautosel@kernel.org, Sashiko <sashiko-bot@kernel.org>
Subject: Re: [PATCH net-next v11 0/9] net: macb: implement context swapping
Date: Tue, 13 Oct 2026 21:04:42 +0200	[thread overview]
Message-ID: <27d764b0c5c72de4aff77160b9efe8ef@tipi-net.de> (raw)
In-Reply-To: <20261013-macb-context-v11-0-b27785167566@bootlin.com>

Hi Théo

On 13.10.2026 15:16, Théo Lebrun wrote:
> MACB has a pretty primitive approach to buffer management. They are all
> stored in `struct macb *bp`. On operations that require buffer realloc
> (set_ringparam & change_mtu at the moment), the only option is to close
> the interface, change our global state and re-open the interface.
> 
> Two issues:
> - It doesn't fly on memory pressured systems; we free our precious
>   buffers and don't manage to reallocate fully, meaning our machine
>   just lost its network access.
> - Anecdotally, it is pretty slow because it implies a full PHY reinit.
> 
> Instead, we shall:
>  - allocate a new context (including buffers) first
>  - if it fails, early return without any impact to the interface
>  - stop interface
>  - update global state (bp, netdev, etc)
>  - pass newly allocated buffer pointers to the hardware
>  - start interface
>  - free old context
> 
> This is what we implement here. Both .set_ringparam() and
> .ndo_change_mtu() are covered by this series. In the future,
> at least .set_channels() [0], XDP [1] and XSK [2] would benefit.

> [...]

Tested on a Raspberry Pi CM5 (RP1 GEM) with lockdep and KASAN enabled:

- ring and MTU changes under bidirectional TCP and a UDP flood
- ring and MTU changes while the interface is down
- ring and MTU changes during autoneg
- injected allocation failures in both paths
- PTP and EEE after a swap

Everything worked, and changing either no longer takes the link down.

For the series:

Tested-by: Nicolai Buchwitz <nb@tipi-net.de> # RPi CM5 with RP1 GEM

Thanks,
Nicolai

      parent reply	other threads:[~2026-10-13 19:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 13:16 [PATCH net-next v11 0/9] net: macb: implement context swapping Théo Lebrun
2026-10-13 13:16 ` [PATCH net-next v11 1/9] net: macb: close race between NAPI polls & ndo_stop Théo Lebrun
2026-10-13 13:54   ` Nicolai Buchwitz
2026-10-13 13:16 ` [PATCH net-next v11 2/9] net: macb: introduce macb_context struct for buffer management Théo Lebrun
2026-10-13 13:16 ` [PATCH net-next v11 3/9] net: macb: avoid macb_init_rx_buffer_size() modifying state Théo Lebrun
2026-10-13 13:16 ` [PATCH net-next v11 4/9] net: macb: make `struct macb` subset reachable from macb_context struct Théo Lebrun
2026-10-13 13:16 ` [PATCH net-next v11 5/9] net: macb: change caps helpers signatures Théo Lebrun
2026-10-13 13:16 ` [PATCH net-next v11 6/9] net: macb: change function signatures to take contexts Théo Lebrun
2026-10-13 13:16 ` [PATCH net-next v11 7/9] net: macb: introduce macb_context_alloc() helper Théo Lebrun
2026-10-13 13:16 ` [PATCH net-next v11 8/9] net: macb: use context swapping in .set_ringparam() Théo Lebrun
2026-10-13 13:16 ` [PATCH net-next v11 9/9] net: macb: use context swapping in .ndo_change_mtu() Théo Lebrun
2026-10-13 13:20 ` [PATCH net-next v11 0/9] net: macb: implement context swapping netdev-bot+sinfo
2026-10-13 13:29   ` Théo Lebrun
2026-10-13 19:04 ` Nicolai Buchwitz [this message]

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=27d764b0c5c72de4aff77160b9efe8ef@tipi-net.de \
    --to=nb@tipi-net.de \
    --cc=andrew+netdev@lunn.ch \
    --cc=benoit.monin@bootlin.com \
    --cc=conor.dooley@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=gregory.clement@bootlin.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pvalerio@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=sashiko-bot@kernel.org \
    --cc=stable+noautosel@kernel.org \
    --cc=tawfik.bayouk@mobileye.com \
    --cc=theo.lebrun@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vladimir.kondratiev@mobileye.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.