From: Johannes Berg <johannes@sipsolutions.net>
To: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
Emmanuel Grumbach <emmanuel.grumbach@intel.com>,
mhocko@suse.com
Subject: Re: [PATCH 3.14] mac80211: fix AP powersave TX vs. wakeup race
Date: Wed, 04 Jun 2014 08:59:18 +0200 [thread overview]
Message-ID: <1401865158.6079.2.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <CAB=NE6W=FubasHV6QsAO8Jrdhbh_xM1SmYqCScvRf8g0FY4GHw@mail.gmail.com> (sfid-20140604_040613_250958_CB2BCE5C)
On Tue, 2014-06-03 at 19:05 -0700, Luis R. Rodriguez wrote:
> > +++ b/net/mac80211/tx.c
> > @@ -478,6 +478,19 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx)
> > sta->sta.addr, sta->sta.aid, ac);
> > if (tx->local->total_ps_buffered >= TOTAL_MAX_TX_BUFFER)
> > purge_old_ps_buffers(tx->local);
> > +
> > + /* sync with ieee80211_sta_ps_deliver_wakeup */
> > + spin_lock(&sta->ps_lock);
> > + /*
> > + * STA woke up the meantime and all the frames on ps_tx_buf have
> > + * been queued to pending queue. No reordering can happen, go
> > + * ahead and Tx the packet.
> > + */
> > + if (!test_sta_flag(sta, WLAN_STA_PS_STA)) {
> > + spin_unlock(&sta->ps_lock);
> > + return TX_CONTINUE;
> > + }
> > +
> > if (skb_queue_len(&sta->ps_tx_buf[ac]) >= STA_MAX_TX_BUFFER) {
> > struct sk_buff *old = skb_dequeue(&sta->ps_tx_buf[ac]);
> > ps_dbg(tx->sdata,
>
> This fixes the race for the case where the API introduced via commit
> af81858172cc but that code also *moved* code, the API added simply
> added a new way to let driver to hit a trigger to send buffered
> frames, are we sure that through mechanisms that don't use this API
> this race doesn't exist? That is can we not race between
> ieee80211_rx_h_sta_process() and ieee80211_tx_h_unicast_ps_buf()?
Err, I have no idea what you're trying to say.
Did you mean sta_ps_end() vs. ieee80211_tx_h_unicast_ps_buf()? Those can
*race*, but any outcome will be valid, afaict, given the station flag
tricks. It all goes back to the same (locked) code for manipulating the
queues.
I recently fixed a bug where mac80211 would get into a confused state
and not buffer packets when it would really be required, but that's just
a bug that can be observed over the air, it has no bad consequences
except for that station losing traffic.
johannes
prev parent reply other threads:[~2014-06-04 6:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-20 8:52 [PATCH 3.14] mac80211: fix AP powersave TX vs. wakeup race Johannes Berg
2014-02-20 9:15 ` Stanislaw Gruszka
2014-02-20 9:21 ` Stanislaw Gruszka
2014-02-20 9:27 ` Johannes Berg
2014-02-20 9:29 ` Johannes Berg
2014-02-20 9:40 ` Stanislaw Gruszka
2014-02-20 9:42 ` Johannes Berg
2014-02-20 10:06 ` Johannes Berg
2014-02-20 10:09 ` Stanislaw Gruszka
2014-02-20 10:08 ` Johannes Berg
2014-06-04 2:05 ` Luis R. Rodriguez
2014-06-04 6:59 ` Johannes Berg [this message]
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=1401865158.6079.2.camel@jlt4.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=emmanuel.grumbach@intel.com \
--cc=linux-wireless@vger.kernel.org \
--cc=mcgrof@do-not-panic.com \
--cc=mhocko@suse.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.