Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp288463pxu; Thu, 7 Jan 2021 05:14:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJwusjzvR+8hXSBmVCHD6RgZDGWuNVNIfqiGI7D0QjpIc1MVCc66WhrtXQsISu/YLH8dJBzl X-Received: by 2002:a17:906:1291:: with SMTP id k17mr6671387ejb.288.1610025247574; Thu, 07 Jan 2021 05:14:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610025247; cv=none; d=google.com; s=arc-20160816; b=D6sMy48bc66AyD2eJOhtDb0sTqNCWYTVUNQB4MQmMuv0D6my77Sjpvrdwdg/iR3+Um QENsywJJ4Jhb5eoWMQ9cphzHL3AQOmIYvF7WIyHt4W2OqlBhsXjFhz+3WI02733fG4MU a+IqdoOEisCFVMReASSzwCmvVlY8ggT4vlM/FB/SNmQimYgPnYfrDHE+Zj8RwtDgD031 G2vzXhqkEcN/VAE2o29FCmqymJJ1y5zpTnIEF11Vyts4H8GczJ8Pd51pyioP6CRPqkJn rzOlte9yWAbktXbcSd/QpezYmNaaYG2zKlVRo4eI83wmC2mJqQp1AnmHUExHo6fk9K4v TU8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :from; bh=8yBcqqCmZGf1LeuXCDPXBC4WzK4eLeRC8bvHGxgx/V4=; b=kYI0qJa9p1BZ1JhCXt0Id5nYWoLJ0cvRlePAHao0unNfjffo8a+e5CelycPePuFm8F gIsbj/Foh4pq+PTySxO+yYczG1JjoRaP+TjeOpCDxfxYb8Y7PP5UCCebAtyqaHZzPbmh ax4Eqv9I1snJ/utNuuIsJgLAzY4JKltHSAetmRy+w1xJ7mrfJKZOM7aY2pdF3AUHRY09 +wWBY7cPChDXg6XDDfCy8MECqnB5biPvxlQ72VOQ1cC1aik4KX3r5bCojRjV5naSzubY Dnjv+V0E5q7J7XoqcVCOn2Ktft6DV+rZhiP85Aa5kfLNf098Z67JPP5PaVvLYmKb+MzD e3ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@toke.dk header.s=20161023 header.b="eLt3/bBW"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=toke.dk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r23si2131510ejb.547.2021.01.07.05.13.39; Thu, 07 Jan 2021 05:14:07 -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; dkim=pass header.i=@toke.dk header.s=20161023 header.b="eLt3/bBW"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=toke.dk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728091AbhAGNJo (ORCPT + 99 others); Thu, 7 Jan 2021 08:09:44 -0500 Received: from mail.toke.dk ([45.145.95.4]:49465 "EHLO mail.toke.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727453AbhAGNJo (ORCPT ); Thu, 7 Jan 2021 08:09:44 -0500 From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=toke.dk; s=20161023; t=1610024910; bh=8yBcqqCmZGf1LeuXCDPXBC4WzK4eLeRC8bvHGxgx/V4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=eLt3/bBWv0ZVvbQDuiVkKm5piHVZJ3mAHQ5EB+HNdlUi4QC04I7rVyQhy+4Uz7vHH bHhlyHna6jxyUrBgwJtzVKSua3O2G8i9riMF0zXMgB3ouM+a90T9CXwnF/Vcv7q9tp qHtuO1+tPOUDeIgz4/20Fif1skolHkEMWfSeakABWjoH6j9FEQZoRTPFi4XlubTWOU RsWdyi8P4kmpu3N5s9QyzUthgZ+zApuNwibZJzhSAyuKDBrgeyAUXXQfOSV8+Ltn7+ AfDwbfPWqd3CrJQ3kFFvufLfCTIrV3MNrh+ZPXU/ZaC3lHBo7452TnSIZkhme5tIZ9 4uIqBHMlqHFJQ== To: Ryder Lee Cc: Felix Fietkau , Lorenzo Bianconi , Shayne Chen , linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH] mac80211: check ATF flag in ieee80211_next_txq() In-Reply-To: <1609985461.9743.2.camel@mtkswgap22> References: <87r1my49us.fsf@toke.dk> <68ab89bc-70f4-e822-3d96-21ba3bd6511f@nbd.name> <87k0sq3wfl.fsf@toke.dk> <1609985461.9743.2.camel@mtkswgap22> Date: Thu, 07 Jan 2021 14:08:29 +0100 X-Clacks-Overhead: GNU Terry Pratchett Message-ID: <87a6tkki7m.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Ryder Lee writes: > On Wed, 2021-01-06 at 16:41 +0100, Toke H=C3=B8iland-J=C3=B8rgensen wrote: >> Felix Fietkau writes: >>=20 >> > On 2021-01-06 11:51, Toke H=C3=B8iland-J=C3=B8rgensen wrote: >> >> Ryder Lee writes: >> >>=20 >> >>> 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. >> >>=20 >> >> Why is this needed? If the feature is not set, no airtime should ever= be >> >> accounted to the station, and so sta->airtime[txqi->txq.ac].deficit w= ill >> >> always be 0 - so you're just adding another check that doesn't actual= ly >> >> change the behaviour, aren't you? >> > >> > I think it might make sense to keep airtime reporting even when airtime >> > fairness is disabled at run time, so this patch makes sense to me. >> > Instead of this patch, the right place to deal with this would probably >> > be ieee80211_sta_register_airtime. >>=20 >> When the fairness mechanism is user-disabled I agree it makes sense to >> still keep the accounting; and in fact that's what >> ieee80211_sta_register_airtime() already does when the accounting is >> turned off by way of the airtime_flags field... So don't think anything >> else is needed there either? >>=20 >> -Toke > > Not sure I get this right. Are you talking about local->airtime_flags =3D > AIRTIME_USE_TX | AIRTIME_USE_RX ? I think that's different and we still > need to take NL80211_EXT_FEATURE_AIRTIME_FAIRNESS into account, right? I just meant that what Felix was asking for (a way *for the user* to disable airtime fairness while still getting the airtime usage accounted) is possible by setting those flags. The EXT_FEATURE flag is meant as a way for the driver to signal to mac80211 that it supports reporting airtime at all; so ideally it should be a flag that is only set once. Going back and reading your initial response it seems like you may be toggling the flag dynamically in the driver, though? Is this accurate? And if so, why? Is it not enough for you to fiddle with the USE_TX/USE_RX flags? :) -Toke