linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.26 1/3] iwlwifi: fix in-column rate scaling
@ 2008-05-27  3:29 Zhu Yi
  2008-05-27  3:29 ` [PATCH 2.6.26 2/3] iwlwifi: fix exit from stay_in_table state Zhu Yi
  2008-05-28 20:22 ` [PATCH 2.6.26 1/3] iwlwifi: fix in-column rate scaling John W. Linville
  0 siblings, 2 replies; 7+ messages in thread
From: Zhu Yi @ 2008-05-27  3:29 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Guy Cohen, Tomas Winkler

From: Guy Cohen <guy.cohen@intel.com>

This patch fixes cases that the code raised or didn't decrease
the rate although the success ratio was not good.

Signed-off-by: Guy Cohen <guy.cohen@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-4965-rs.c |   45 ++++++++++++++-------------
 1 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index 2adc228..fa41ed1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -1339,7 +1339,7 @@ static int rs_move_legacy_other(struct iwl_priv *priv,
 				lq_sta->search_better_tbl = 1;
 				goto out;
 			}
-
+			break;
 		case IWL_LEGACY_SWITCH_SISO:
 			IWL_DEBUG_RATE("LQ: Legacy switch to SISO\n");
 
@@ -1425,9 +1425,9 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,
 				lq_sta->search_better_tbl = 1;
 				goto out;
 			}
-
+			break;
 		case IWL_SISO_SWITCH_MIMO2:
-			IWL_DEBUG_RATE("LQ: SISO switch to MIMO\n");
+			IWL_DEBUG_RATE("LQ: SISO switch to MIMO2\n");
 			memcpy(search_tbl, tbl, sz);
 			search_tbl->is_SGI = 0;
 			search_tbl->ant_type = ANT_AB; /*FIXME:RS*/
@@ -1692,6 +1692,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
 	u8 active_tbl = 0;
 	u8 done_search = 0;
 	u16 high_low;
+	s32 sr;
 #ifdef CONFIG_IWL4965_HT
 	u8 tid = MAX_TID_COUNT;
 #endif
@@ -1867,6 +1868,8 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
 	low = high_low & 0xff;
 	high = (high_low >> 8) & 0xff;
 
+	sr = window->success_ratio;
+
 	/* Collect measured throughputs for current and adjacent rates */
 	current_tpt = window->average_tpt;
 	if (low != IWL_RATE_INVALID)
@@ -1874,19 +1877,22 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
 	if (high != IWL_RATE_INVALID)
 		high_tpt = tbl->win[high].average_tpt;
 
-	/* Assume rate increase */
-	scale_action = 1;
+	scale_action = 0;
 
 	/* Too many failures, decrease rate */
-	if ((window->success_ratio <= IWL_RATE_DECREASE_TH) ||
-	    (current_tpt == 0)) {
+	if ((sr <= IWL_RATE_DECREASE_TH) || (current_tpt == 0)) {
 		IWL_DEBUG_RATE("decrease rate because of low success_ratio\n");
 		scale_action = -1;
 
 	/* No throughput measured yet for adjacent rates; try increase. */
 	} else if ((low_tpt == IWL_INVALID_VALUE) &&
-		   (high_tpt == IWL_INVALID_VALUE))
-		scale_action = 1;
+		   (high_tpt == IWL_INVALID_VALUE)) {
+
+		if (high != IWL_RATE_INVALID && sr >= IWL_RATE_INCREASE_TH)
+			scale_action = 1;
+		else if (low != IWL_RATE_INVALID)
+			scale_action = -1;
+	}
 
 	/* Both adjacent throughputs are measured, but neither one has better
 	 * throughput; we're using the best rate, don't change it! */
@@ -1902,9 +1908,10 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
 		/* Higher adjacent rate's throughput is measured */
 		if (high_tpt != IWL_INVALID_VALUE) {
 			/* Higher rate has better throughput */
-			if (high_tpt > current_tpt)
+			if (high_tpt > current_tpt &&
+					sr >= IWL_RATE_INCREASE_TH) {
 				scale_action = 1;
-			else {
+			} else {
 				IWL_DEBUG_RATE
 				    ("decrease rate because of high tpt\n");
 				scale_action = -1;
@@ -1917,23 +1924,17 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
 				IWL_DEBUG_RATE
 				    ("decrease rate because of low tpt\n");
 				scale_action = -1;
-			} else
+			} else if (sr >= IWL_RATE_INCREASE_TH) {
 				scale_action = 1;
+			}
 		}
 	}
 
 	/* Sanity check; asked for decrease, but success rate or throughput
 	 * has been good at old rate.  Don't change it. */
-	if (scale_action == -1) {
-		if ((low != IWL_RATE_INVALID) &&
-		    ((window->success_ratio > IWL_RATE_HIGH_TH) ||
+	if ((scale_action == -1) && (low != IWL_RATE_INVALID) &&
+		    ((sr > IWL_RATE_HIGH_TH) ||
 		     (current_tpt > (100 * tbl->expected_tpt[low]))))
-			scale_action = 0;
-
-	/* Sanity check; asked for increase, but success rate has not been great
-	 * even at old rate, higher rate will be worse.  Don't change it. */
-	} else if ((scale_action == 1) &&
-		   (window->success_ratio < IWL_RATE_INCREASE_TH))
 		scale_action = 0;
 
 	switch (scale_action) {
@@ -1962,7 +1963,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
 		    "high %d type %d\n",
 		     index, scale_action, low, high, tbl->lq_type);
 
- lq_update:
+lq_update:
 	/* Replace uCode's rate table for the destination station. */
 	if (update_lq) {
 		rate = rate_n_flags_from_tbl(tbl, index, is_green);
-- 
1.5.3.6


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

* [PATCH 2.6.26 2/3] iwlwifi: fix exit from stay_in_table state
  2008-05-27  3:29 [PATCH 2.6.26 1/3] iwlwifi: fix in-column rate scaling Zhu Yi
@ 2008-05-27  3:29 ` Zhu Yi
  2008-05-27  3:29   ` [PATCH 2.6.26 3/3] iwlwifi: fix rate scale TLC column selection bug Zhu Yi
  2008-05-28 20:22 ` [PATCH 2.6.26 1/3] iwlwifi: fix in-column rate scaling John W. Linville
  1 sibling, 1 reply; 7+ messages in thread
From: Zhu Yi @ 2008-05-27  3:29 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Guy Cohen, Tomas Winkler

From: Guy Cohen <guy.cohen@intel.com>

When exiting from stay in table state (e.g. timer expiration),
all the statistics are reset and the RS flow should not continue
but only after enough statistics are collected again.

Signed-off-by: Guy Cohen <guy.cohen@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-4965-rs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index fa41ed1..838db19 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -1980,7 +1980,7 @@ lq_update:
 	 * 2)  Not just finishing up a search
 	 * 3)  Allowing a new search
 	 */
-	if (!update_lq && !done_search && !lq_sta->stay_in_tbl) {
+	if (!update_lq && !done_search && !lq_sta->stay_in_tbl && window->counter) {
 		/* Save current throughput to compare with "search" throughput*/
 		lq_sta->last_tpt = current_tpt;
 
-- 
1.5.3.6


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

* [PATCH 2.6.26 3/3] iwlwifi: fix rate scale TLC column selection bug
  2008-05-27  3:29 ` [PATCH 2.6.26 2/3] iwlwifi: fix exit from stay_in_table state Zhu Yi
@ 2008-05-27  3:29   ` Zhu Yi
  0 siblings, 0 replies; 7+ messages in thread
From: Zhu Yi @ 2008-05-27  3:29 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Guy Cohen, Tomas Winkler

From: Guy Cohen <guy.cohen@intel.com>

This patch fixes a case that a wrong maximal rate is selected when
searching for better configurations.

Signed-off-by: Guy Cohen <guy.cohen@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-4965-rs.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index 838db19..d0ae0cb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -1148,7 +1148,6 @@ static s32 rs_get_best_rate(struct iwl_priv *priv,
 
 			/* Higher rate not available, use the original */
 			} else {
-				new_rate = rate;
 				break;
 			}
 		}
-- 
1.5.3.6


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

* Re: [PATCH 2.6.26 1/3] iwlwifi: fix in-column rate scaling
  2008-05-27  3:29 [PATCH 2.6.26 1/3] iwlwifi: fix in-column rate scaling Zhu Yi
  2008-05-27  3:29 ` [PATCH 2.6.26 2/3] iwlwifi: fix exit from stay_in_table state Zhu Yi
@ 2008-05-28 20:22 ` John W. Linville
  2008-05-29  2:02   ` Zhu Yi
  1 sibling, 1 reply; 7+ messages in thread
From: John W. Linville @ 2008-05-28 20:22 UTC (permalink / raw)
  To: Zhu Yi; +Cc: linux-wireless, Guy Cohen, Tomas Winkler

On Tue, May 27, 2008 at 11:29:33AM +0800, Zhu Yi wrote:
> From: Guy Cohen <guy.cohen@intel.com>
> 
> This patch fixes cases that the code raised or didn't decrease
> the rate although the success ratio was not good.
> 
> Signed-off-by: Guy Cohen <guy.cohen@intel.com>
> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> ---
>  drivers/net/wireless/iwlwifi/iwl-4965-rs.c |   45 ++++++++++++++-------------
>  1 files changed, 23 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
> index 2adc228..fa41ed1 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
> @@ -1339,7 +1339,7 @@ static int rs_move_legacy_other(struct iwl_priv *priv,
>  				lq_sta->search_better_tbl = 1;
>  				goto out;
>  			}
> -
> +			break;
>  		case IWL_LEGACY_SWITCH_SISO:
>  			IWL_DEBUG_RATE("LQ: Legacy switch to SISO\n");
>  
> @@ -1425,9 +1425,9 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,
>  				lq_sta->search_better_tbl = 1;
>  				goto out;
>  			}
> -
> +			break;
>  		case IWL_SISO_SWITCH_MIMO2:
> -			IWL_DEBUG_RATE("LQ: SISO switch to MIMO\n");
> +			IWL_DEBUG_RATE("LQ: SISO switch to MIMO2\n");
>  			memcpy(search_tbl, tbl, sz);
>  			search_tbl->is_SGI = 0;
>  			search_tbl->ant_type = ANT_AB; /*FIXME:RS*/

These hunks don't apply to wireless-2.6.

-- 
John W. Linville
linville@tuxdriver.com

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

* Re: [PATCH 2.6.26 1/3] iwlwifi: fix in-column rate scaling
  2008-05-28 20:22 ` [PATCH 2.6.26 1/3] iwlwifi: fix in-column rate scaling John W. Linville
@ 2008-05-29  2:02   ` Zhu Yi
  2008-05-29  7:05     ` Tomas Winkler
  0 siblings, 1 reply; 7+ messages in thread
From: Zhu Yi @ 2008-05-29  2:02 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, Guy Cohen, Tomas Winkler

On Wed, 2008-05-28 at 16:22 -0400, John W. Linville wrote:
> On Tue, May 27, 2008 at 11:29:33AM +0800, Zhu Yi wrote:
> > From: Guy Cohen <guy.cohen@intel.com>
> > 
> > This patch fixes cases that the code raised or didn't decrease
> > the rate although the success ratio was not good.
> > 
> > Signed-off-by: Guy Cohen <guy.cohen@intel.com>
> > Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> > ---
> >  drivers/net/wireless/iwlwifi/iwl-4965-rs.c |   45 ++++++++++++++-------------
> >  1 files changed, 23 insertions(+), 22 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
> > index 2adc228..fa41ed1 100644
> > --- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
> > +++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
> > @@ -1339,7 +1339,7 @@ static int rs_move_legacy_other(struct iwl_priv *priv,
> >  				lq_sta->search_better_tbl = 1;
> >  				goto out;
> >  			}
> > -
> > +			break;
> >  		case IWL_LEGACY_SWITCH_SISO:
> >  			IWL_DEBUG_RATE("LQ: Legacy switch to SISO\n");
> >  
> > @@ -1425,9 +1425,9 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,
> >  				lq_sta->search_better_tbl = 1;
> >  				goto out;
> >  			}
> > -
> > +			break;
> >  		case IWL_SISO_SWITCH_MIMO2:
> > -			IWL_DEBUG_RATE("LQ: SISO switch to MIMO\n");
> > +			IWL_DEBUG_RATE("LQ: SISO switch to MIMO2\n");
> >  			memcpy(search_tbl, tbl, sz);
> >  			search_tbl->is_SGI = 0;
> >  			search_tbl->ant_type = ANT_AB; /*FIXME:RS*/
> 
> These hunks don't apply to wireless-2.6.

Oops, please ignore these hunks.

Thanks,
-yi


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

* Re: [PATCH 2.6.26 1/3] iwlwifi: fix in-column rate scaling
  2008-05-29  2:02   ` Zhu Yi
@ 2008-05-29  7:05     ` Tomas Winkler
  2008-05-30 15:04       ` John W. Linville
  0 siblings, 1 reply; 7+ messages in thread
From: Tomas Winkler @ 2008-05-29  7:05 UTC (permalink / raw)
  To: John W. Linville, Zhu Yi; +Cc: linux-wireless, Guy Cohen

On Thu, May 29, 2008 at 5:02 AM, Zhu Yi <yi.zhu@intel.com> wrote:
> On Wed, 2008-05-28 at 16:22 -0400, John W. Linville wrote:
>> On Tue, May 27, 2008 at 11:29:33AM +0800, Zhu Yi wrote:
>> > From: Guy Cohen <guy.cohen@intel.com>
>> >
>> > This patch fixes cases that the code raised or didn't decrease
>> > the rate although the success ratio was not good.
>> >
>> > Signed-off-by: Guy Cohen <guy.cohen@intel.com>
>> > Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
>> > ---
>> >  drivers/net/wireless/iwlwifi/iwl-4965-rs.c |   45 ++++++++++++++-------------
>> >  1 files changed, 23 insertions(+), 22 deletions(-)
>> >
>> > diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
>> > index 2adc228..fa41ed1 100644
>> > --- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
>> > +++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
>> > @@ -1339,7 +1339,7 @@ static int rs_move_legacy_other(struct iwl_priv *priv,
>> >                             lq_sta->search_better_tbl = 1;
>> >                             goto out;
>> >                     }
>> > -
>> > +                   break;
>> >             case IWL_LEGACY_SWITCH_SISO:
>> >                     IWL_DEBUG_RATE("LQ: Legacy switch to SISO\n");
>> >
>> > @@ -1425,9 +1425,9 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,
>> >                             lq_sta->search_better_tbl = 1;
>> >                             goto out;
>> >                     }
>> > -
>> > +                   break;
>> >             case IWL_SISO_SWITCH_MIMO2:
>> > -                   IWL_DEBUG_RATE("LQ: SISO switch to MIMO\n");
>> > +                   IWL_DEBUG_RATE("LQ: SISO switch to MIMO2\n");
>> >                     memcpy(search_tbl, tbl, sz);
>> >                     search_tbl->is_SGI = 0;
>> >                     search_tbl->ant_type = ANT_AB; /*FIXME:RS*/
>>
>> These hunks don't apply to wireless-2.6.
>
> Oops, please ignore these hunks.
>

I think you've missed this one 'iwlwifi: don't switch to SGI if not
supported by AP'
This is actually real connectivity bug fix. Without this client will
fail to talk to AP that doesn't support SGI and there are many of
those.

Thanks
Tomas

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

* Re: [PATCH 2.6.26 1/3] iwlwifi: fix in-column rate scaling
  2008-05-29  7:05     ` Tomas Winkler
@ 2008-05-30 15:04       ` John W. Linville
  0 siblings, 0 replies; 7+ messages in thread
From: John W. Linville @ 2008-05-30 15:04 UTC (permalink / raw)
  To: Tomas Winkler; +Cc: Zhu Yi, linux-wireless, Guy Cohen

On Thu, May 29, 2008 at 10:05:01AM +0300, Tomas Winkler wrote:
> On Thu, May 29, 2008 at 5:02 AM, Zhu Yi <yi.zhu@intel.com> wrote:
> > On Wed, 2008-05-28 at 16:22 -0400, John W. Linville wrote:
> >> On Tue, May 27, 2008 at 11:29:33AM +0800, Zhu Yi wrote:
> >> > From: Guy Cohen <guy.cohen@intel.com>
> >> >
> >> > This patch fixes cases that the code raised or didn't decrease
> >> > the rate although the success ratio was not good.
> >> >
> >> > Signed-off-by: Guy Cohen <guy.cohen@intel.com>
> >> > Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> >> > ---
> >> >  drivers/net/wireless/iwlwifi/iwl-4965-rs.c |   45 ++++++++++++++-------------
> >> >  1 files changed, 23 insertions(+), 22 deletions(-)
> >> >
> >> > diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
> >> > index 2adc228..fa41ed1 100644
> >> > --- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
> >> > +++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
> >> > @@ -1339,7 +1339,7 @@ static int rs_move_legacy_other(struct iwl_priv *priv,
> >> >                             lq_sta->search_better_tbl = 1;
> >> >                             goto out;
> >> >                     }
> >> > -
> >> > +                   break;
> >> >             case IWL_LEGACY_SWITCH_SISO:
> >> >                     IWL_DEBUG_RATE("LQ: Legacy switch to SISO\n");
> >> >
> >> > @@ -1425,9 +1425,9 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,
> >> >                             lq_sta->search_better_tbl = 1;
> >> >                             goto out;
> >> >                     }
> >> > -
> >> > +                   break;
> >> >             case IWL_SISO_SWITCH_MIMO2:
> >> > -                   IWL_DEBUG_RATE("LQ: SISO switch to MIMO\n");
> >> > +                   IWL_DEBUG_RATE("LQ: SISO switch to MIMO2\n");
> >> >                     memcpy(search_tbl, tbl, sz);
> >> >                     search_tbl->is_SGI = 0;
> >> >                     search_tbl->ant_type = ANT_AB; /*FIXME:RS*/
> >>
> >> These hunks don't apply to wireless-2.6.
> >
> > Oops, please ignore these hunks.
> >
> 
> I think you've missed this one 'iwlwifi: don't switch to SGI if not
> supported by AP'
> This is actually real connectivity bug fix. Without this client will
> fail to talk to AP that doesn't support SGI and there are many of
> those.

That patch was not identified for 2.6.26, and it looks like it won't
apply to 2.6.26 either.

Back to the original patch, I can ignore the hunks in question and
send it to 2.6.26, but then we'll need a new patch to apply those
hunks for 2.6.27.  Or, I can just delay this one for 2.6.27...?

John
-- 
John W. Linville
linville@tuxdriver.com

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

end of thread, other threads:[~2008-05-30 15:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-27  3:29 [PATCH 2.6.26 1/3] iwlwifi: fix in-column rate scaling Zhu Yi
2008-05-27  3:29 ` [PATCH 2.6.26 2/3] iwlwifi: fix exit from stay_in_table state Zhu Yi
2008-05-27  3:29   ` [PATCH 2.6.26 3/3] iwlwifi: fix rate scale TLC column selection bug Zhu Yi
2008-05-28 20:22 ` [PATCH 2.6.26 1/3] iwlwifi: fix in-column rate scaling John W. Linville
2008-05-29  2:02   ` Zhu Yi
2008-05-29  7:05     ` Tomas Winkler
2008-05-30 15:04       ` John W. Linville

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