Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp474875pxu; Tue, 5 Jan 2021 17:06:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6xBV9YeyFzQO8ku+sb5fim5BJMT++4vGUQqVx4OCpKUA6fGxXm01AqXD9dt+dTUKBIUGk X-Received: by 2002:a50:c3c5:: with SMTP id i5mr2302620edf.166.1609895161317; Tue, 05 Jan 2021 17:06:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609895161; cv=none; d=google.com; s=arc-20160816; b=Z7E1GYDShGYl63AlG8DIFMK+8bbOVZPR8ByWjAvGZfqpVOyygejTOvww+v8VfrePQO PJivUGAvVSODBY/m4YsM9uW3uN/ZZMMvz4IpBYXgybB9x24QCBb1Wy7wZv84VRkBHGM6 e5OeV4eqw3pUtzWxeZeo6eqJo6Q8ig68be4Y6nANdM9IW0TVVgIRJ+SUJZxL6INx7fQa 187ev3+UjbVIhbz5exNP9J965F37qe/tAFVv/pljH1n0oxsyF/hx96D/L8xPUlwWvvcr oaOxxHbmE/wtB1iR9aA//KotOCpHLtDZQBjtFL3NGbiqnxyKFxP8GOISJml0wWOu0imx /HtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=mMLzhJCcFpK94jKvcLWKs9/N5cQk5uaOwehcDNV7dz0=; b=dhs2cjuVM+C1jUMAzaSjFxYJz4qCD+wH1Mxjp279XKUALQcxuudNu6bEjH+YCHKUHD P7HildOMthm6jh91qUpk6CGewLTvmymDkgTkmOScmyDSPjDCOm/gOfhQYrpY0pbtph9x WZfNiGJL4FOxaIJj4qSIeWYCgL219K5uUgMLaRxZ6rxm+OQMJnyvY8u8CVdNybCxgYQJ 95SfZbAeMwIKdtrdSRaFzWFbwTrpOQQJl3aqinu4tDabj3b4VohMKtXgAk7jv0zeMj5B yyPq8ogqJLFDVlM1Zb+tTK6wH83jEdt/bZFJbUjYJbEkMBYSTH/sMKsXNyVur/pwLxmM V+0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i11si322953ejb.22.2021.01.05.17.05.38; Tue, 05 Jan 2021 17:06:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726273AbhAFBCz (ORCPT + 99 others); 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=20H=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 Content-Type: text/plain 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, -- 2.18.0