From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 7CB503CB35 for ; Fri, 8 Nov 2019 05:17:04 -0500 (EST) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.92.3) (envelope-from ) id 1iT1K9-0007j0-SI; Fri, 08 Nov 2019 11:17:01 +0100 Message-ID: <0b43c4822ab83ea4d33a5a32d8ff6c7a56eff6c5.camel@sipsolutions.net> From: Johannes Berg To: Toke =?ISO-8859-1?Q?H=F8iland-J=F8rgensen?= Cc: linux-wireless@vger.kernel.org, make-wifi-fast@lists.bufferbloat.net, ath10k@lists.infradead.org, John Crispin , Lorenzo Bianconi , Felix Fietkau , Kan Yan , Rajkumar Manoharan , Kevin Hayes Date: Fri, 08 Nov 2019 11:17:00 +0100 In-Reply-To: <157182474399.150713.16380222749144410045.stgit@toke.dk> References: <157182473951.150713.7978051149956899705.stgit@toke.dk> <157182474399.150713.16380222749144410045.stgit@toke.dk> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [Make-wifi-fast] [PATCH v6 4/4] mac80211: Use Airtime-based Queue Limits (AQL) on packet dequeue X-BeenThere: make-wifi-fast@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 10:17:04 -0000 On Wed, 2019-10-23 at 11:59 +0200, Toke Høiland-Jørgensen wrote: > > + if (info->tx_time_est) { > + struct sta_info *sta = NULL, *s; > + struct rhlist_head *tmp; > + > + rcu_read_lock(); > + > + for_each_sta_info(local, hdr->addr1, s, tmp) { > + /* skip wrong virtual interface */ > + if (!ether_addr_equal(hdr->addr2, s->sdata->vif.addr)) > + continue; > + > + sta = s; > + break; > + } I guess that is better than looking up the sdata and then using sta_info_get(), but I think I'd like to see this wrapped into a function (even if it's an inline) in sta_info.{c,h}. > + airtime = ieee80211_calc_expected_tx_airtime(hw, vif, txq->sta, > + skb->len); > + if (airtime) { > + /* We only have 10 bits in tx_time_est, so store airtime > + * in increments of 4us and clamp the maximum to 2**12-1 > + */ > + airtime = min_t(u32, airtime, 4095) & ~3U; > + info->tx_time_est = airtime >> 2; > + ieee80211_sta_update_pending_airtime(local, tx.sta, > + txq->ac, airtime, > + false); I wonder if it'd be better to pass the shifted value to ieee80211_sta_update_pending_airtime() to avoid all the shifting in all places? You could even store the shifted value in "aql_tx_pending" and "aql_total_pending_airtime" etc., it's completely equivalent, and only shift it out for people looking at debugfs. johannes