mbox series

[net-next,0/4] net: inline rollback_registered() functions

Message ID 20210119191158.3093099-1-kuba@kernel.org
Headers show
Series net: inline rollback_registered() functions | expand

Message

Jakub Kicinski Jan. 19, 2021, 7:11 p.m. UTC
After recent changes to the error path of register_netdevice()
we no longer need a version of unregister_netdevice_many() which
does not set net_todo. We can inline the rollback_registered()
functions into respective unregister_netdevice() calls.

Jakub Kicinski (4):
  net: move net_set_todo inside rollback_registered()
  net: inline rollback_registered()
  net: move rollback_registered_many()
  net: inline rollback_registered_many()

 net/core/dev.c | 209 +++++++++++++++++++++++--------------------------
 1 file changed, 97 insertions(+), 112 deletions(-)

Comments

Jakub Kicinski Jan. 19, 2021, 7:17 p.m. UTC | #1
On Tue, 19 Jan 2021 11:11:58 -0800 Jakub Kicinski wrote:
> @@ -10644,15 +10642,6 @@ EXPORT_SYMBOL(unregister_netdevice_queue);
>   *  we force a list_del() to make sure stack wont be corrupted later.
>   */
>  void unregister_netdevice_many(struct list_head *head)
> -{
> -	if (!list_empty(head)) {
> -		rollback_registered_many(head);
> -		list_del(head);

Obliviously missed the list_del() here, sorry for the noise :/

> -	}
> -}
> -EXPORT_SYMBOL(unregister_netdevice_many);
> -
> -static void rollback_registered_many(struct list_head *head)
>  {
>  	struct net_device *dev, *tmp;
>  	LIST_HEAD(close_head);
> @@ -10660,6 +10649,9 @@ static void rollback_registered_many(struct list_head *head)
>  	BUG_ON(dev_boot_phase);
>  	ASSERT_RTNL();
>  
> +	if (list_empty(head))
> +		return;
> +
>  	list_for_each_entry_safe(dev, tmp, head, unreg_list) {
>  		/* Some devices call without registering
>  		 * for initialization unwind. Remove those
> @@ -10744,6 +10736,7 @@ static void rollback_registered_many(struct list_head *head)
>  		net_set_todo(dev);
>  	}
>  }
> +EXPORT_SYMBOL(unregister_netdevice_many);