[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20260109180209.023c50cf@kernel.org>
Date: Fri, 9 Jan 2026 18:02:09 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Dipayaan Roy <dipayanroy@...ux.microsoft.com>
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.
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.
--
pw-bot: cr
Powered by blists - more mailing lists