* [PATCH v3] mac80211: add extra checking for RC init upon receiving mesh beacon
@ 2012-07-24 1:15 Chun-Yeow Yeoh
2012-07-24 3:11 ` Thomas Pedersen
0 siblings, 1 reply; 5+ messages in thread
From: Chun-Yeow Yeoh @ 2012-07-24 1:15 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes, devel, Chun-Yeow Yeoh
Rate control statistic is flushed whenever the mesh beacon
is received. This may not optimizes the performance of rate
control algorithm. This patch ensures that we return early
from mesh_peer_init if the plink_state is ESTAB. Thus, avoid
calling the rate_control_rate_init again for established mesh
STA.
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
---
v2: simplify the logic checking (Thomas Pedersen)
v3: updating the sta last rx activity (Thomas Pedersen)
net/mac80211/mesh_plink.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 4256859..4f5740e 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -360,6 +360,12 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
}
spin_lock_bh(&sta->lock);
+ if (sta->plink_state == NL80211_PLINK_ESTAB) {
+ sta->last_rx = jiffies;
+ spin_unlock_bh(&sta->lock);
+ return sta;
+ }
+
sta->last_rx = jiffies;
sta->sta.supp_rates[band] = rates;
if (elems->ht_cap_elem &&
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v3] mac80211: add extra checking for RC init upon receiving mesh beacon
2012-07-24 1:15 [PATCH v3] mac80211: add extra checking for RC init upon receiving mesh beacon Chun-Yeow Yeoh
@ 2012-07-24 3:11 ` Thomas Pedersen
2012-07-24 3:40 ` Yeoh Chun-Yeow
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Pedersen @ 2012-07-24 3:11 UTC (permalink / raw)
To: devel; +Cc: linux-wireless, johannes
Chun-Yeow,
On Mon, Jul 23, 2012 at 6:15 PM, Chun-Yeow Yeoh <yeohchunyeow@gmail.com> wrote:
> Rate control statistic is flushed whenever the mesh beacon
> is received. This may not optimizes the performance of rate
> control algorithm. This patch ensures that we return early
> from mesh_peer_init if the plink_state is ESTAB. Thus, avoid
> calling the rate_control_rate_init again for established mesh
> STA.
>
> Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
> ---
> v2: simplify the logic checking (Thomas Pedersen)
> v3: updating the sta last rx activity (Thomas Pedersen)
>
> net/mac80211/mesh_plink.c | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
> index 4256859..4f5740e 100644
> --- a/net/mac80211/mesh_plink.c
> +++ b/net/mac80211/mesh_plink.c
> @@ -360,6 +360,12 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
> }
>
> spin_lock_bh(&sta->lock);
> + if (sta->plink_state == NL80211_PLINK_ESTAB) {
> + sta->last_rx = jiffies;
> + spin_unlock_bh(&sta->lock);
> + return sta;
> + }
> +
> sta->last_rx = jiffies;
You should avoid duplicating this assignment.
Thomas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3] mac80211: add extra checking for RC init upon receiving mesh beacon
2012-07-24 3:11 ` Thomas Pedersen
@ 2012-07-24 3:40 ` Yeoh Chun-Yeow
2012-07-24 3:44 ` Julian Calaby
0 siblings, 1 reply; 5+ messages in thread
From: Yeoh Chun-Yeow @ 2012-07-24 3:40 UTC (permalink / raw)
To: devel, Thomas Pedersen; +Cc: johannes, linux-wireless
Hi, Thomas
>> sta->last_rx = jiffies;
>
> You should avoid duplicating this assignment.
I think that we should also update the sta->last_rx if the
sta->plink_state is not NL80211_PLINK_ESTAB, am I right?
Please advice. Thanks
Regards,
Chun-Yeow
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3] mac80211: add extra checking for RC init upon receiving mesh beacon
2012-07-24 3:40 ` Yeoh Chun-Yeow
@ 2012-07-24 3:44 ` Julian Calaby
2012-07-24 3:47 ` Yeoh Chun-Yeow
0 siblings, 1 reply; 5+ messages in thread
From: Julian Calaby @ 2012-07-24 3:44 UTC (permalink / raw)
To: Yeoh Chun-Yeow; +Cc: devel, Thomas Pedersen, johannes, linux-wireless
Hi Chun-Yeow,
On Tue, Jul 24, 2012 at 1:40 PM, Yeoh Chun-Yeow <yeohchunyeow@gmail.com> wrote:
> Hi, Thomas
>
>>> sta->last_rx = jiffies;
>>
>> You should avoid duplicating this assignment.
>
> I think that we should also update the sta->last_rx if the
> sta->plink_state is not NL80211_PLINK_ESTAB, am I right?
The point Thomas is making is that this assignment happens both when
the if statement's condition is true and when it's false.
So you could remove it from the if statement and move the one that's
after the if statement above the if statement and the code would be
functionally equivalent and cleaner.
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3] mac80211: add extra checking for RC init upon receiving mesh beacon
2012-07-24 3:44 ` Julian Calaby
@ 2012-07-24 3:47 ` Yeoh Chun-Yeow
0 siblings, 0 replies; 5+ messages in thread
From: Yeoh Chun-Yeow @ 2012-07-24 3:47 UTC (permalink / raw)
To: Julian Calaby; +Cc: devel, Thomas Pedersen, johannes, linux-wireless
Hi, Julian
> So you could remove it from the if statement and move the one that's
> after the if statement above the if statement and the code would be
> functionally equivalent and cleaner.
Noted. Thanks
Regards,
Chun-Yeow
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-07-24 3:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-24 1:15 [PATCH v3] mac80211: add extra checking for RC init upon receiving mesh beacon Chun-Yeow Yeoh
2012-07-24 3:11 ` Thomas Pedersen
2012-07-24 3:40 ` Yeoh Chun-Yeow
2012-07-24 3:44 ` Julian Calaby
2012-07-24 3:47 ` Yeoh Chun-Yeow
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.