Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] cfg80211: Be able to set bss expire time at config stage.
From: Johannes Berg @ 2017-05-22 16:34 UTC (permalink / raw)
  To: Enric Balletbo i Serra, David S . Miller, linux-wireless
  Cc: netdev, linux-kernel, Dmitry Shmidt, helmut.schaa
In-Reply-To: <1495469954.26008.1.camel@sipsolutions.net>

On Mon, 2017-05-22 at 18:19 +0200, Johannes Berg wrote:
> 
> I'm not really all that convinced that we really need this -
> userspace should just be using the flush thing more often, and then
> it doesn't really matter.
> 
> However, maybe that doesn't really matter all that much.

Actually, I changed my mind based on the discussion with Dan. This
makes no sense, and since you've obviously never even tested this
patch, you probably haven't thought about alternatives either.

johannes

^ permalink raw reply

* Re: [PATCH net-next] net/wan/fsl_ucc_hdlc: fix muram allocation error
From: David Miller @ 2017-05-22 16:29 UTC (permalink / raw)
  To: holger.brunck; +Cc: netdev, qiang.zhao
In-Reply-To: <20170522073115.16393-1-holger.brunck@keymile.com>

From: Holger Brunck <holger.brunck@keymile.com>
Date: Mon, 22 May 2017 09:31:15 +0200

> sizeof(priv->ucc_pram) is 4 as it is the size of a pointer, but we want
> to reserve space for the struct ucc_hdlc_param.
> 
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>

Applied.

^ permalink raw reply

* Re: [PATCH] kernel: bpf: remove dead code
From: David Miller @ 2017-05-22 16:27 UTC (permalink / raw)
  To: daniel; +Cc: garsilva, ast, netdev, linux-kernel
In-Reply-To: <5922FB28.5070303@iogearbox.net>

From: Daniel Borkmann <daniel@iogearbox.net>
Date: Mon, 22 May 2017 16:52:24 +0200

> On 05/22/2017 04:38 PM, David Miller wrote:
>> From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
>> Date: Mon, 22 May 2017 09:07:46 -0500
>>
>>> Execution cannot reach NET_IP_ALIGN inside the following statement:
>>> ip_align = strict ? 2 : NET_IP_ALIGN
>>>
>>> Addresses-Coverity-ID: 1409762
>>> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
>>> ---
>>> NOTE: variable ip_align could also be removed and use value 2
>>> directly.
>>
>> Incorrect.
>>
>> Some platforms define NET_IP_ALIGN to zero, so the code must remain
>> as is.
> 
> In the check_pkt_ptr_alignment(), when !strict you would already
> return earlier from that function.
> 
> So, above test in ip_align will always give 2, meaning technically
> the patch is correct, although hard-coded value less clean.
> 
> Perhaps something like the below to keep intentions more clear (and
> it will get resolved during compile time anyway ...):

Ok I understand the issue now.  Thanks for explaining.

I guess a hard-coded value of 2 and an adjusted comment above the
assignment of ip_align is the way to go.

I'll push the following, thanks everyone:

====================
net: Make IP alignment calulations clearer.

The assignmnet:

	ip_align = strict ? 2 : NET_IP_ALIGN;

in compare_pkt_ptr_alignment() trips up Coverity because we can only
get to this code when strict is true, therefore ip_align will always
be 2 regardless of NET_IP_ALIGN's value.

So just assign directly to '2' and explain the situation in the
comment above.

Reported-by: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
 kernel/bpf/verifier.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 1eddb71..c72cd41 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -808,11 +808,15 @@ static int check_pkt_ptr_alignment(const struct bpf_reg_state *reg,
 		reg_off += reg->aux_off;
 	}
 
-	/* skb->data is NET_IP_ALIGN-ed, but for strict alignment checking
-	 * we force this to 2 which is universally what architectures use
-	 * when they don't set CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS.
+	/* For platforms that do not have a Kconfig enabling
+	 * CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS the value of
+	 * NET_IP_ALIGN is universally set to '2'.  And on platforms
+	 * that do set CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS, we get
+	 * to this code only in strict mode where we want to emulate
+	 * the NET_IP_ALIGN==2 checking.  Therefore use an
+	 * unconditional IP align value of '2'.
 	 */
-	ip_align = strict ? 2 : NET_IP_ALIGN;
+	ip_align = 2;
 	if ((ip_align + reg_off + off) % size != 0) {
 		verbose("misaligned packet access off %d+%d+%d size %d\n",
 			ip_align, reg_off, off, size);
-- 
2.4.11

^ permalink raw reply related

* Re: [PATCH] cfg80211: Be able to set bss expire time at config stage.
From: Johannes Berg @ 2017-05-22 16:24 UTC (permalink / raw)
  To: Dan Williams, Enric Balletbo i Serra, David S . Miller,
	linux-wireless
  Cc: netdev, linux-kernel, Dmitry Shmidt, helmut.schaa
In-Reply-To: <1495470111.25557.9.camel@redhat.com>


> Couldn't userspace just look at NL80211_BSS_SEEN_MS_AGO to filter and
> create its own list?  Given that the kernel provides the information
> userspace needs to figure out the age of a particular BSS, it doesn't
> seem like there needs to be a kernel tunable for this.  Userspace can
> already avoid stale results.

Yeah, I agree. It can also ask for a flush, so that old results are
gone by the time the next scan returns. We don't have a flush operation
without requesting a new scan, but I guess that could be added.

> Also, different runtime situations might want different result ages,
> which wouldn't be possible if the kernel had a hardcoded maximum. 
> Furthermore, different userspace apps might be reading the same scan
> list, and they might have different ideas about staleness.
> 
> Or perhaps I misunderstand the problem, which could well be the case.

No, I think this is perfectly right - userspace should be able to deal
with this given the tools we gave it, or if not, we should probably
just give it more tools instead of hardcoding the kernel configuration.

This value really just kinda needed to be an upper bound so that we
don't start expiring entries while we're still scanning.

johannes

^ permalink raw reply

* Re: [PATCH] cfg80211: Be able to set bss expire time at config stage.
From: Dan Williams @ 2017-05-22 16:21 UTC (permalink / raw)
  To: Enric Balletbo i Serra, Johannes Berg, David S . Miller,
	linux-wireless
  Cc: netdev, linux-kernel, Dmitry Shmidt, helmut.schaa
In-Reply-To: <20170522160946.2057-1-enric.balletbo@collabora.com>

On Mon, 2017-05-22 at 18:09 +0200, Enric Balletbo i Serra wrote:
> The IEEE80211_SCAN_RESULT_EXPIRE value was modified several times in
> the
> past. Initially was set at 10 seconds (2a51931192), then increased at
> 15
> seconds (09f97e0fc4) and finally to 30 seconds (f9616e0f88) to cover
> the
> use case when a station is having heavy uplink traffic. On some
> devices,
> like Chromebooks, this value is decreased to 7 seconds to avoid stall
> results, and other devices prefer set to 15 seconds.

Couldn't userspace just look at NL80211_BSS_SEEN_MS_AGO to filter and
create its own list?  Given that the kernel provides the information
userspace needs to figure out the age of a particular BSS, it doesn't
seem like there needs to be a kernel tunable for this.  Userspace can
already avoid stale results.

Also, different runtime situations might want different result ages,
which wouldn't be possible if the kernel had a hardcoded maximum. 
Furthermore, different userspace apps might be reading the same scan
list, and they might have different ideas about staleness.

Or perhaps I misunderstand the problem, which could well be the case.

Dan

> This simple patch tries to make the selection of this value a bit
> more
> flexible by being able to set the expire time at config stage. Most
> users
> can leave the default value set as 30 seconds, others can modify the
> value
> at config stage if they want lower or bigger values.
> 
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
>  net/wireless/Kconfig | 11 +++++++++++
>  net/wireless/core.c  |  2 ++
>  net/wireless/core.h  |  1 +
>  net/wireless/scan.c  |  6 ++----
>  4 files changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig
> index 6c60612..2a54e28 100644
> --- a/net/wireless/Kconfig
> +++ b/net/wireless/Kconfig
> @@ -29,6 +29,17 @@ config CFG80211
>  
>  	  When built as a module it will be called cfg80211.
>  
> +config CFG80211_SCAN_RESULT_EXPIRE
> +	int "Scan completion time" if CFG80211
> +	default 30
> +	---help---
> +	  This value is the time in seconds the mac80211 scan method
> needs
> +	  to finish. An expiration time to 30 seconds should be
> sufficient
> +	  for most cases but for some other cases we might be
> interested in
> +	  tweak this value.
> +
> +	  If unsure, leave the default of 30.
> +
>  config NL80211_TESTMODE
>  	bool "nl80211 testmode command"
>  	depends on CFG80211
> diff --git a/net/wireless/core.c b/net/wireless/core.c
> index 83ea164..2a5742c 100644
> --- a/net/wireless/core.c
> +++ b/net/wireless/core.c
> @@ -499,6 +499,8 @@ struct wiphy *wiphy_new_nm(const struct
> cfg80211_ops *ops, int sizeof_priv,
>  
>  	init_waitqueue_head(&rdev->dev_wait);
>  
> +	rdev->scan_result_expire =
> CONFIG_CFG80211_SCAN_RESULT_EXPIRE;
> +
>  	/*
>  	 * Initialize wiphy parameters to IEEE 802.11 MIB default
> values.
>  	 * Fragmentation and RTS threshold are disabled by default
> with the
> diff --git a/net/wireless/core.h b/net/wireless/core.h
> index 6e809325..6a8a164 100644
> --- a/net/wireless/core.h
> +++ b/net/wireless/core.h
> @@ -72,6 +72,7 @@ struct cfg80211_registered_device {
>  	struct rb_root bss_tree;
>  	u32 bss_generation;
>  	u32 bss_entries;
> +	unsigned int scan_result_expire;
>  	struct cfg80211_scan_request *scan_req; /* protected by RTNL
> */
>  	struct sk_buff *scan_msg;
>  	struct list_head sched_scan_req_list;
> diff --git a/net/wireless/scan.c b/net/wireless/scan.c
> index 14d5f0c..f0b55a9 100644
> --- a/net/wireless/scan.c
> +++ b/net/wireless/scan.c
> @@ -70,8 +70,6 @@ module_param(bss_entries_limit, int, 0644);
>  MODULE_PARM_DESC(bss_entries_limit,
>                   "limit to number of scan BSS entries (per wiphy,
> default 1000)");
>  
> -#define IEEE80211_SCAN_RESULT_EXPIRE	(30 * HZ)
> -
>  static void bss_free(struct cfg80211_internal_bss *bss)
>  {
>  	struct cfg80211_bss_ies *ies;
> @@ -476,7 +474,7 @@ void cfg80211_bss_age(struct
> cfg80211_registered_device *rdev,
>  
>  void cfg80211_bss_expire(struct cfg80211_registered_device *rdev)
>  {
> -	__cfg80211_bss_expire(rdev, jiffies -
> IEEE80211_SCAN_RESULT_EXPIRE);
> +	__cfg80211_bss_expire(rdev, jiffies - rdev-
> >scan_result_expire);
>  }
>  
>  const u8 *cfg80211_find_ie_match(u8 eid, const u8 *ies, int len,
> @@ -737,7 +735,7 @@ struct cfg80211_bss *cfg80211_get_bss(struct
> wiphy *wiphy,
>  		if (!is_valid_ether_addr(bss->pub.bssid))
>  			continue;
>  		/* Don't get expired BSS structs */
> -		if (time_after(now, bss->ts +
> IEEE80211_SCAN_RESULT_EXPIRE) &&
> +		if (time_after(now, bss->ts + rdev-
> >scan_result_expire) &&
>  		    !atomic_read(&bss->hold))
>  			continue;
>  		if (is_bss(&bss->pub, bssid, ssid, ssid_len)) {

^ permalink raw reply

* Re: [PATCHv4] wlcore: add wl1285 compatible
From: Sebastian Reichel @ 2017-05-22 16:21 UTC (permalink / raw)
  To: Rob Herring
  Cc: Kalle Valo, David Miller, Tony Lindgren, Marcel Holtmann,
	linux-wireless, linux-omap,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, netdev
In-Reply-To: <CAL_JsqL91sruKNaWmVEqT+L_OCh5xFkkGY07mBBUmqkKHc5fQw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 3253 bytes --]

Hi,

On Mon, May 22, 2017 at 11:11:49AM -0500, Rob Herring wrote:
> On Mon, May 22, 2017 at 10:21 AM, Sebastian Reichel
> <sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org> wrote:
> > Hi,
> >
> > On Mon, May 22, 2017 at 05:44:24PM +0300, Kalle Valo wrote:
> >> David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> writes:
> >> > From: Kalle Valo <kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> >> > Date: Mon, 22 May 2017 12:28:20 +0300
> >> >
> >> >> Sebastian Reichel <sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org> writes:
> >> >>
> >> >>> Motorola Droid 4 uses a WL1285C. With differences between the
> >> >>> chips not being public let's add explicit binding for wl1285
> >> >>> instead of relying on wl1283 being very similar.
> >> >>>
> >> >>> Reviewed-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> >> >>> Acked-by: Kalle Valo <kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> >> >>> Acked-by: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
> >> >>> Signed-off-by: Sebastian Reichel <sebastian.reichel-ZGY8ohtN/8oXa1LcwEujcA@public.gmane.orgk>
> >> >>> ---
> >> >>> Hi Dave,
> >> >>>
> >> >>> I previously send this in two patches, but its hard to apply without
> >> >>> requiring multiple kernel releases (the driver must be updated before
> >> >>> the DTS change). Since the actual change is not very complex Marcel
> >> >>> Holtmann & Tony Lindgren suggested, that I send this directly to you
> >> >>> in a single patch for inclusion into 4.12. This also means, that the
> >> >>> remaining series can be queued normally for 4.13.
> >> >>
> >> >> I noticed that Dave set this patch to Awaiting Upstream state on his
> >> >> patchwork:
> >> >>
> >> >> https://patchwork.ozlabs.org/patch/759042/
> >> >>
> >> >> Which makes me suspect that he is waiting me to apply this (as I
> >> >> normally apply wlcore patches). Dave, should I actually take this patch?
> >> >> What do you prefer?
> >> >
> >> > Anything that touches wireless drivers I defer to you, yes.
> >>
> >> Thanks, I'll take it then. Not sure why Sebastian was suggested to
> >> submit this patch via your tree in the first place.
> >>
> >> https://patchwork.kernel.org/patch/9713645/
> >
> > Thanks. The idea was to get into early 4.12-rc to avoid merge
> > conflicts in the droid 4 *.dts during 4.13 cycle. This strategy
> > obviously failed :)
> 
> First, I'm not sure why you combined everything. A maintainer can just
> as easily take a series as a single patch and we prefer binding doc,
> dts and driver changes all separate.
> 
> Second, the dts changes could go thru arm-soc and the driver change
> thru netdev. The binding doc can be thru either. There's no bisecting
> dependency and things shouldn't break. It just won't all work until
> you have both branches.

This is only true for new devices. WLAN for droid4 works at the
moment using incorrect compatible string. If *.dts is updated and
driver is not yet updated WLAN does not work. IMHO that is a
bisecting dependency.

It would have been fine to sneak the driver change into 4.12 and
queue the *.dts change in 4.13, though. IIRC Tony suggest to make
it one patch.

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply

* Re: [PATCH] cfg80211: Be able to set bss expire time at config stage.
From: Johannes Berg @ 2017-05-22 16:19 UTC (permalink / raw)
  To: Enric Balletbo i Serra, David S . Miller, linux-wireless
  Cc: netdev, linux-kernel, Dmitry Shmidt, helmut.schaa
In-Reply-To: <20170522160946.2057-1-enric.balletbo@collabora.com>

On Mon, 2017-05-22 at 18:09 +0200, Enric Balletbo i Serra wrote:
> The IEEE80211_SCAN_RESULT_EXPIRE value was modified several times in
> the
> past. Initially was set at 10 seconds (2a51931192), then increased at
> 15
> seconds (09f97e0fc4) and finally to 30 seconds (f9616e0f88) to cover
> the
> use case when a station is having heavy uplink traffic. On some
> devices,
> like Chromebooks, this value is decreased to 7 seconds to avoid stall
> results, and other devices prefer set to 15 seconds.
> 
> This simple patch tries to make the selection of this value a bit
> more
> flexible by being able to set the expire time at config stage. Most
> users
> can leave the default value set as 30 seconds, others can modify the
> value
> at config stage if they want lower or bigger values.

I'm not really all that convinced that we really need this - userspace
should just be using the flush thing more often, and then it doesn't
really matter.

However, maybe that doesn't really matter all that much.

But,

> +config CFG80211_SCAN_RESULT_EXPIRE
> +	int "Scan completion time" if CFG80211

That should have "if CFG80211 && EXPERT" or something like that - no
need to prompt everyone for it.

> +	rdev->scan_result_expire =
> CONFIG_CFG80211_SCAN_RESULT_EXPIRE;

This is completely pointless - no need to go through runtime like that.

> -#define IEEE80211_SCAN_RESULT_EXPIRE	(30 * HZ)

You can just use CONFIG_CFG80211_SCAN_RESULT_EXPIRE * HZ here.

> +	__cfg80211_bss_expire(rdev, jiffies - rdev-
> >scan_result_expire);

You also completely messed this up because it now depends on HZ.

johannes

^ permalink raw reply

* Re: New Coverity defect in BPF verifier
From: David Miller @ 2017-05-22 16:16 UTC (permalink / raw)
  To: stephen; +Cc: netdev
In-Reply-To: <20170522090512.38dbcefa@xeon-e3>


Stephen, if you had even lightly scanned netdev today, you can see
that we are discussing this already and there are at least two
patches proposed.

Thank you.

^ permalink raw reply

* Re: [PATCH net-next] net: socket: fix a typo in sockfd_lookup().
From: David Miller @ 2017-05-22 16:14 UTC (permalink / raw)
  To: rami.rosen; +Cc: netdev
In-Reply-To: <1495393958-9304-1-git-send-email-rami.rosen@intel.com>

From: Rami Rosen <rami.rosen@intel.com>
Date: Sun, 21 May 2017 22:12:38 +0300

> This patch fixes a typo in sockfd_lookup() in net/socket.c.
> 
> Signed-off-by: Rami Rosen <rami.rosen@intel.com>

Applied, thank you.

^ permalink raw reply

* Re: [PATCH net-next 0/4] net: Add extack for route add/delete failures
From: David Miller @ 2017-05-22 16:12 UTC (permalink / raw)
  To: dsahern; +Cc: netdev
In-Reply-To: <20170521161205.36720-1-dsahern@gmail.com>

From: David Ahern <dsahern@gmail.com>
Date: Sun, 21 May 2017 10:12:01 -0600

> Use the extack feature to improve error messages to user on route
> add and delete failures.

Looks good, series applied.

Thanks.

^ permalink raw reply

* Re: [PATCHv4] wlcore: add wl1285 compatible
From: Rob Herring @ 2017-05-22 16:11 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Kalle Valo, David Miller, Tony Lindgren, Marcel Holtmann,
	linux-wireless, linux-omap, linux-kernel@vger.kernel.org, netdev
In-Reply-To: <20170522152112.634mnsv65lryrmkp@earth>

On Mon, May 22, 2017 at 10:21 AM, Sebastian Reichel
<sebastian.reichel@collabora.co.uk> wrote:
> Hi,
>
> On Mon, May 22, 2017 at 05:44:24PM +0300, Kalle Valo wrote:
>> David Miller <davem@davemloft.net> writes:
>> > From: Kalle Valo <kvalo@codeaurora.org>
>> > Date: Mon, 22 May 2017 12:28:20 +0300
>> >
>> >> Sebastian Reichel <sebastian.reichel@collabora.co.uk> writes:
>> >>
>> >>> Motorola Droid 4 uses a WL1285C. With differences between the
>> >>> chips not being public let's add explicit binding for wl1285
>> >>> instead of relying on wl1283 being very similar.
>> >>>
>> >>> Reviewed-by: Rob Herring <robh@kernel.org>
>> >>> Acked-by: Kalle Valo <kvalo@codeaurora.org>
>> >>> Acked-by: Tony Lindgren <tony@atomide.com>
>> >>> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
>> >>> ---
>> >>> Hi Dave,
>> >>>
>> >>> I previously send this in two patches, but its hard to apply without
>> >>> requiring multiple kernel releases (the driver must be updated before
>> >>> the DTS change). Since the actual change is not very complex Marcel
>> >>> Holtmann & Tony Lindgren suggested, that I send this directly to you
>> >>> in a single patch for inclusion into 4.12. This also means, that the
>> >>> remaining series can be queued normally for 4.13.
>> >>
>> >> I noticed that Dave set this patch to Awaiting Upstream state on his
>> >> patchwork:
>> >>
>> >> https://patchwork.ozlabs.org/patch/759042/
>> >>
>> >> Which makes me suspect that he is waiting me to apply this (as I
>> >> normally apply wlcore patches). Dave, should I actually take this patch?
>> >> What do you prefer?
>> >
>> > Anything that touches wireless drivers I defer to you, yes.
>>
>> Thanks, I'll take it then. Not sure why Sebastian was suggested to
>> submit this patch via your tree in the first place.
>>
>> https://patchwork.kernel.org/patch/9713645/
>
> Thanks. The idea was to get into early 4.12-rc to avoid merge
> conflicts in the droid 4 *.dts during 4.13 cycle. This strategy
> obviously failed :)

First, I'm not sure why you combined everything. A maintainer can just
as easily take a series as a single patch and we prefer binding doc,
dts and driver changes all separate.

Second, the dts changes could go thru arm-soc and the driver change
thru netdev. The binding doc can be thru either. There's no bisecting
dependency and things shouldn't break. It just won't all work until
you have both branches.

Rob

^ permalink raw reply

* [PATCH] cfg80211: Be able to set bss expire time at config stage.
From: Enric Balletbo i Serra @ 2017-05-22 16:09 UTC (permalink / raw)
  To: Johannes Berg, David S . Miller,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Dmitry Shmidt,
	helmut.schaa-gM/Ye1E23mwN+BqQ9rBEUg

The IEEE80211_SCAN_RESULT_EXPIRE value was modified several times in the
past. Initially was set at 10 seconds (2a51931192), then increased at 15
seconds (09f97e0fc4) and finally to 30 seconds (f9616e0f88) to cover the
use case when a station is having heavy uplink traffic. On some devices,
like Chromebooks, this value is decreased to 7 seconds to avoid stall
results, and other devices prefer set to 15 seconds.

This simple patch tries to make the selection of this value a bit more
flexible by being able to set the expire time at config stage. Most users
can leave the default value set as 30 seconds, others can modify the value
at config stage if they want lower or bigger values.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
---
 net/wireless/Kconfig | 11 +++++++++++
 net/wireless/core.c  |  2 ++
 net/wireless/core.h  |  1 +
 net/wireless/scan.c  |  6 ++----
 4 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig
index 6c60612..2a54e28 100644
--- a/net/wireless/Kconfig
+++ b/net/wireless/Kconfig
@@ -29,6 +29,17 @@ config CFG80211
 
 	  When built as a module it will be called cfg80211.
 
+config CFG80211_SCAN_RESULT_EXPIRE
+	int "Scan completion time" if CFG80211
+	default 30
+	---help---
+	  This value is the time in seconds the mac80211 scan method needs
+	  to finish. An expiration time to 30 seconds should be sufficient
+	  for most cases but for some other cases we might be interested in
+	  tweak this value.
+
+	  If unsure, leave the default of 30.
+
 config NL80211_TESTMODE
 	bool "nl80211 testmode command"
 	depends on CFG80211
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 83ea164..2a5742c 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -499,6 +499,8 @@ struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv,
 
 	init_waitqueue_head(&rdev->dev_wait);
 
+	rdev->scan_result_expire = CONFIG_CFG80211_SCAN_RESULT_EXPIRE;
+
 	/*
 	 * Initialize wiphy parameters to IEEE 802.11 MIB default values.
 	 * Fragmentation and RTS threshold are disabled by default with the
diff --git a/net/wireless/core.h b/net/wireless/core.h
index 6e809325..6a8a164 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -72,6 +72,7 @@ struct cfg80211_registered_device {
 	struct rb_root bss_tree;
 	u32 bss_generation;
 	u32 bss_entries;
+	unsigned int scan_result_expire;
 	struct cfg80211_scan_request *scan_req; /* protected by RTNL */
 	struct sk_buff *scan_msg;
 	struct list_head sched_scan_req_list;
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 14d5f0c..f0b55a9 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -70,8 +70,6 @@ module_param(bss_entries_limit, int, 0644);
 MODULE_PARM_DESC(bss_entries_limit,
                  "limit to number of scan BSS entries (per wiphy, default 1000)");
 
-#define IEEE80211_SCAN_RESULT_EXPIRE	(30 * HZ)

^ permalink raw reply related

* Re: [PATCH net] sctp: fix ICMP processing if skb is non-linear
From: Davide Caratti @ 2017-05-22 16:09 UTC (permalink / raw)
  To: Xin Long, Marcelo Ricardo Leitner
  Cc: network dev, linux-sctp, David S. Miller
In-Reply-To: <CADvbK_c81ju-D6h4TLm5_Lxvkaiw69Lt9TXR3Z_8gOJpQdXpXQ@mail.gmail.com>

hello Xin Long,
On Sat, 2017-05-20 at 02:40 +0800, Xin Long wrote:
> On Fri, May 19, 2017 at 11:34 PM, Davide Caratti <dcaratti@redhat.com> wrote:
> > @@ -515,14 +515,23 @@ struct sock *sctp_err_lookup(struct net *net, int family, struct sk_buff *skb,
> >          * or the chunk type or the Initiate Tag does not match, silently
> >          * discard the packet.
> >          */
> > +       offset = skb_transport_offset(skb);
> > +       sctphdr = skb_header_pointer(skb, offset, sizeof(_sctphdr), &_sctphdr);
> > +       if (unlikely(!sctphdr))
> > +               goto out;
> > +
> > +       vtag = ntohl(sctphdr->vtag);
> >         if (vtag == 0) {
> > -               chunkhdr = (void *)sctphdr + sizeof(struct sctphdr);
> > -               if (len < sizeof(struct sctphdr) + sizeof(sctp_chunkhdr_t)
> > -                         + sizeof(__be32) ||
> > +               offset += sizeof(_sctphdr);
> 
> will be nice to delete this line, and use
> > +               /* chunk header + first 4 octects of init header */
> > +               chunkhdr = skb_header_pointer(skb, offset,
> 
> chunkhdr = skb_header_pointer(skb, offset + sizeof(_sctphdr), ;)
> wdyt?

that's right, 'offset' does not need the re-assignment: I will post the v2
soon. Thanks!

^ permalink raw reply

* Re: [PATCH net v2] bonding: fix accounting of active ports in 3ad
From: David Miller @ 2017-05-22 16:06 UTC (permalink / raw)
  To: jarod; +Cc: linux-kernel, j.vosburgh, vfalico, andy, netdev
In-Reply-To: <20170519234345.44721-1-jarod@redhat.com>

From: Jarod Wilson <jarod@redhat.com>
Date: Fri, 19 May 2017 19:43:45 -0400

> As of 7bb11dc9f59d and 0622cab0341c, bond slaves in a 3ad bond are not
> removed from the aggregator when they are down, and the active slave count
> is NOT equal to number of ports in the aggregator, but rather the number
> of ports in the aggregator that are still enabled. The sysfs spew for
> bonding_show_ad_num_ports() has a comment that says "Show number of active
> 802.3ad ports.", but it's currently showing total number of ports, both
> active and inactive. Remedy it by using the same logic introduced in
> 0622cab0341c in __bond_3ad_get_active_agg_info(), so sysfs, procfs and
> netlink all report the number of active ports. Note that this means that
> IFLA_BOND_AD_INFO_NUM_PORTS really means NUM_ACTIVE_PORTS instead of
> NUM_PORTS, and thus perhaps should be renamed for clarity.
> 
> Lightly tested on a dual i40e lacp bond, simulating link downs with an ip
> link set dev <slave2> down, was able to produce the state where I could
> see both in the same aggregator, but a number of ports count of 1.
 ...
> Signed-off-by: Jarod Wilson <jarod@redhat.com>
> ---
> v2: fix incorrect git sha reference, add more testing data

Applied and queued up for -stable, thanks Jarod!

^ permalink raw reply

* Re: [PATCH] net: atheros: atl2: don't return zero on failure path in atl2_probe()
From: David Miller @ 2017-05-22 16:05 UTC (permalink / raw)
  To: khoroshilov; +Cc: jcliburn, chris.snook, netdev, linux-kernel, ldv-project
In-Reply-To: <1495234331-27615-1-git-send-email-khoroshilov@ispras.ru>

From: Alexey Khoroshilov <khoroshilov@ispras.ru>
Date: Sat, 20 May 2017 01:52:11 +0300

> If dma mask checks fail in atl2_probe(), it breaks off initialization,
> deallocates all resources, but returns zero.
> 
> The patch adds proper error code return value and
> make error code setup unified.
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>

Looks good, applied, thanks.

^ permalink raw reply

* New Coverity defect in BPF verifier
From: Stephen Hemminger @ 2017-05-22 16:05 UTC (permalink / raw)
  To: David Miller; +Cc: netdev



Date: Mon, 22 May 2017 04:40:24 -0700
From: scan-admin@coverity.com
To: stephen@networkplumber.org
Subject: New Defects reported by Coverity Scan for Linux


Hi,

Please find the latest report on new defect(s) introduced to Linux found with Coverity Scan.

1 new defect(s) introduced to Linux found with Coverity Scan.
17 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)


** CID 1409762:  Control flow issues  (DEADCODE)
/kernel/bpf/verifier.c: 815 in check_pkt_ptr_alignment()


________________________________________________________________________________________________________
*** CID 1409762:  Control flow issues  (DEADCODE)
/kernel/bpf/verifier.c: 815 in check_pkt_ptr_alignment()
809     	}
810     
811     	/* skb->data is NET_IP_ALIGN-ed, but for strict alignment checking
812     	 * we force this to 2 which is universally what architectures use
813     	 * when they don't set CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS.
814     	 */
>>>     CID 1409762:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach the expression "0" inside this statement: "ip_align = (strict ? 2 : 0);".  
815     	ip_align = strict ? 2 : NET_IP_ALIGN;
816     	if ((ip_align + reg_off + off) % size != 0) {
817     		verbose("misaligned packet access off %d+%d+%d size %d\n",
818     			ip_align, reg_off, off, size);
819     		return -EACCES;
820     	}

^ permalink raw reply

* Re: [PATCH net-next] macsec: double accounting of dropped rx/tx packets
From: David Miller @ 2017-05-22 15:55 UTC (permalink / raw)
  To: girish.moodalbail; +Cc: netdev, sd
In-Reply-To: <1495232744-17075-1-git-send-email-girish.moodalbail@oracle.com>

From: Girish Moodalbail <girish.moodalbail@oracle.com>
Date: Fri, 19 May 2017 15:25:44 -0700

> The macsec implementation shouldn't account for rx/tx packets that are
> dropped in the netdev framework. The netdev framework itself accounts
> for such packets by atomically updating struct net_device`rx_dropped and
> struct net_device`tx_dropped fields. Later on when the stats for macsec
> link is retrieved, the packets dropped in netdev framework will be
> included in dev_get_stats() after calling macsec.c`macsec_get_stats64()
> 
> Signed-off-by: Girish Moodalbail <girish.moodalbail@oracle.com>

This looks correct to me.

Applied, thank you.

^ permalink raw reply

* Re: [RFC V1 1/1] net: cdc_ncm: Reduce memory use when kernel memory low
From: David Miller @ 2017-05-22 15:54 UTC (permalink / raw)
  To: jim_baxter; +Cc: bjorn, linux-usb, netdev, linux-kernel, oliver
In-Reply-To: <04bc5b49-9282-a6ca-2b95-fb8fc9750555@mentor.com>

From: "Baxter, Jim" <jim_baxter@mentor.com>
Date: Mon, 22 May 2017 16:45:42 +0100

> From: David S. Miller (davem@davemloft.net)
> Sent: Wed, 17 May 2017 14:18:19 -0400 
> 
>> 
>> When there isn't memory pressure this will hurt performance of
>> course.
>> 
>> It is a quite common paradigm to back down to 0 order memory requests
>> when higher order ones fail, so this isn't such a bad change from the
>> perspective.
>> 
>> However, one negative about it is that when the system is under memory
>> stress it doesn't help at all to keep attemping high order allocations
>> when the system hasn't recovered yet.  In fact, this can make it
>> worse.
>> 
> 
> Do you think the patch should be modified to extend the length of time
> the 0 order memory requests with a time period of 1 minute for example?
> 
> Or do you feel the patch is not the correct way this should be performed?

Unfortunately without a real notifier of some sort (there isn't one, and
it isn't actually easy to come up with a clean way to do this which is
probably why it doesn't exist yet in the first place) I really cannot
recommend anything better.

That being said, probably for the time being we should just backoff each
and every request, always trying initially to do the higher order thing.

^ permalink raw reply

* Re: [PATCH net] ipv6: fix out of bound writes in __ip6_append_data()
From: David Miller @ 2017-05-22 15:48 UTC (permalink / raw)
  To: eric.dumazet; +Cc: andreyknvl, edumazet, idaifish, netdev
In-Reply-To: <1495228668.6465.44.camel@edumazet-glaptop3.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 19 May 2017 14:17:48 -0700

> From: Eric Dumazet <edumazet@google.com>
> 
> Andrey Konovalov and idaifish@gmail.com reported crashes caused by
> one skb shared_info being overwritten from __ip6_append_data()
> 
> Andrey program lead to following state :
> 
> copy -4200 datalen 2000 fraglen 2040 
> maxfraglen 2040 alloclen 2048 transhdrlen 0 offset 0 fraggap 6200
> 
> The skb_copy_and_csum_bits(skb_prev, maxfraglen, data + transhdrlen,
> fraggap, 0); is overwriting skb->head and skb_shared_info
> 
> Since we apparently detect this rare condition too late, move the
> code earlier to even avoid allocating skb and risking crashes.
> 
> Once again, many thanks to Andrey and syzkaller team.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: Andrey Konovalov <andreyknvl@google.com>
> Tested-by: Andrey Konovalov <andreyknvl@google.com>
> Reported-by: <idaifish@gmail.com>

Looks good, applied and queued up for -stable.

Thanks Eric.

^ permalink raw reply

* Re: [RFC V1 1/1] net: cdc_ncm: Reduce memory use when kernel memory low
From: Baxter, Jim @ 2017-05-22 15:45 UTC (permalink / raw)
  To: David Miller, bjorn; +Cc: linux-usb, netdev, linux-kernel, oliver
In-Reply-To: <20170517.141819.1307166900606639947.davem@davemloft.net>

From: David S. Miller (davem@davemloft.net)
Sent: Wed, 17 May 2017 14:18:19 -0400 

> 
> When there isn't memory pressure this will hurt performance of
> course.
> 
> It is a quite common paradigm to back down to 0 order memory requests
> when higher order ones fail, so this isn't such a bad change from the
> perspective.
> 
> However, one negative about it is that when the system is under memory
> stress it doesn't help at all to keep attemping high order allocations
> when the system hasn't recovered yet.  In fact, this can make it
> worse.
> 

Hello David,

Do you think the patch should be modified to extend the length of time
the 0 order memory requests with a time period of 1 minute for example?

Or do you feel the patch is not the correct way this should be performed?

Best regards,
Jim

^ permalink raw reply

* Inconsistency in ipv4/tcp_input regarding sequence number acceptability condition
From: Paul Fiterau Brostean @ 2017-05-22 15:24 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 2050 bytes --]

Hello esteemed Linux Developers,

My name is Paul, I am a PhD student. I sent a different question a while 
back to the netdev mailing list, and never got a response. This question 
should be a lot easier to address. While doing experiments on the Linux 
TCP stack as part of a research project, I have stumbled upon a 
potential inconsistency with the RFC specification.

The Linux TCP stack considers a received sequence number as in-window or 
acceptable, if the sequence number of the segment is between the 
expected sequence number and the expected sequence number plus the size 
of the receive window. Naturally, the lower bound is included in the 
range. What's a bit weird is that the upper bound of this range is also 
considered in-window. This is evident both from my experiments and from 
the code 
(http://elixir.free-electrons.com/linux/v4.11/source/net/ipv4/tcp_input.c#L3985).

The RFC states that the upper bound shouldn't be considered. If we look 
at: https://tools.ietf.org/html/rfc793#page-26  the acceptability 
conditions exclude  RCV.NXT+RCV.WND (where applicable). Is there a 
reason for Linux including the upper bound? Or can this be fixed?

Analyzing FreeBSD, they seem to have adopted the RFC standard, and have 
not included the upper bound.


As an aside, my work involves automatic inference of models from 
software components. We obtained models for FreeBSD and Linux TCP 
clients and comparing them we were able to spot this minor difference. 
The models we can obtain automatically abstract away from many 
complexities (like timing, re-transmissions), and only consider socket 
calls and flags/seq/ack numbers (payloads are 0). I attached a Linux 
model to give you an example. If you look at the ESTABLISHED state, 
receiving a RST  segment (R), prompts the Linux system to respond with a 
challenge ACK segment (A) if the sequence number (p1) satisfies the 
condition: 'r1+win >=p1 && r1<p1' where 'r1' is the expected sequence 
number and 'win' is the receive window size.

Thanks for your attention, Paul.



[-- Attachment #2: linux_model.pdf --]
[-- Type: application/pdf, Size: 216985 bytes --]

^ permalink raw reply

* Re: ray_cs: Avoid reading past end of buffer
From: Kalle Valo @ 2017-05-22 15:27 UTC (permalink / raw)
  To: Kees Cook
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Daniel Micay
In-Reply-To: <20170505223841.GA20367@beast>

Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
> Using memcpy() from a buffer that is shorter than the length copied means
> the destination buffer is being filled with arbitrary data from the kernel
> rodata segment. In this case, the source was made longer, since it did not
> match the destination structure size. Additionally removes a needless cast.
> 
> This was found with the future CONFIG_FORTIFY_SOURCE feature.
> 
> Cc: Daniel Micay <danielmicay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

Patch applied to wireless-drivers-next.git, thanks.

e48d661eb13f ray_cs: Avoid reading past end of buffer

-- 
https://patchwork.kernel.org/patch/9714453/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply

* Re: [PATCHv4] wlcore: add wl1285 compatible
From: Kalle Valo @ 2017-05-22 15:26 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: David S. Miller, Sebastian Reichel, Tony Lindgren,
	Marcel Holtmann, Rob Herring, linux-wireless, linux-omap,
	linux-kernel, netdev, Sebastian Reichel
In-Reply-To: <20170505141553.2605-1-sebastian.reichel@collabora.co.uk>

Sebastian Reichel <sebastian.reichel@collabora.co.uk> wrote:
> Motorola Droid 4 uses a WL1285C. With differences between the
> chips not being public let's add explicit binding for wl1285
> instead of relying on wl1283 being very similar.
> 
> Reviewed-by: Rob Herring <robh@kernel.org>
> Acked-by: Kalle Valo <kvalo@codeaurora.org>
> Acked-by: Tony Lindgren <tony@atomide.com>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>

A note to patchwork: this is for 4.12

-- 
https://patchwork.kernel.org/patch/9713645/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply

* Re: [15/16] hostap: convert hostap_cmd_queue.usecnt from atomic_t to refcount_t
From: Kalle Valo @ 2017-05-22 15:24 UTC (permalink / raw)
  To: Elena Reshetova
  Cc: gregkh, peterz, matanb, paulus, Elena Reshetova, nbd, linux-rdma,
	saeedm, ganeshgr, Hans Liljestrand, David Windsor, keescook, j,
	ajk, leonro, matthias.bgg, linux-hams, linux-arm-kernel, blogic,
	netdev, yishaih, linux-wireless, linux-kernel, linux-ppp
In-Reply-To: <1490691403-4016-16-git-send-email-elena.reshetova@intel.com>

Elena Reshetova <elena.reshetova@intel.com> wrote:
> refcount_t type and corresponding API should be
> used instead of atomic_t when the variable is used as
> a reference counter. This allows to avoid accidental
> refcounter overflows that might lead to use-after-free
> situations.
> 
> Signed-off-by: Elena Reshetova <elena.reshetova@intel.com>
> Signed-off-by: Hans Liljestrand <ishkamiel@gmail.com>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> Signed-off-by: David Windsor <dwindsor@gmail.com>

2 patches applied to wireless-drivers-next.git, thanks.

552aa585faff hostap: convert hostap_cmd_queue.usecnt from atomic_t to refcount_t
0aeffa7041d8 orinoco_usb: convert request_context.refcount from atomic_t to refcount_t

-- 
https://patchwork.kernel.org/patch/9648427/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply

* Re: [15/16] hostap: convert hostap_cmd_queue.usecnt from atomic_t to refcount_t
From: Kalle Valo @ 2017-05-22 15:24 UTC (permalink / raw)
  To: Elena Reshetova
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	linux-hams-u79uwXL29TY76Z2rM5mHXA,
	linux-ppp-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	ganeshgr-ut6Up61K2wZBDgjK7y7TUQ, nbd-p3rKhJxN3npAfugRpC6u6w,
	blogic-p3rKhJxN3npAfugRpC6u6w,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
	yishaih-VPRAkNaXOzVWk0Htik3J/w, saeedm-VPRAkNaXOzVWk0Htik3J/w,
	matanb-VPRAkNaXOzVWk0Htik3J/w, leonro-VPRAkNaXOzVWk0Htik3J/w,
	ajk-iz34hMvxm2Hmj42eshorlhS11BummzK+,
	paulus-eUNUBHrolfbYtjvyW6yDsg, j, peterz-wEGCiKHe2LqWVfeAwA7xHQ,
	keescook-F7+t8E8rja9g9hUCZPvPmw,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, Elena Reshetova,
	Hans Liljestrand, David Windsor
In-Reply-To: <1490691403-4016-16-git-send-email-elena.reshetova-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Elena Reshetova <elena.reshetova-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote:
> refcount_t type and corresponding API should be
> used instead of atomic_t when the variable is used as
> a reference counter. This allows to avoid accidental
> refcounter overflows that might lead to use-after-free
> situations.
> 
> Signed-off-by: Elena Reshetova <elena.reshetova-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Hans Liljestrand <ishkamiel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> Signed-off-by: David Windsor <dwindsor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

2 patches applied to wireless-drivers-next.git, thanks.

552aa585faff hostap: convert hostap_cmd_queue.usecnt from atomic_t to refcount_t
0aeffa7041d8 orinoco_usb: convert request_context.refcount from atomic_t to refcount_t

-- 
https://patchwork.kernel.org/patch/9648427/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox