All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arend Van Spriel <arend.vanspriel@broadcom.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	Dmitry Shmidt <dimitrysh@google.com>
Subject: Re: [RFC] nl80211: allow multiple active scheduled scan requests
Date: Tue, 3 Jan 2017 13:25:34 +0100	[thread overview]
Message-ID: <ba1cb1a1-3d27-7421-47ea-a5625a886518@broadcom.com> (raw)
In-Reply-To: <1483353841.4596.2.camel@sipsolutions.net>

On 2-1-2017 11:44, Johannes Berg wrote:
> 
>> +	/*
>> +	 * allow only one legacy scheduled scan if user-space
>> +	 * does not indicate multiple scheduled scan support.
>> +	 */
>> +	if (!info->attrs[NL80211_ATTR_SCHED_SCAN_MULTI] &&
>> +	    cfg80211_legacy_sched_scan_active(rdev))
>>  		return -EINPROGRESS;
> 
> That probably doesn't go far enough - if legacy one is active then we
> probably shouldn't allow a new MULTI one either (or abandon the legacy
> one) so that older userspace doesn't get confused with multiple
> notifications from sched scans it didn't start.

I considered that although not taking the notifications into account.
Will change it. Abandoning the legacy one would be a behavioral change
so probably not acceptable, right?

>> +	if (rdev->sched_scan_req_count == rdev->wiphy.max_sched_scan_reqs)
>> +		return -ENOSPC;
> 
> Do we really want to do the double-accounting, just to avoid counting
> the list length here?

Ok. I have no strong preference.

>> +	/* leave request id zero for legacy request */
> 
> why? The ID would be ignored, so why special-case it?

It makes the function cfg80211_legacy_sched_scan_active() easier, ie.
not needing a is_legacy flag in struct cfg80211_sched_scan_request.

>> +static void cfg80211_del_sched_scan_req(struct
>> cfg80211_registered_device *rdev,
>> +					struct
>> cfg80211_sched_scan_request *req)
>> +{
>> +	list_del_rcu(&req->list);
>> +	kfree_rcu(req, rcu_head);
>> +	synchronize_rcu();
>> +	rdev->sched_scan_req_count--;
>> +}
> 
> That's bogus - either you use kfree_rcu() or synchronize_rcu() (the
> former is much better); combining both makes no sense.

Thanks. Both functions mentioned the rcu grace period so I was doubtful.
Will change it.

>> +bool cfg80211_legacy_sched_scan_active(struct
>> cfg80211_registered_device *rdev)
>> +{
>> +	struct cfg80211_sched_scan_request *req;
>> +
>> +	req = list_first_or_null_rcu(&rdev->sched_scan_req_list,
>> +				     struct
>> cfg80211_sched_scan_request, list);
>> +	/* request id 0 indicates legacy request in progress */
>> +	return req && !req->reqid;
>> +}
> 
> Ok, fair enough.

I guess your remark means this clarifies your earlier question about the
request id, right?

Regards,
Arend

  reply	other threads:[~2017-01-03 12:25 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-16 22:47 [PATCH] RFC: Universal scan proposal dimitrysh
2016-11-17 20:56 ` Arend Van Spriel
2016-11-18 23:53   ` Dmitry Shmidt
2016-11-22  7:24 ` Luca Coelho
2016-11-22 17:29   ` Dmitry Shmidt
2016-11-22 20:41     ` Arend Van Spriel
2016-11-22 20:54       ` Dmitry Shmidt
2016-11-23  8:43         ` Arend Van Spriel
2016-11-28 19:25           ` Dmitry Shmidt
2016-12-05 14:28 ` Johannes Berg
2016-12-05 18:32   ` Dmitry Shmidt
2016-12-07  6:44     ` Johannes Berg
2016-12-07 18:39       ` Dmitry Shmidt
2016-12-07 20:51         ` Arend Van Spriel
2016-12-08 22:35           ` Dmitry Shmidt
2016-12-09 11:10             ` Arend Van Spriel
2016-12-13 16:06             ` Johannes Berg
2017-01-03 20:45               ` Dmitry Shmidt
2017-01-04 13:28                 ` Johannes Berg
2017-01-04 20:32                   ` Dmitry Shmidt
2017-01-05 11:46                     ` Johannes Berg
2017-01-05 13:39                       ` Arend Van Spriel
2017-01-05 13:44                         ` Johannes Berg
2017-01-05 19:59                           ` Arend Van Spriel
2017-01-09 10:48                             ` Johannes Berg
2017-01-09 12:07                               ` Arend Van Spriel
2017-01-11 13:14                                 ` Johannes Berg
2017-01-05 20:45                       ` Dmitry Shmidt
2017-01-09 10:45                         ` Johannes Berg
2017-01-09 11:19                           ` Arend Van Spriel
2016-12-13 16:04         ` Johannes Berg
2016-12-21 10:20           ` [RFC] nl80211: allow multiple active scheduled scan requests Arend van Spriel
2017-01-02 10:44             ` Johannes Berg
2017-01-03 12:25               ` Arend Van Spriel [this message]
2017-01-04  9:59                 ` Johannes Berg
2017-01-04 10:20                   ` Arend Van Spriel
2017-01-04 10:30                     ` Johannes Berg
2017-01-04 10:34                       ` Arend Van Spriel

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=ba1cb1a1-3d27-7421-47ea-a5625a886518@broadcom.com \
    --to=arend.vanspriel@broadcom.com \
    --cc=dimitrysh@google.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.