Linux wireless drivers development
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Alexander Wetzel <alexander@wetzel-home.de>,
	Felix Fietkau <nbd@nbd.name>,
	linux-wireless@vger.kernel.org
Cc: Johannes Berg <johannes@sipsolutions.net>
Subject: Re: [PATCH] mac80211: Ensure vif queues are operational after start
Date: Thu, 15 Sep 2022 13:39:55 -0700	[thread overview]
Message-ID: <4f77c10b-a6ea-2b79-cada-deefb2a3a07b@candelatech.com> (raw)
In-Reply-To: <0b342479-d04a-a45e-d63b-73eec5a1fb40@wetzel-home.de>

On 9/15/22 1:06 PM, Alexander Wetzel wrote:
>>
>> I've got some doubts that my fix is correct...
>> While it fixes the problem in my tests it looks like we'll need another queue restart to get the queues working again.
>>
>> After all IEEE80211_TXQ_STOP_NETIF_TX will not be cleared when it has been set by __ieee80211_stop_queue().
>>
>> I'll update the patch and skip setting vif.txqs_stopped when SDATA_STATE_RUNNING is not set. Not having IEEE80211_TXQ_STOP_NETIF_TX set looks harmless, having 
>> it set when it should less problematic...
> 
> Scratch that: The patch should be ok as it is: IEEE80211_TXQ_STOP_NETIF_TX is not set on stop, the patch should be ok as it is.
> 
> Sorry for the noise.
> 
> Alexander
> 

To add to the noise...

 From reading the original patch description, it was to stop an NPE when AP was stopped.  I have been testing
this patch below and it fixes the problems I saw with multiple vdevs.  I was worried that
the code in the 'list_for_each_entry_rcu(sta, &local->sta_list, list) {' might still need to run
to keep everything in sync (and my patch allows that to happen), but I do not know if that is true or not.

diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index c768e583aad4..2b5dafe9f4cc 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -370,12 +370,6 @@ static void __ieee80211_wake_txqs(struct ieee80211_sub_if_data *sdata, int ac)
         local_bh_disable();
         spin_lock(&fq->lock);

-       if (!test_bit(SDATA_STATE_RUNNING, &sdata->state))
-               goto out;
-
-       if (sdata->vif.type == NL80211_IFTYPE_AP)
-               ps = &sdata->bss->ps;
-
         sdata->vif.txqs_stopped[ac] = false;

         list_for_each_entry_rcu(sta, &local->sta_list, list) {
@@ -408,6 +402,10 @@ static void __ieee80211_wake_txqs(struct ieee80211_sub_if_data *sdata, int ac)

         txqi = to_txq_info(vif->txq);

+       if (test_bit(SDATA_STATE_RUNNING, &sdata->state))
+               if (sdata->vif.type == NL80211_IFTYPE_AP)
+                       ps = &sdata->bss->ps;
+
         if (!test_and_clear_bit(IEEE80211_TXQ_STOP_NETIF_TX, &txqi->flags) ||
             (ps && atomic_read(&ps->num_sta_ps)) || ac != vif->txq->ac)
                 goto out;


Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


  reply	other threads:[~2022-09-15 20:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-15 13:09 [PATCH] mac80211: Ensure vif queues are operational after start Alexander Wetzel
2022-09-15 16:18 ` Felix Fietkau
2022-09-15 19:59   ` Alexander Wetzel
2022-09-15 20:06     ` Alexander Wetzel
2022-09-15 20:39       ` Ben Greear [this message]
2022-09-16 16:38         ` Alexander Wetzel
2022-09-16 17:10           ` Ben Greear
2022-09-16  5:38 ` Kalle Valo

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=4f77c10b-a6ea-2b79-cada-deefb2a3a07b@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=alexander@wetzel-home.de \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@nbd.name \
    /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