[PATCH 5/6] wext: Use one global netlink socket instead of one per interface.

Ben Greear greearb
Sat Dec 4 19:14:04 PST 2010


On 12/04/2010 01:12 PM, Jouni Malinen wrote:
> On Fri, Dec 03, 2010 at 04:55:04PM -0800, Ben Greear wrote:
>> This saves a lot of work for the kernel and for wpa_supplicant
>> since each netlink message no longer has to be dupplicated for
>> each interface.
>
> Is there any good reason for improving WEXT rather than nl80211? I would
> welcome this type of change for nl80211 much rather than here..
> driver_wext.c is a bit problematic for this since it is used by number
> of other driver wrappers and that may make the proper implementation
> difficult. driver_nl80211.c would not have such issue.

Its what I happen to be using (seems to be the default).
I did test this with 80+ STA interfaces and it seems to work fine.

I'll try using the netlink driver for future testing, and I'll see
if I can cook up a similar patch for it.


>> +/* One netlink instance per program, not per vif.
>> + */
>> +static struct netlink_data *netlink = NULL;
>> +static int netlink_refcnt = 0;
>> +static struct wpa_driver_wext_data* all_driver_data = NULL;
>
> These should be stored in global data structure that is initialized in
> global_init() handler (and that is the part that may be difficult to add
> for driver_wext.c without breaking other driver wrappers). Sett
> driver_nl80211.c for an example on how to maintain the global structure
> and interface list (struct nl80211_global and use of global_init() and
> init2()).

Why?  There is no need to open netlink it until something creates a driver
instance...and the ref-counting should take care of cleanup, etc.

Seems more code overhead to add a global struct, but if that will make
it acceptable, then I'll do it.

Thanks,
Ben

-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com



More information about the Hostap mailing list