[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20260112125917.GA10106@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
Date: Mon, 12 Jan 2026 04:59:17 -0800
From: Dipayaan Roy <dipayanroy@...ux.microsoft.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: kys@...rosoft.com, haiyangz@...rosoft.com, wei.liu@...nel.org,
decui@...rosoft.com, andrew+netdev@...n.ch, davem@...emloft.net,
edumazet@...gle.com, pabeni@...hat.com, longli@...rosoft.com,
kotaranov@...rosoft.com, horms@...nel.org,
shradhagupta@...ux.microsoft.com, ssengar@...ux.microsoft.com,
ernis@...ux.microsoft.com, shirazsaleem@...rosoft.com,
linux-hyperv@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-rdma@...r.kernel.org,
dipayanroy@...rosoft.com
Subject: Re: [PATCH net-next, v7] net: mana: Implement ndo_tx_timeout and
serialize queue resets per port.
Fri, Jan 09, 2026 at 06:02:09PM -0800, Jakub Kicinski wrote:
> On Tue, 6 Jan 2026 15:04:38 -0800 Dipayaan Roy wrote:
> > +static void mana_per_port_queue_reset_work_handler(struct work_struct *work)
> > +{
> > + struct mana_queue_reset_work *reset_queue_work =
> > + container_of(work, struct mana_queue_reset_work, work);
> > +
> > + struct mana_port_context *apc = container_of(reset_queue_work,
> > + struct mana_port_context,
> > + queue_reset_work);
>
> > +struct mana_queue_reset_work {
> > + /* Work structure */
>
> Not sure what value this comment adds. Looks like something AI
> generator would add.
>
> > + struct work_struct work;
> > +};
> > +
> > struct mana_port_context {
> > struct mana_context *ac;
> > struct net_device *ndev;
> > + struct mana_queue_reset_work queue_reset_work;
>
> Why did you wrap the work in another struct with just one member?
> It forces you to work thru two layers of container of.
>
> Either way, container_of supports nested structs so I think something
> like:
>
> struct mana_port_context *apc = container_of(work,
> struct mana_port_context,
> queue_reset_work.work);
>
> should work (untested). But really, better to just delete the pointless
> nesting.
Thanks Jakub, I will remove the nesting and re-share a new patch after
testing.
> --
> pw-bot: cr
Regards
Dipayaan Roy
Powered by blists - more mailing lists