[PATCH v2 6/6] nl80211: Use global netlink objects.

Jouni Malinen j at w1.fi
Thu Oct 20 19:23:59 EDT 2011


On Thu, Oct 20, 2011 at 01:21:24PM -0700, greearb at candelatech.com wrote:
> Netlink sockets can be shared among all driver instances,
> saving lots of sockets, spurious log messages, memory,
> and CPU usage when using multiple interfaces in a single
> process.

> -#define DRVNL nl80211
> -#define DRVPREQ nl_handle_preq
> +#define DRVNL global->nl80211
> +#define DRVPREQ global->nl_handle_preq

Uh... Why would those macros be used? Would be just much cleaner to move
directly from nl80211 to global->nl80211 rather than through this type
of macro..

Please take a look at how I split these changes in this series:
http://w1.fi/p/nl80211-share-netlink/

I think that
[PATCH 1/6] nl80211: Use a wrapper for genlmsg_put
and
[PATCH 4/6] nl80211: Use global netlink rtm event object
are pretty okay as-is (though, I haven't really tested these at all).

[PATCH 2/6] nl80211: Initialize global context with hostapd
is kind of ugly and if I understood correctly, missing the global deinit
call (unless 5/6 handles that somehow).. This should really be moved to
core hostapd code to get similar design to wpa_supplicant.

I don't understand why
[PATCH 3/6] nl80211: Validate global_init/deinit use
would be needed.

I have not yet fully reviewed
[PATCH 5/6] nl80211: Use global netlink objects
but it is at least in clearer state to be reviewed in this form. It
would be even nicer if some of it like the Probe Request reporting could
be split to another patch, but I did not look at how easy that would be
to do.

I'm not sure whether I like the
[PATCH 6/6] nl80211: Add identifier to structs
change.. I moved it to the end of the series to avoid blocking other
changes because of this.

-- 
Jouni Malinen                                            PGP id EFC895FA


More information about the HostAP mailing list