linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/4] Allow live MAC address change
@ 2019-09-04 19:11 James Prestwood
  2019-09-04 19:11 ` [RFC 1/4] nl80211: Add LIVE_ADDR_CHANGE feature James Prestwood
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: James Prestwood @ 2019-09-04 19:11 UTC (permalink / raw)
  To: linux-wireless; +Cc: James Prestwood

This set enables userspace to change the devices MAC address via RTNL
or CMD_CONNECT/CMD_AUTHENTICATE without bringing the device down then
back up. This has several benefits:

 - Simplifies user space logic. No longer requires tracking multiple
   RTNL/netlink message transactions (down, change mac, up, connect).
 - Drastically speeds up connection times when changing MAC on a
   per-connect basis.
 - Eliminates potential race conditions in userspace. At any time
   during the down/change/up sequence the device could be hot
   unplugged or something could go wrong in the kernel leaving
   userspace in an unknown state.

A new extended feature was added,
NL80211_EXT_FEATURE_LIVE_ADDRESS_CHANGE which is set if the device
supports this feature. This feature is enabled by default for mac80211
based drivers.

A new NL80211 attribute was added, NL80211_ATTR_MAC_TO_CHANGE. This
attribute can be used with CMD_CONNECT/CMD_AUTHENTICATE to change the
MAC address automatically without having to go through RTNL.

I have taken some timings for all 3 ways of changing the MAC. Powered
change via RTNL, non powered via RTNL, and changing through
CMD_CONNECT. All times were taken in microseconds and tested on an
Intel 7260 PCI wireless adapter:

Powered via RTNL:

Average: 294508.9
Min: 284523
Max: 300345

==================================
Non-Powered via RTNL:

Average: 14824.7
Min: 11037
Max: 17812

Speedup from powered change: 19.87x (average)

==================================
via CMD_CONNECT:

Average: 11848.7
Min: 9748
Max: 17152

Speedup from powered change: 24.86x (average)

==================================

The speed increases between powered and non-powered are quite
impressive. Besides the obvious speedup, the amount of code requred
for userspace to take advantage of this feature is extremely small
(via CMD_CONNECT, essentially a feature check and an extra attribute).
In addition, the changes/complexity to the kernel is minimal.

James Prestwood (4):
  nl80211: Add LIVE_ADDR_CHANGE feature
  {nl|cfg}80211: Support mac change as part of SME Connect
  mac80211: Support LIVE_ADDRESS_CHANGE feature
  {nl,cfg}nl80211: Support mac change for mlme_authenticate

 include/net/cfg80211.h       |  1 +
 include/uapi/linux/nl80211.h | 10 +++++++
 net/mac80211/iface.c         | 51 ++++++++++++++++++++++++++++++++++--
 net/mac80211/main.c          |  1 +
 net/wireless/core.h          |  4 ++-
 net/wireless/mlme.c          |  9 ++++++-
 net/wireless/nl80211.c       | 18 ++++++++++++-
 net/wireless/sme.c           |  9 ++++++-
 net/wireless/util.c          | 11 ++++++++
 9 files changed, 108 insertions(+), 6 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2019-09-17 19:12 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04 19:11 [RFC 0/4] Allow live MAC address change James Prestwood
2019-09-04 19:11 ` [RFC 1/4] nl80211: Add LIVE_ADDR_CHANGE feature James Prestwood
2019-09-04 19:11 ` [RFC 2/4] {nl|cfg}80211: Support mac change as part of SME Connect James Prestwood
2019-09-04 19:11 ` [RFC 3/4] mac80211: Support LIVE_ADDRESS_CHANGE feature James Prestwood
2019-09-04 19:11 ` [RFC 4/4] {nl,cfg}nl80211: Support mac change for mlme_authenticate James Prestwood
2019-09-11  9:09 ` [RFC 0/4] Allow live MAC address change Johannes Berg
2019-09-11 15:54   ` James Prestwood
2019-09-11 18:25     ` Johannes Berg
2019-09-11 19:20       ` James Prestwood
2019-09-13 10:24         ` Kalle Valo
2019-09-13 16:17           ` James Prestwood
2019-09-17  7:46             ` Kalle Valo
2019-09-17 15:40               ` Denis Kenzior
2019-09-17 18:44                 ` Bob Marcan
2019-09-17 18:47                   ` Ben Greear
2019-09-17 19:05                   ` Marcel Holtmann
2019-09-17 19:11                   ` Steve deRosier
2019-09-17 16:11               ` James Prestwood
2019-09-13 18:49         ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).