]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
Merge tag 'mac80211-next-for-davem-2018-01-22' of git://git.kernel.org/pub/scm/linux...
authorDavid S. Miller <davem@davemloft.net>
Mon, 22 Jan 2018 14:36:37 +0000 (09:36 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Jan 2018 14:36:37 +0000 (09:36 -0500)
Johannes Berg says:

====================
Less than a handful of changes:
 * possible memory leak fix in hwsim
 * speed up hwsim
 * add hwsim userspace rate control API
 * code cleanups
====================

A conflict was resolved in mac80211_hwsim.c, mostly of
the simple overlapping changes category.  One adding
a rhashtable and another adding a workqueue.

Signed-off-by: David S. Miller <davem@davemloft.net>
1  2 
drivers/net/wireless/mac80211_hwsim.c

index e54255597facdca9b3bb3e146ea013129fcd0483,66c2ac0397dad5f4d12d18f090161fbf79e8d4de..1cf22e62e3dddafcbf3136f8ba07aa397b9bb088
@@@ -489,7 -490,7 +490,8 @@@ static const struct ieee80211_iface_com
  
  static spinlock_t hwsim_radio_lock;
  static LIST_HEAD(hwsim_radios);
 +static struct workqueue_struct *hwsim_wq;
+ static struct rhashtable hwsim_radios_rht;
  static int hwsim_radio_idx;
  
  static struct platform_driver mac80211_hwsim_driver = {
@@@ -3352,8 -3398,10 +3404,10 @@@ static void remove_user_radios(u32 port
        list_for_each_entry_safe(entry, tmp, &hwsim_radios, list) {
                if (entry->destroy_on_close && entry->portid == portid) {
                        list_del(&entry->list);
+                       rhashtable_remove_fast(&hwsim_radios_rht, &entry->rht,
+                                              hwsim_rht_params);
                        INIT_WORK(&entry->destroy_work, destroy_radio);
 -                      schedule_work(&entry->destroy_work);
 +                      queue_work(hwsim_wq, &entry->destroy_work);
                }
        }
        spin_unlock_bh(&hwsim_radio_lock);
@@@ -3427,8 -3475,10 +3481,10 @@@ static void __net_exit hwsim_exit_net(s
                        continue;
  
                list_del(&data->list);
+               rhashtable_remove_fast(&hwsim_radios_rht, &data->rht,
+                                      hwsim_rht_params);
                INIT_WORK(&data->destroy_work, destroy_radio);
 -              schedule_work(&data->destroy_work);
 +              queue_work(hwsim_wq, &data->destroy_work);
        }
        spin_unlock_bh(&hwsim_radio_lock);
  }
@@@ -3460,9 -3510,7 +3516,10 @@@ static int __init init_mac80211_hwsim(v
  
        spin_lock_init(&hwsim_radio_lock);
  
 +      hwsim_wq = alloc_workqueue("hwsim_wq",WQ_MEM_RECLAIM,0);
 +      if (!hwsim_wq)
 +              return -ENOMEM;
+       rhashtable_init(&hwsim_radios_rht, &hwsim_rht_params);
  
        err = register_pernet_device(&hwsim_net_ops);
        if (err)
@@@ -3602,8 -3650,7 +3659,9 @@@ static void __exit exit_mac80211_hwsim(
        hwsim_exit_netlink();
  
        mac80211_hwsim_free();
 +      flush_workqueue(hwsim_wq);
 +
+       rhashtable_destroy(&hwsim_radios_rht);
        unregister_netdev(hwsim_mon);
        platform_driver_unregister(&mac80211_hwsim_driver);
        unregister_pernet_device(&hwsim_net_ops);