Re: [PATCHv5 net-next 2/4] net: add new helper unregister_netdevice_many_notify

Nicolas Dichtel
2022-09-30T14:24:57Z

Le 30/09/2022 à 11:45, Hangbin Liu a écrit :
> Add new helper unregister_netdevice_many_notify(), pass netlink message
> header and port id, which could be used to notify userspace when flag
> NLM_F_ECHO is set.
>
> Make the unregister_netdevice_many() as a wrapper of new function
> unregister_netdevice_many_notify().
>
> Suggested-by: Guillaume Nault <gnault@redhat.com>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>

[snip]

> @@ -10860,7 +10864,7 @@ void unregister_netdevice_many(struct list_head *head)
> dev->netdev_ops->ndo_uninit(dev);
>
> if (skb)
> - rtmsg_ifinfo_send(skb, dev, GFP_KERNEL, 0, NULL);
> + rtmsg_ifinfo_send(skb, dev, GFP_KERNEL, pid, nlh);
>
> /* Notifier chain MUST detach us all upper devices. */
> WARN_ON(netdev_has_any_upper_dev(dev));
> @@ -10883,6 +10887,12 @@ void unregister_netdevice_many(struct list_head *head)
>
> list_del(head);
> }
> +EXPORT_SYMBOL(unregister_netdevice_many_notify);
Is this export really needed?

> +
> +void unregister_netdevice_many(struct list_head *head)
> +{
> + unregister_netdevice_many_notify(head, NULL, 0);
> +}
> EXPORT_SYMBOL(unregister_netdevice_many);
>
> /**