linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Dan Williams <dcbw@redhat.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org
Subject: Re: Can fb4e156886ce6e8309e912d8b370d192330d19d3 be reverted ?
Date: Fri, 14 Nov 2014 09:42:55 +0100	[thread overview]
Message-ID: <20141114084254.GC1949@redhat.com> (raw)
In-Reply-To: <6E4E0F42-B794-4F90-8AE9-0C208E40F7CD@holtmann.org>

On Fri, Nov 14, 2014 at 04:02:33PM +0900, Marcel Holtmann wrote:
> Hi Dan,
> 
> >>>> I've updated wireless code on RHEL and get complain that now
> >>>> cfg80211 and rfkill modules are loaded on machines that do not have
> >>>> wireless hardware. Modules are auto-loaded because NetworkManager send
> >>>> nl80211 messages to check if there are wireless devices in the system.
> >>>> 
> >>>> Hence my question, can we revert commit fb4e156886ce
> >>>> "nl80211: Add generic netlink module alias for cfg80211/nl80211" ?
> >>> 
> >>> Realistically, we can't revert it, but only remove the
> >>> MODULE_ALIAS_GENL_FAMILY() line.
> >>> 
> >>>> Auto loading nl80211 does not seems to be necessary, if there are
> >>>> wireless devices nl80211 will be loaded anyway.
> >>> 
> >>> Maybe other applications would like to see an empty list of devices? But
> >>> OTOH, if they're robust at all, they have to cope with kernels not even
> >>> compiled with nl80211, so I guess for me I don't really see a big
> >>> difference in whether the module alias exists or not.
> >> 
> >> auto-loading cfg80211 module when userspace requests nl80211 netlink family is exactly the right thing to do. Systems compiled without nl80211 support and systems with no wireless device attached are two different things.
> >> 
> >> Someone can fix NetworkManager to not send nl80211 messages or just plain accept that cfg80211 will be loaded.
> > 
> > NM uses nl80211 initially to determine whether *any* ethernet-type
> > interface (a) is actually WiFi, and (b) should be driven by nl80211 or
> > WEXT.  Because of the variety of drivers (both in-kernel and
> > out-of-kernel) and the variety of kernel versions (NM supports back to
> > early 3.x series) we cannot rely on specific behavior.
> > 
> > So given an ethernet-type interface, how do we determine that it is
> > wifi?
> > 
> > DEVTYPE=wlan - not always reliable due to driver and kernel versions
> 
> if anybody wants to write kernel patches, then making sure that all wireless drivers expose DEVTYPE=wlan is the way to go. If for some reason a driver does not do it, that is a bug.

NM can be run with older kernel versions, which does not have DEVTYPE=wlan.
I guess NM could check the kernel version and don't use nl80211 if
kernel is sufficiency modern.

> > "phy80211" in sysfs: same reason; also doesn't capture WEXT or
> > out-of-tree drivers
> > 
> > nl80211 calls: this is the only 100% reliable mechanism to detect
> > whether an ethernet-type interface is actually WiFi and nl80211-capable.
> > 
> > And unfortunately calling nl80211 loads the module...
> 
> So be it then, the cfg80211 modules gets loaded. People have to live with that.

It's 700k of kernel memory. People running many instances of guest OS
with this module loaded are quite unhappy.

> And just to be clear, this is not a kernel bug. Exposing the correct module alias for its netlink family is what the module should be doing.

This is not a kernel bug, but not having the alias is also not
a kernel bug :-)

Stanislaw

  reply	other threads:[~2014-11-14  8:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13 12:33 Can fb4e156886ce6e8309e912d8b370d192330d19d3 be reverted ? Stanislaw Gruszka
2014-11-13 12:44 ` Johannes Berg
2014-11-13 13:22   ` [PATCH] cfg80211: remove net-pf-16-proto-16-family-nl80211 module alias Stanislaw Gruszka
2014-11-13 13:36     ` Marcel Holtmann
2014-11-13 13:39       ` Stanislaw Gruszka
2014-11-13 13:48         ` Marcel Holtmann
2014-11-14  2:56           ` Dan Williams
2014-11-14  7:08             ` Marcel Holtmann
2014-11-14  8:39           ` Stanislaw Gruszka
2014-11-13 13:41   ` Can fb4e156886ce6e8309e912d8b370d192330d19d3 be reverted ? Marcel Holtmann
2014-11-14  2:55     ` Dan Williams
2014-11-14  6:09       ` Luca Coelho
2014-11-14  6:57         ` Marcel Holtmann
2014-11-14  8:41           ` Stanislaw Gruszka
2014-11-14  7:02       ` Marcel Holtmann
2014-11-14  8:42         ` Stanislaw Gruszka [this message]
2014-11-14 16:02         ` Dan Williams
2014-11-14 17:10           ` Dan Williams
2014-11-19 17:13             ` Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141114084254.GC1949@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=dcbw@redhat.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).