[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202210271734.PFaOmzZ6-lkp@intel.com>
Date: Thu, 27 Oct 2022 17:10:22 +0800
From: kernel test robot <lkp@...el.com>
To: Hangbin Liu <liuhangbin@...il.com>, netdev@...r.kernel.org
Cc: oe-kbuild-all@...ts.linux.dev, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Ido Schimmel <idosch@...dia.com>,
Petr Machata <petrm@...dia.com>,
Florent Fourcot <florent.fourcot@...irst.fr>,
Nikolay Aleksandrov <razor@...ckwall.org>,
Nicolas Dichtel <nicolas.dichtel@...nd.com>,
Guillaume Nault <gnault@...hat.com>,
David Ahern <dsahern@...nel.org>,
Hangbin Liu <liuhangbin@...il.com>
Subject: Re: [PATCHv6 net-next 2/4] net: add new helper
unregister_netdevice_many_notify
Hi Hangbin,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Hangbin-Liu/rtnetlink-Honour-NLM_F_ECHO-flag-in-rtnl_-new-del-link/20221027-110218
patch link: https://lore.kernel.org/r/20221027025726.2138619-3-liuhangbin%40gmail.com
patch subject: [PATCHv6 net-next 2/4] net: add new helper unregister_netdevice_many_notify
config: x86_64-randconfig-a013
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/2aef02643c2acca967a99f368536233942c657ff
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Hangbin-Liu/rtnetlink-Honour-NLM_F_ECHO-flag-in-rtnl_-new-del-link/20221027-110218
git checkout 2aef02643c2acca967a99f368536233942c657ff
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash net/core/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> net/core/dev.c:10795: warning: expecting prototype for unregister_netdevice_many(). Prototype was for unregister_netdevice_many_notify() instead
vim +10795 net/core/dev.c
^1da177e4c3f415 Linus Torvalds 2005-04-16 10783
9b5e383c11b0878 Eric Dumazet 2009-10-27 10784 /**
9b5e383c11b0878 Eric Dumazet 2009-10-27 10785 * unregister_netdevice_many - unregister many devices
9b5e383c11b0878 Eric Dumazet 2009-10-27 10786 * @head: list of devices
2aef02643c2acca Hangbin Liu 2022-10-27 10787 * @portid: destination netlink portid for reports
2aef02643c2acca Hangbin Liu 2022-10-27 10788 * @nlh: netlink message header
87757a917b0b3c0 Eric Dumazet 2014-06-06 10789 *
87757a917b0b3c0 Eric Dumazet 2014-06-06 10790 * Note: As most callers use a stack allocated list_head,
87757a917b0b3c0 Eric Dumazet 2014-06-06 10791 * we force a list_del() to make sure stack wont be corrupted later.
9b5e383c11b0878 Eric Dumazet 2009-10-27 10792 */
2aef02643c2acca Hangbin Liu 2022-10-27 10793 void unregister_netdevice_many_notify(struct list_head *head,
2aef02643c2acca Hangbin Liu 2022-10-27 10794 u32 portid, const struct nlmsghdr *nlh)
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 @10795 {
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10796 struct net_device *dev, *tmp;
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10797 LIST_HEAD(close_head);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10798
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10799 BUG_ON(dev_boot_phase);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10800 ASSERT_RTNL();
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10801
0cbe1e57a7b9351 Jakub Kicinski 2021-01-19 10802 if (list_empty(head))
0cbe1e57a7b9351 Jakub Kicinski 2021-01-19 10803 return;
0cbe1e57a7b9351 Jakub Kicinski 2021-01-19 10804
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10805 list_for_each_entry_safe(dev, tmp, head, unreg_list) {
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10806 /* Some devices call without registering
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10807 * for initialization unwind. Remove those
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10808 * devices and proceed with the remaining.
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10809 */
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10810 if (dev->reg_state == NETREG_UNINITIALIZED) {
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10811 pr_debug("unregister_netdevice: device %s/%p never was registered\n",
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10812 dev->name, dev);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10813
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10814 WARN_ON(1);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10815 list_del(&dev->unreg_list);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10816 continue;
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10817 }
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10818 dev->dismantle = true;
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10819 BUG_ON(dev->reg_state != NETREG_REGISTERED);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10820 }
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10821
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10822 /* If device is running, close it first. */
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10823 list_for_each_entry(dev, head, unreg_list)
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10824 list_add_tail(&dev->close_list, &close_head);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10825 dev_close_many(&close_head, true);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10826
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10827 list_for_each_entry(dev, head, unreg_list) {
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10828 /* And unlink it from device chain. */
cc26c2661fefea2 Eric Dumazet 2022-06-16 10829 write_lock(&dev_base_lock);
cc26c2661fefea2 Eric Dumazet 2022-06-16 10830 unlist_netdevice(dev, false);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10831 dev->reg_state = NETREG_UNREGISTERING;
cc26c2661fefea2 Eric Dumazet 2022-06-16 10832 write_unlock(&dev_base_lock);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10833 }
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10834 flush_all_backlogs();
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10835
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10836 synchronize_net();
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10837
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10838 list_for_each_entry(dev, head, unreg_list) {
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10839 struct sk_buff *skb = NULL;
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10840
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10841 /* Shutdown queueing discipline. */
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10842 dev_shutdown(dev);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10843
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10844 dev_xdp_uninstall(dev);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10845
9309f97aef6d825 Petr Machata 2022-03-02 10846 netdev_offload_xstats_disable_all(dev);
9309f97aef6d825 Petr Machata 2022-03-02 10847
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10848 /* Notify protocols, that we are about to destroy
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10849 * this device. They should clean all the things.
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10850 */
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10851 call_netdevice_notifiers(NETDEV_UNREGISTER, dev);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10852
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10853 if (!dev->rtnl_link_ops ||
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10854 dev->rtnl_link_state == RTNL_LINK_INITIALIZED)
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10855 skb = rtmsg_ifinfo_build_skb(RTM_DELLINK, dev, ~0U, 0,
2aef02643c2acca Hangbin Liu 2022-10-27 10856 GFP_KERNEL, NULL, 0,
2aef02643c2acca Hangbin Liu 2022-10-27 10857 portid, nlmsg_seq(nlh));
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10858
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10859 /*
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10860 * Flush the unicast and multicast chains
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10861 */
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10862 dev_uc_flush(dev);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10863 dev_mc_flush(dev);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10864
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10865 netdev_name_node_alt_flush(dev);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10866 netdev_name_node_free(dev->name_node);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10867
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10868 if (dev->netdev_ops->ndo_uninit)
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10869 dev->netdev_ops->ndo_uninit(dev);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10870
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10871 if (skb)
2aef02643c2acca Hangbin Liu 2022-10-27 10872 rtmsg_ifinfo_send(skb, dev, GFP_KERNEL, portid, nlh);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10873
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10874 /* Notifier chain MUST detach us all upper devices. */
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10875 WARN_ON(netdev_has_any_upper_dev(dev));
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10876 WARN_ON(netdev_has_any_lower_dev(dev));
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10877
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10878 /* Remove entries from kobject tree */
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10879 netdev_unregister_kobject(dev);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10880 #ifdef CONFIG_XPS
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10881 /* Remove XPS queueing entries */
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10882 netif_reset_xps_queues_gt(dev, 0);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10883 #endif
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10884 }
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10885
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10886 synchronize_net();
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10887
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10888 list_for_each_entry(dev, head, unreg_list) {
d62607c3fe45911 Jakub Kicinski 2022-06-07 10889 netdev_put(dev, &dev->dev_registered_tracker);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10890 net_set_todo(dev);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10891 }
0cbe1e57a7b9351 Jakub Kicinski 2021-01-19 10892
0cbe1e57a7b9351 Jakub Kicinski 2021-01-19 10893 list_del(head);
bcfe2f1a3818d9d Jakub Kicinski 2021-01-19 10894 }
2aef02643c2acca Hangbin Liu 2022-10-27 10895
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (118748 bytes)
Powered by blists - more mailing lists