From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ns2.wdyn.eu (ns2.wdyn.eu [5.252.227.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CC072FCE2A for ; Thu, 17 Jul 2025 16:35:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.252.227.236 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752770119; cv=none; b=o52FTJYtZ2Gsj04EVfTdRxW9JXzgCnt3wqG2vjZwULsRt83ez7K7g/3iDI4TKgPDiGqvMkNHbFfRsCwdGEyZjh9NbCBpvZPhdjKCVZJrUuCbLsTqEY+OT6Vpg8KhlWKTTI5BY7THHXbO8B+fAu/QMB4nvsFYLt9biuGIYcLscR4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752770119; c=relaxed/simple; bh=tgDMqxJFkm8oby4Jw8aqaL2aHLXZ1DQ6it0nwKkoblA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Gz3gFnkOB3uDVoUucm9qEuarBZtqGy/Fksp6uXOmReWMtMup0POS11PukW120nnZGVlTj0k3LLtNKm12O42+I7ejgRKpoVuhm+94U43w1gtvisrBElMP6k2qOUy+9+EFpoVrbDJWZUEKXovHSQ13SHKwixk4J82NfbMRqCbLmus= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wetzel-home.de; spf=pass smtp.mailfrom=wetzel-home.de; dkim=pass (1024-bit key) header.d=wetzel-home.de header.i=@wetzel-home.de header.b=LOF66W3d; arc=none smtp.client-ip=5.252.227.236 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wetzel-home.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wetzel-home.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=wetzel-home.de header.i=@wetzel-home.de header.b="LOF66W3d" From: Alexander Wetzel DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wetzel-home.de; s=wetzel-home; t=1752769689; bh=tgDMqxJFkm8oby4Jw8aqaL2aHLXZ1DQ6it0nwKkoblA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=LOF66W3d9igU/++YmHQq/jxCih16ThS5KmSAuJCht4pN+WdnmpKFSZbaMol4Hly3A eNCPAezaQSox9fxMh2SmCHhyDFLT46BePAQ7yzv2ElZn/tjz+DaDorFSKKi3B8zf5K 1f7Efz+3P/MtVclWupC58GXMGXFyzUVwGyotjP5w= To: linux-wireless@vger.kernel.org Cc: Johannes Berg , Alexander Wetzel Subject: [PATCH wireless] wifi: mac80211: Do not schedule stopped TXQs Date: Thu, 17 Jul 2025 18:25:46 +0200 Message-ID: <20250717162547.94582-2-Alexander@wetzel-home.de> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250717162547.94582-1-Alexander@wetzel-home.de> References: <20250717162547.94582-1-Alexander@wetzel-home.de> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Ignore TXQs with the flag IEEE80211_TXQ_STOP when scheduling a queue. The flag is only set after all fragments have been dequeued and won't allow dequeueing other frames as long as the flag is set. For drivers using ieee80211_txq_schedule_start() this prevents an loop trying to push the queued frames while IEEE80211_TXQ_STOP is set: After setting IEEE80211_TXQ_STOP the driver will call ieee80211_return_txq(). Which calls __ieee80211_schedule_txq(), detects that there sill are frames in the queue and immediately restarts the stopped TXQ. Which can't dequeue any frame and thus starts over the loop. Signed-off-by: Alexander Wetzel Fixes: ba8c3d6f16a1 ("mac80211: add an intermediate software queue implementation") --- net/mac80211/tx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index d58b80813bdd..4a9b258300fe 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -4098,7 +4098,9 @@ void __ieee80211_schedule_txq(struct ieee80211_hw *hw, spin_lock_bh(&local->active_txq_lock[txq->ac]); - has_queue = force || txq_has_queue(txq); + has_queue = force || + (!test_bit(IEEE80211_TXQ_STOP, &txqi->flags) && + txq_has_queue(txq)); if (list_empty(&txqi->schedule_order) && (has_queue || ieee80211_txq_keep_active(txqi))) { /* If airtime accounting is active, always enqueue STAs at the -- 2.50.0