From patchwork Wed Jan 6 01:01:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryder Lee X-Patchwork-Id: 12000639 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A12A5C433E6 for ; Wed, 6 Jan 2021 01:03:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 58A3D221E2 for ; Wed, 6 Jan 2021 01:03:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726328AbhAFBCz (ORCPT ); Tue, 5 Jan 2021 20:02:55 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:46556 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725952AbhAFBCy (ORCPT ); Tue, 5 Jan 2021 20:02:54 -0500 X-UUID: 69ab6d3183964625b91e0cd563ee954e-20210106 X-UUID: 69ab6d3183964625b91e0cd563ee954e-20210106 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1114684851; Wed, 06 Jan 2021 09:02:09 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 6 Jan 2021 09:02:06 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 6 Jan 2021 09:02:06 +0800 From: Ryder Lee To: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= CC: Felix Fietkau , Lorenzo Bianconi , Shayne Chen , , , Ryder Lee Subject: [PATCH] mac80211: check ATF flag in ieee80211_next_txq() Date: Wed, 6 Jan 2021 09:01:49 +0800 Message-ID: X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-TM-SNTS-SMTP: 24C95263E2E9892CB5D0A505E079E5294164C3DCAC765E6AEEA2609BA5AA4CA02000:8 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The selected txq should be scheduled unconditionally if NL80211_EXT_FEATURE_AIRTIME_FAIRNESS is not set by driver. Also put the sta to the end of the active_txqs list if deficit is negative then move on to the next txq. Tested-by: Sujuan Chen Signed-off-by: Ryder Lee --- net/mac80211/tx.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 6422da6690f7..5640c9428596 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -3760,14 +3760,19 @@ struct ieee80211_txq *ieee80211_next_txq(struct ieee80211_hw *hw, u8 ac) struct sta_info *sta = container_of(txqi->txq.sta, struct sta_info, sta); bool aql_check = ieee80211_txq_airtime_check(hw, &txqi->txq); - s64 deficit = sta->airtime[txqi->txq.ac].deficit; + s64 deficit = 0; if (aql_check) found_eligible_txq = true; - if (deficit < 0) - sta->airtime[txqi->txq.ac].deficit += - sta->airtime_weight; + if (wiphy_ext_feature_isset(local->hw.wiphy, + NL80211_EXT_FEATURE_AIRTIME_FAIRNESS)) { + deficit = sta->airtime[txqi->txq.ac].deficit; + + if (deficit < 0) + sta->airtime[txqi->txq.ac].deficit += + sta->airtime_weight; + } if (deficit < 0 || !aql_check) { list_move_tail(&txqi->schedule_order,