2011-05-06 15:54:59

by Mohammed Shafi Shajakhan

[permalink] [raw]
Subject: [RFC] ath9k: make npending frames check as bool

From: Mohammed Shafi Shajakhan <[email protected]>

Signed-off-by: Mohammed Shafi Shajakhan <[email protected]>
---
drivers/net/wireless/ath/ath9k/main.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 3de115d..2b78ea2 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2267,7 +2267,7 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
timeout = 1;

for (j = 0; j < timeout; j++) {
- int npend = 0;
+ bool npend = false;

if (j)
usleep_range(1000, 2000);
@@ -2276,7 +2276,10 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
if (!ATH_TXQ_SETUP(sc, i))
continue;

- npend += ath9k_has_pending_frames(sc, &sc->tx.txq[i]);
+ npend = ath9k_has_pending_frames(sc, &sc->tx.txq[i]);
+
+ if (npend)
+ break;
}

if (!npend)
--
1.7.0.4



Subject: Re: [RFC] ath9k: make npending frames check as bool

On Fri, May 06, 2011 at 09:24:51PM +0530, Mohammed Shafi Shajakhan wrote:
> From: Mohammed Shafi Shajakhan <[email protected]>
>
> Signed-off-by: Mohammed Shafi Shajakhan <[email protected]>
> ---
> drivers/net/wireless/ath/ath9k/main.c | 7 +++++--
> 1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
> index 3de115d..2b78ea2 100644
> --- a/drivers/net/wireless/ath/ath9k/main.c
> +++ b/drivers/net/wireless/ath/ath9k/main.c
> @@ -2267,7 +2267,7 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
> timeout = 1;
>
> for (j = 0; j < timeout; j++) {
> - int npend = 0;
> + bool npend = false;
>
> if (j)
> usleep_range(1000, 2000);
> @@ -2276,7 +2276,10 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
> if (!ATH_TXQ_SETUP(sc, i))
> continue;
>
> - npend += ath9k_has_pending_frames(sc, &sc->tx.txq[i]);
> + npend = ath9k_has_pending_frames(sc, &sc->tx.txq[i]);
> +
> + if (npend)
> + break;

We need not bail out as soon as there is a pending frame in a queue.
There is a possibility that it could be transmitted successfully by
the time the given timeout expires.

Vasanth

2011-05-09 04:30:23

by Mohammed Shafi Shajakhan

[permalink] [raw]
Subject: Re: [RFC] ath9k: make npending frames check as bool

On Friday 06 May 2011 09:45 PM, Vasanth Thiagarajan wrote:
> On Fri, May 06, 2011 at 09:24:51PM +0530, Mohammed Shafi Shajakhan wrote:
>> From: Mohammed Shafi Shajakhan<[email protected]>
>>
>> Signed-off-by: Mohammed Shafi Shajakhan<[email protected]>
>> ---
>> drivers/net/wireless/ath/ath9k/main.c | 7 +++++--
>> 1 files changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
>> index 3de115d..2b78ea2 100644
>> --- a/drivers/net/wireless/ath/ath9k/main.c
>> +++ b/drivers/net/wireless/ath/ath9k/main.c
>> @@ -2267,7 +2267,7 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
>> timeout = 1;
>>
>> for (j = 0; j< timeout; j++) {
>> - int npend = 0;
>> + bool npend = false;
>>
>> if (j)
>> usleep_range(1000, 2000);
>> @@ -2276,7 +2276,10 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
>> if (!ATH_TXQ_SETUP(sc, i))
>> continue;
>>
>> - npend += ath9k_has_pending_frames(sc,&sc->tx.txq[i]);
>> + npend = ath9k_has_pending_frames(sc,&sc->tx.txq[i]);
>> +
>> + if (npend)
>> + break;
>
> We need not bail out as soon as there is a pending frame in a queue.
> There is a possibility that it could be transmitted successfully by
> the time the given timeout expires.

Hi Vasanth,
the timeout is before we enter into the loop for checking pending
frames, so I thought it won't be affecting it. am I missing something?
please tell me.

thanks,
shafi

>
> Vasanth
> .
>

Subject: Re: [RFC] ath9k: make npending frames check as bool

On Mon, May 09, 2011 at 02:58:54PM +0530, Vasanth Thiagarajan wrote:
> On Mon, May 09, 2011 at 10:00:17AM +0530, Mohammed Shajakhan wrote:
> > On Friday 06 May 2011 09:45 PM, Vasanth Thiagarajan wrote:
> > > On Fri, May 06, 2011 at 09:24:51PM +0530, Mohammed Shafi Shajakhan wrote:
> > >> From: Mohammed Shafi Shajakhan<[email protected]>
> > >>
> > >> Signed-off-by: Mohammed Shafi Shajakhan<[email protected]>
> > >> ---
> > >> drivers/net/wireless/ath/ath9k/main.c | 7 +++++--
> > >> 1 files changed, 5 insertions(+), 2 deletions(-)
> > >>
> > >> diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
> > >> index 3de115d..2b78ea2 100644
> > >> --- a/drivers/net/wireless/ath/ath9k/main.c
> > >> +++ b/drivers/net/wireless/ath/ath9k/main.c
> > >> @@ -2267,7 +2267,7 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
> > >> timeout = 1;
> > >>
> > >> for (j = 0; j< timeout; j++) {
> > >> - int npend = 0;
> > >> + bool npend = false;
> > >>
> > >> if (j)
> > >> usleep_range(1000, 2000);
> > >> @@ -2276,7 +2276,10 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
> > >> if (!ATH_TXQ_SETUP(sc, i))
> > >> continue;
> > >>
> > >> - npend += ath9k_has_pending_frames(sc,&sc->tx.txq[i]);
> > >> + npend = ath9k_has_pending_frames(sc,&sc->tx.txq[i]);
> > >> +
> > >> + if (npend)
> > >> + break;
> > >
> > > We need not bail out as soon as there is a pending frame in a queue.
> > > There is a possibility that it could be transmitted successfully by
> > > the time the given timeout expires.
> >
> > Hi Vasanth,
> > the timeout is before we enter into the loop for checking pending
> > frames, so I thought it won't be affecting it. am I missing something?
> > please tell me.
>
> I meant the total timeout (200ms). Even though there are frames in
> tx queues after the given timeout for that particular queue, it is
> quite possible that those frames can be completed successfully by
> the time we are done with the waiting on the last queue.

Never mind, I misread your change.

Vasanth

Subject: Re: [RFC] ath9k: make npending frames check as bool

On Mon, May 09, 2011 at 10:00:17AM +0530, Mohammed Shajakhan wrote:
> On Friday 06 May 2011 09:45 PM, Vasanth Thiagarajan wrote:
> > On Fri, May 06, 2011 at 09:24:51PM +0530, Mohammed Shafi Shajakhan wrote:
> >> From: Mohammed Shafi Shajakhan<[email protected]>
> >>
> >> Signed-off-by: Mohammed Shafi Shajakhan<[email protected]>
> >> ---
> >> drivers/net/wireless/ath/ath9k/main.c | 7 +++++--
> >> 1 files changed, 5 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
> >> index 3de115d..2b78ea2 100644
> >> --- a/drivers/net/wireless/ath/ath9k/main.c
> >> +++ b/drivers/net/wireless/ath/ath9k/main.c
> >> @@ -2267,7 +2267,7 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
> >> timeout = 1;
> >>
> >> for (j = 0; j< timeout; j++) {
> >> - int npend = 0;
> >> + bool npend = false;
> >>
> >> if (j)
> >> usleep_range(1000, 2000);
> >> @@ -2276,7 +2276,10 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
> >> if (!ATH_TXQ_SETUP(sc, i))
> >> continue;
> >>
> >> - npend += ath9k_has_pending_frames(sc,&sc->tx.txq[i]);
> >> + npend = ath9k_has_pending_frames(sc,&sc->tx.txq[i]);
> >> +
> >> + if (npend)
> >> + break;
> >
> > We need not bail out as soon as there is a pending frame in a queue.
> > There is a possibility that it could be transmitted successfully by
> > the time the given timeout expires.
>
> Hi Vasanth,
> the timeout is before we enter into the loop for checking pending
> frames, so I thought it won't be affecting it. am I missing something?
> please tell me.

I meant the total timeout (200ms). Even though there are frames in
tx queues after the given timeout for that particular queue, it is
quite possible that those frames can be completed successfully by
the time we are done with the waiting on the last queue.


Vasanth

2011-05-09 09:39:13

by Mohammed Shafi Shajakhan

[permalink] [raw]
Subject: Re: [RFC] ath9k: make npending frames check as bool

On Monday 09 May 2011 02:58 PM, Vasanth Thiagarajan wrote:
> On Mon, May 09, 2011 at 10:00:17AM +0530, Mohammed Shajakhan wrote:
>> On Friday 06 May 2011 09:45 PM, Vasanth Thiagarajan wrote:
>>> On Fri, May 06, 2011 at 09:24:51PM +0530, Mohammed Shafi Shajakhan wrote:
>>>> From: Mohammed Shafi Shajakhan<[email protected]>
>>>>
>>>> Signed-off-by: Mohammed Shafi Shajakhan<[email protected]>
>>>> ---
>>>> drivers/net/wireless/ath/ath9k/main.c | 7 +++++--
>>>> 1 files changed, 5 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
>>>> index 3de115d..2b78ea2 100644
>>>> --- a/drivers/net/wireless/ath/ath9k/main.c
>>>> +++ b/drivers/net/wireless/ath/ath9k/main.c
>>>> @@ -2267,7 +2267,7 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
>>>> timeout = 1;
>>>>
>>>> for (j = 0; j< timeout; j++) {
>>>> - int npend = 0;
>>>> + bool npend = false;
>>>>
>>>> if (j)
>>>> usleep_range(1000, 2000);
>>>> @@ -2276,7 +2276,10 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
>>>> if (!ATH_TXQ_SETUP(sc, i))
>>>> continue;
>>>>
>>>> - npend += ath9k_has_pending_frames(sc,&sc->tx.txq[i]);
>>>> + npend = ath9k_has_pending_frames(sc,&sc->tx.txq[i]);
>>>> +
>>>> + if (npend)
>>>> + break;
>>>
>>> We need not bail out as soon as there is a pending frame in a queue.
>>> There is a possibility that it could be transmitted successfully by
>>> the time the given timeout expires.
>>
>> Hi Vasanth,
>> the timeout is before we enter into the loop for checking pending
>> frames, so I thought it won't be affecting it. am I missing something?
>> please tell me.
>
> I meant the total timeout (200ms). Even though there are frames in
> tx queues after the given timeout for that particular queue, it is
> quite possible that those frames can be completed successfully by
> the time we are done with the waiting on the last queue.

Ok Vasanth.

thanks,
shafi
>
>
> Vasanth
> .
>