linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Lamparter <chunkeey@googlemail.com>
To: Nicolas Cavallari <Nicolas.Cavallari@lri.fr>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org
Subject: Re: [RFC] carl9170: Fix memory accounting when sta is in power-save mode.
Date: Thu, 23 Feb 2012 17:52:44 +0100	[thread overview]
Message-ID: <201202231752.44125.chunkeey@googlemail.com> (raw)
In-Reply-To: <1330012414-26559-1-git-send-email-cavallar@lri.fr>

On Thursday, February 23, 2012 04:53:34 PM Nicolas Cavallari wrote:
> On Access Point mode, when transmitting a packet, if the destination
> station is in powersave mode, we abort transmitting the packet to the
> device queue, but we do not reclaim the allocated memory.  Given enough
> packets, we can go in a state where there is no packet on the device
> queue, but we think the device has no memory left, so no packet gets
> transmitted, connections breaks and the AP stops working.
> 
> This undo the allocation done in the TX path when the station is in
> power-save mode.
> 
> Signed-off-by: Nicolas Cavallari <cavallar@lri.fr>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
Cc: stable <stable@vger.kernel.org>

> ---
> While this seems to fix my problem, there could still be problems remaining
> in this code path.  Particularly carl9170_tx_status will do lots of things
> like incrementing counters and waking up mac80211 queues...
That should be alright. As a rule of thumb, for every call to
carl9170_tx_accounting [called by carl9170_op_tx tx handler]
we need to call carl9170_tx_status. If the station is still in
ps mode, mac80211 will cache the station's frames and sets
the TIM bits. 

> 
> diff --git a/drivers/net/wireless/ath/carl9170/tx.c b/drivers/net/wireless/ath/carl9170/tx.c
> index 771e1a9..8d52ddd 100644
> --- a/drivers/net/wireless/ath/carl9170/tx.c
> +++ b/drivers/net/wireless/ath/carl9170/tx.c
> @@ -1253,6 +1253,7 @@ static bool carl9170_tx_ps_drop(struct ar9170 *ar, struct sk_buff *skb)
>  			atomic_dec(&ar->tx_ampdu_upload);
>  
>  		tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED;
> +		carl9170_release_dev_space(ar, skb);
>  		carl9170_tx_status(ar, skb, false);
>  		return true;
>  	}
> 

  reply	other threads:[~2012-02-23 16:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-23 15:53 [RFC] carl9170: Fix memory accounting when sta is in power-save mode Nicolas Cavallari
2012-02-23 16:52 ` Christian Lamparter [this message]
2012-02-23 17:27   ` Nicolas Cavallari
2012-02-23 18:08     ` Christian Lamparter
2012-02-23 18:51       ` Nicolas Cavallari
2012-02-24 13:34         ` Nicolas Cavallari
2012-02-24 13:39           ` Johannes Berg
2012-02-24 14:01             ` Nicolas Cavallari
2012-02-24 14:09               ` Johannes Berg
2012-02-25  9:32                 ` Jouni Malinen
2012-02-25 20:12                   ` Johannes Berg
2012-02-25 20:20                     ` Christian Lamparter
2012-02-24 14:07           ` Christian Lamparter
2012-02-24 20:43     ` Christian Lamparter
2012-02-25 20:36     ` [PATCH -stable] carl9170: fix frame delivery if sta is in powersave mode Christian Lamparter
2012-02-27 12:00       ` Nicolas Cavallari

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=201202231752.44125.chunkeey@googlemail.com \
    --to=chunkeey@googlemail.com \
    --cc=Nicolas.Cavallari@lri.fr \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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 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).