linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nl80211/compat: netlink_callback min_dump_alloc only exists since 3.1
@ 2013-03-05 10:05 Johannes Berg
  2013-03-07 22:30 ` Luis R. Rodriguez
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2013-03-05 10:05 UTC (permalink / raw)
  To: backports, linux-wireless

From: Johannes Berg <johannes.berg@intel.com>

On older kernels, we can't do this workaround, so if you use
an old 64-bit kernel with compat you'd better upgrade.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 patches/0006-disable-dump-adjust-on-old-kernels.patch | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 patches/0006-disable-dump-adjust-on-old-kernels.patch

diff --git a/patches/0006-disable-dump-adjust-on-old-kernels.patch b/patches/0006-disable-dump-adjust-on-old-kernels.patch
new file mode 100644
index 0000000..1712b6a
--- /dev/null
+++ b/patches/0006-disable-dump-adjust-on-old-kernels.patch
@@ -0,0 +1,18 @@
+--- a/net/wireless/nl80211.c
++++ b/net/wireless/nl80211.c
+@@ -1333,6 +1333,7 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb)
+ 					 cb->nlh->nlmsg_seq, NLM_F_MULTI,
+ 					 dev);
+ 		if (ret < 0) {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)
+ 			/*
+ 			 * If sending the wiphy data didn't fit (ENOBUFS or
+ 			 * EMSGSIZE returned), this SKB is still empty (so
+@@ -1352,6 +1353,7 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb)
+ 				mutex_unlock(&cfg80211_mutex);
+ 				return 1;
+ 			}
++#endif
+ 			idx--;
+ 			break;
+ 		}
-- 
1.8.0




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

* Re: [PATCH] nl80211/compat: netlink_callback min_dump_alloc only exists since 3.1
  2013-03-05 10:05 [PATCH] nl80211/compat: netlink_callback min_dump_alloc only exists since 3.1 Johannes Berg
@ 2013-03-07 22:30 ` Luis R. Rodriguez
  0 siblings, 0 replies; 2+ messages in thread
From: Luis R. Rodriguez @ 2013-03-07 22:30 UTC (permalink / raw)
  To: Johannes Berg; +Cc: backports, linux-wireless

On Tue, Mar 5, 2013 at 2:05 AM, Johannes Berg <johannes@sipsolutions.net> wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> On older kernels, we can't do this workaround, so if you use
> an old 64-bit kernel with compat you'd better upgrade.
>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>  patches/0006-disable-dump-adjust-on-old-kernels.patch | 18 ++++++++++++++++++

Same thing here, seems you are using an old branch where all patches
are under patches. The networking patches for backporting are now
under patches/collateral-evolutions/network/. I've massaged it,
applied and pushed, thanks!

Just FYI the patches with 4 digits are patches which have undergone
review and effort to break down as atomically as possible with the
hope that some of these can later be expressed as SmPL grammar to
automatically backport further use cases of the changes expressed. In
this case your patch is already well broken down so I'll leave it with
the 4 digit name.

I've also gone ahead and added some explanation on the top of the
patch as to what it does.

I've added this documentation:

----------------------------------------------

On older kernels, we can't do this workaround, so if you use
an old 64-bit kernel with compat you'd better upgrade.

For more details of this work around refer to this commit
upstream that deals with the code added:

commit 645e77def93f1dd0e211c7244fbe152dac8a7100
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Fri Mar 1 14:03:49 2013 +0100

    nl80211: increase wiphy dump size dynamically

    Given a device with many channels capabilities the wiphy
    information can still overflow even though its size in
    3.9 was reduced to 3.8 levels. For new userspace and
    kernel 3.10 we're going to implement a new "split dump"
    protocol that can use multiple messages per wiphy.

    For now though, add a workaround to be able to send more
    information to userspace. Since generic netlink doesn't
    have a way to set the minimum dump size globally, and we
    wouldn't really want to set it globally anyway, increase
    the size only when needed, as described in the comments.
    As userspace might not be prepared for large buffers, we
    can only use 4k.

    Also increase the size for the get_wiphy command.
----------------------------------------------

Let me know if you want to be more verbose for users.

  Luis

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

end of thread, other threads:[~2013-03-07 22:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-05 10:05 [PATCH] nl80211/compat: netlink_callback min_dump_alloc only exists since 3.1 Johannes Berg
2013-03-07 22:30 ` Luis R. Rodriguez

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).