All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marco Porsch <marco@cozybit.com>
To: devel@lists.open80211s.org
Cc: Thomas Pedersen <thomas@cozybit.com>,
	johannes@sipsolutions.net, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 1/3] mac80211: consolidate MBSS change notification
Date: Tue, 12 Feb 2013 18:56:36 +0100	[thread overview]
Message-ID: <511A8254.8060306@cozybit.com> (raw)
In-Reply-To: <1360616843-24618-1-git-send-email-thomas@cozybit.com>

On 02/11/2013 10:07 PM, Thomas Pedersen wrote:
> A few mesh utility functions will call
> ieee80211_bss_info_change_notify(), and then the caller
> might notify the driver of the same change again. Avoid
> this redundancy by propagating the BSS changes and
> generally calling bss_info_change_notify() once per
> change.
>
> Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
> ---
>   net/mac80211/cfg.c        |   19 +++++++++++--------
>   net/mac80211/mesh.c       |    2 +-
>   net/mac80211/mesh.h       |   10 +++++-----
>   net/mac80211/mesh_plink.c |   33 ++++++++++++++++++---------------
>   net/mac80211/mesh_ps.c    |   24 ++++++++++++++++++------
>   5 files changed, 53 insertions(+), 35 deletions(-)

[...]

> diff --git a/net/mac80211/mesh_ps.c b/net/mac80211/mesh_ps.c
> index b677962..aa83eac 100644
> --- a/net/mac80211/mesh_ps.c
> +++ b/net/mac80211/mesh_ps.c
> @@ -74,14 +74,17 @@ static void mps_qos_null_tx(struct sta_info *sta)
>    * @sdata: local mesh subif
>    *
>    * sets the non-peer power mode and triggers the driver PS (re-)configuration
> + * Return BSS_CHANGED_BEACON if a beacon update is necessary.
>    */
> -void ieee80211_mps_local_status_update(struct ieee80211_sub_if_data *sdata)
> +u32 ieee80211_mps_local_status_update(struct ieee80211_sub_if_data *sdata)
>   {
>   	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
>   	struct sta_info *sta;
>   	bool peering = false;
>   	int light_sleep_cnt = 0;
>   	int deep_sleep_cnt = 0;
> +	u32 changed = 0;
> +	enum nl80211_mesh_power_mode nonpeer_pm;
>
>   	rcu_read_lock();
>   	list_for_each_entry_rcu(sta, &sdata->local->sta_list, list) {
> @@ -115,17 +118,25 @@ void ieee80211_mps_local_status_update(struct ieee80211_sub_if_data *sdata)
>   	 */
>   	if (peering) {
>   		mps_dbg(sdata, "setting non-peer PM to active for peering\n");
> -		ifmsh->nonpeer_pm = NL80211_MESH_POWER_ACTIVE;
> +		nonpeer_pm = NL80211_MESH_POWER_ACTIVE;
>   	} else if (light_sleep_cnt || deep_sleep_cnt) {
>   		mps_dbg(sdata, "setting non-peer PM to deep sleep\n");
> -		ifmsh->nonpeer_pm = NL80211_MESH_POWER_DEEP_SLEEP;
> +		nonpeer_pm = NL80211_MESH_POWER_DEEP_SLEEP;
>   	} else {
>   		mps_dbg(sdata, "setting non-peer PM to user value\n");
> -		ifmsh->nonpeer_pm = ifmsh->mshcfg.power_mode;
> +		nonpeer_pm = ifmsh->mshcfg.power_mode;
>   	}
>
> +	if (ifmsh->nonpeer_pm != nonpeer_pm ||
> +	    ifmsh->ps_peers_light_sleep != light_sleep_cnt ||
> +	    ifmsh->ps_peers_deep_sleep != deep_sleep_cnt)
> +		changed = BSS_CHANGED_BEACON;

Here it only affects the beacon if the number of light/deep sleep peers 
changed from/to zero or non-zero.
The following should avoid some unnecessary updates:

!ifmsh->ps_peers_deep_sleep != !deep_sleep_cnt ||
!ifmsh->ps_peers_deep_sleep != !deep_sleep_cnt)

> +
> +	ifmsh->nonpeer_pm = nonpeer_pm;
>   	ifmsh->ps_peers_light_sleep = light_sleep_cnt;
>   	ifmsh->ps_peers_deep_sleep = deep_sleep_cnt;
> +
> +	return changed;
>   }
>
>   /**


  parent reply	other threads:[~2013-02-12 17:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-11 21:07 [PATCH 1/3] mac80211: consolidate MBSS change notification Thomas Pedersen
2013-02-11 21:07 ` [PATCH 2/3] mac80211: cache mesh beacon Thomas Pedersen
2013-02-11 21:17   ` Johannes Berg
2013-02-11 21:24     ` Thomas Pedersen
2013-02-11 21:34       ` Johannes Berg
2013-02-11 21:07 ` [PATCH 3/3] mac80211: generate mesh probe responses Thomas Pedersen
2013-02-11 21:20   ` Johannes Berg
2013-02-11 22:11     ` Thomas Pedersen
2013-02-12 17:56 ` Marco Porsch [this message]
2013-02-12 18:23   ` [PATCH 1/3] mac80211: consolidate MBSS change notification Thomas Pedersen

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=511A8254.8060306@cozybit.com \
    --to=marco@cozybit.com \
    --cc=devel@lists.open80211s.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=thomas@cozybit.com \
    /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.