Re: [PATCH net] net: xdp: don't call notifiers during driver init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux