[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230316145418.3af738c3@kernel.org>
Date: Thu, 16 Mar 2023 14:54:18 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Lorenzo Bianconi <lorenzo@...nel.org>
Cc: Tariq Toukan <ttoukan.linux@...il.com>, davem@...emloft.net,
netdev@...r.kernel.org, edumazet@...gle.com, pabeni@...hat.com,
ast@...nel.org, daniel@...earbox.net, hawk@...nel.org,
john.fastabend@...il.com, tariqt@...dia.com, bpf@...r.kernel.org
Subject: Re: [PATCH net] net: xdp: don't call notifiers during driver init
On Thu, 16 Mar 2023 12:03:57 +0100 Lorenzo Bianconi wrote:
> > I maybe need to dig deeper, but, it looks strange to still
> > call_netdevice_notifiers in cases > NETREG_REGISTERED.
> >
> > Isn't it problematic to call it with NETREG_UNREGISTERED ?
> >
> > For comparison, netif_set_real_num_tx_queues has this ASSERT_RTNL() only
> > under dev->reg_state == NETREG_REGISTERED || dev->reg_state ==
> > NETREG_UNREGISTERING.
>
> does it make sense to run call_netdevice_notifiers() in xdp_set_features_flag()
> just if dev->reg_state is NETREG_REGISTERED?
I was thinking - we'll adjust it if someone complains, but indeed
the detection is somewhat weak, a call on a dead device but under
rtnl_lock won't warn. Let me just copy what the queue helpers do,
exactly, then.
> Moreover, looking at the code it seems netdev code can run with dev->reg_state
> set to NETREG_UNREGISTERED and without holding RTNL lock, right?
You mean - part of unregistration is done without rtnl lock held?
Powered by blists - more mailing lists