Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2285412ybx; Fri, 8 Nov 2019 02:17:37 -0800 (PST) X-Google-Smtp-Source: APXvYqz2sW0JfiTvmuCF6jq3oXnPagSXmZkjq0Q5GnqmgGK4uG7q3oqOXDn/rBCSRTEYQY8sDmY9 X-Received: by 2002:aa7:d0d4:: with SMTP id u20mr9275890edo.112.1573208256937; Fri, 08 Nov 2019 02:17:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573208256; cv=none; d=google.com; s=arc-20160816; b=OjoUQD1C3E8DbZ0nPv7K+m8MUklQJJs4XoHtKKud6t30PfUfuw7FehBYjeX6W+hrZz MHlqxx/dO8CIKiPYH7BQdd0HFAYm2MJy7BQFFaUs+M3klnWp7QELby3fxgxtTgxbnFJk 2X/5aIh02jULRW1YjfDiGcCWIT4Kt3czdLlcny688K4Lut2pVdZ1GJ3Nxc/BT58WCd6U s6pETrvFPZeNrytqyocQBmvF1W12r1kpucb7Lrw8DPr1TaTIshzfz5XvGSUnKyvLwLBz ro4jKzXYjSccRpW3PPrDo62SmKgMfNxzLGZWq/5ASA01JTKIqg/id9hoozdL1sjxYM2P 2vnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=NaFrZSPT4jqGd9uQsNLzLc2U+s8GDdZc+RYqocCTwHo=; b=jw1V7DXkDhtGuzEYL+3+WeEXuTYCvp48Jdd6Yme9NOgDDkYmC8uHfWToP1zx2Blza7 rmvcRh+P35KhiViwWpNSwpR15KbuHabgw1UHlvz/xRh8OElozPxOe4CpMnokyWDZl2Xz qNwpnV/uTQaELTZgPxY+cbDFDd3UAURkG6miXScZTL7q0mf8nMC4n61XTtsEPs9XSkFE ZezJTDi1RnlbZ3CbcGC+eiyGz4H2Jp2fNL6XqAFYMZ5g7eMt1OAS6+DcM2cxEt5g7WRn tr7ahwspxoAIqMlKdSKkMTBWS2i4v7BFKWBIyAudCtXsLGA5PZHSgkZGtl1rRV5XxINi K5mQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cx17si715156ejb.421.2019.11.08.02.17.11; Fri, 08 Nov 2019 02:17:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727573AbfKHKRD (ORCPT + 99 others); Fri, 8 Nov 2019 05:17:03 -0500 Received: from s3.sipsolutions.net ([144.76.43.62]:53708 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726103AbfKHKRD (ORCPT ); Fri, 8 Nov 2019 05:17:03 -0500 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> Subject: Re: [PATCH v6 4/4] mac80211: Use Airtime-based Queue Limits (AQL) on packet dequeue 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 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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