From: "Théo Lebrun" <theo.lebrun@bootlin.com>
To: "Théo Lebrun" <theo.lebrun@bootlin.com>,
"Conor Dooley" <conor.dooley@microchip.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Richard Cochran" <richardcochran@gmail.com>,
"Russell King" <linux@armlinux.org.uk>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
"Nicolas Ferre" <nicolas.ferre@microchip.com>,
"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
"Paolo Valerio" <pvalerio@redhat.com>,
"Nicolai Buchwitz" <nb@tipi-net.de>,
"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>,
"Maxime Chevallier" <maxime.chevallier@bootlin.com>
Subject: Re: [PATCH net-next v6 11/16] net: macb: change function signatures to take contexts
Date: Mon, 03 Aug 2026 17:30:37 +0200 [thread overview]
Message-ID: <DKFF0170T6H2.18I5BAQ9ZR3XV@bootlin.com> (raw)
In-Reply-To: <20260731-macb-context-v6-11-49d5a1439d48@bootlin.com>
Replying to net sashiko
https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260731-macb-context-v6-0-49d5a1439d48%40bootlin.com
> commit 8d7bc94670a7294669d008889ae3d43a6f139a9f
> Author: Théo Lebrun <theo.lebrun@bootlin.com>
>
> net: macb: change function signatures to take contexts
>
> This converts the macb ring/descriptor helpers and the alloc/free/init
> paths so they take a struct macb_context *ctx (plus a queue index where a
> struct macb_queue * was used) instead of struct macb *bp, in preparation
> for having more than one context around. Callers in the normal datapath
> now latch bp->ctx into a local variable and pass it down.
>
> A few questions below about the conversion.
>
> > diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> > index 97c8374317ceb..8f8c952ffc74a 100644
> > --- a/drivers/net/ethernet/cadence/macb_main.c
> > +++ b/drivers/net/ethernet/cadence/macb_main.c
>
> [ ... ]
>
> > @@ -1233,14 +1238,15 @@ static int macb_halt_tx(struct macb *bp)
> > bp, TSR);
> > }
> >
> > -static void macb_tx_unmap(struct macb *bp, struct macb_tx_skb *tx_skb, int budget)
> > +static void macb_tx_unmap(const struct macb_info *info,
> > + struct macb_tx_skb *tx_skb, int budget)
>
> [Severity: Low]
> [Finding: fable-5-1-2]
> [Sources: fable-5, opus-5]
> The commit message presents an exhaustive enumeration:
>
> Full list:
>
> macb_adj_dma_desc_idx()
> macb_tx_ring_wrap()
> ...
> macb_init_rings()
>
> macb_tx_unmap() also changes signature here, and all of its call sites are
> updated (macb_tx_error_task(), macb_tx_complete(), macb_tx_map() pass
> &bp->info, macb_free() passes ctx->info), but it is not in that list.
>
> It is also the one converted helper that does not follow the stated rule:
>
> To reduce bug surface area, taint those functions to *only* take a
> context `struct macb_context *ctx` and no `struct macb *bp`.
>
> macb_tx_unmap() takes const struct macb_info *info instead. Could the list
> be extended and the macb_info choice mentioned, so the exception is
> explicit?
macb_tx_unmap() should have been updated in [10/16] rather than [11/16].
I'm surprised the LLM didn't notice that; probably has a rather limited
view of the series, on purpose. Fixed for next revision.
> > @@ -5026,7 +5051,7 @@ static int at91ether_alloc_coherent(struct macb *bp)
> >
> > rxq->ring = dma_alloc_coherent(&bp->pdev->dev,
> > (AT91ETHER_MAX_RX_DESCR *
> > - macb_dma_desc_get_size(&bp->info)),
> > + macb_dma_desc_get_size(&bp->info)),
> > &rxq->ring_dma, GFP_KERNEL);
>
> [Severity: Low]
> [Finding: fable-5-1-2]
> [Sources: fable-5, opus-5]
> This hunk changes only leading whitespace, nothing on the line is affected
> by the context conversion, and it is not mentioned in the commit message.
> The new indentation also no longer lines up with the open parenthesis of
> (AT91ETHER_MAX_RX_DESCR *, which the original did. Could this hunk be
> dropped?
Removed.
Thanks,
--
Théo Lebrun, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2026-08-03 15:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-31 16:34 [PATCH net-next v6 00/16] net: macb: implement context swapping Théo Lebrun
2026-07-31 16:34 ` [PATCH net-next v6 01/16] net: macb: drop "consistent" from alloc/free function names Théo Lebrun
2026-07-31 16:34 ` [PATCH net-next v6 02/16] net: macb: unify device pointer naming convention Théo Lebrun
2026-07-31 16:34 ` [PATCH net-next v6 03/16] net: macb: unify variable naming convention in at91ether functions Théo Lebrun
2026-07-31 16:34 ` [PATCH net-next v6 04/16] net: macb: unify queue index variable naming convention and types Théo Lebrun
2026-07-31 16:34 ` [PATCH net-next v6 05/16] net: macb: enforce reverse christmas tree (RCT) convention Théo Lebrun
2026-07-31 16:34 ` [PATCH net-next v6 06/16] net: macb: allocate tieoff descriptor once across device lifetime Théo Lebrun
2026-07-31 16:34 ` [PATCH net-next v6 07/16] net: macb: introduce macb_context struct for buffer management Théo Lebrun
2026-08-03 15:11 ` Théo Lebrun
2026-07-31 16:34 ` [PATCH net-next v6 08/16] net: macb: avoid macb_init_rx_buffer_size() modifying state Théo Lebrun
2026-07-31 16:34 ` [PATCH net-next v6 09/16] net: macb: make `struct macb` subset reachable from macb_context struct Théo Lebrun
2026-07-31 16:34 ` [PATCH net-next v6 10/16] net: macb: change caps helpers signatures Théo Lebrun
2026-07-31 16:34 ` [PATCH net-next v6 11/16] net: macb: change function signatures to take contexts Théo Lebrun
2026-08-03 15:30 ` Théo Lebrun [this message]
2026-07-31 16:34 ` [PATCH net-next v6 12/16] net: macb: introduce macb_context_alloc() helper Théo Lebrun
2026-07-31 16:34 ` [PATCH net-next v6 13/16] net: macb: move printk() calls out of bp->lock critical section Théo Lebrun
2026-08-03 16:14 ` Théo Lebrun
2026-07-31 16:34 ` [PATCH net-next v6 14/16] net: macb: read ISR inside " Théo Lebrun
2026-08-03 17:01 ` Théo Lebrun
2026-07-31 16:34 ` [PATCH net-next v6 15/16] net: macb: use context swapping in .set_ringparam() Théo Lebrun
2026-08-03 19:18 ` Théo Lebrun
2026-07-31 16:34 ` [PATCH net-next v6 16/16] net: macb: use context swapping in .ndo_change_mtu() Théo Lebrun
2026-08-03 19:39 ` Théo Lebrun
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=DKFF0170T6H2.18I5BAQ9ZR3XV@bootlin.com \
--to=theo.lebrun@bootlin.com \
--cc=andrew+netdev@lunn.ch \
--cc=benoit.monin@bootlin.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=conor.dooley@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gregory.clement@bootlin.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=maxime.chevallier@bootlin.com \
--cc=nb@tipi-net.de \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=pabeni@redhat.com \
--cc=pvalerio@redhat.com \
--cc=richardcochran@gmail.com \
--cc=tawfik.bayouk@mobileye.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox