From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id AC9543B29D for ; Fri, 15 Nov 2019 08:20:43 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573824043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wvUQMq8paeveUMyRBwqhvZ4bHbn1KjByxEnpWY8JuvE=; b=ffWrc4HOUTDCmEgaaqTIvGqwBnhymFnyyYmmidRPcH/Z88oGxBsI9ygryWYyRdqEldFagW S++Umxm2x+6v1Syh7TrxRxhh0lfvkpUcSs0ujsNFIcPcNRmj+mppB9GaAdZgo4BLwHNgdr /GUTtfRkWqzIJZHl68s4WusCL6lhU1E= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-134-qlqU6GlqPx6qaGu6QC_igg-1; Fri, 15 Nov 2019 08:20:40 -0500 Received: by mail-lj1-f197.google.com with SMTP id e17so1537016ljj.12 for ; Fri, 15 Nov 2019 05:20:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:user-agent :mime-version:content-transfer-encoding; bh=NCGmpHEMA2O10MpUQId67Zj1BdLKlIMXN/gDOoUArOA=; b=VdQ80R9YdxyRJH+C/2cbpovvZ4lGyXmcbsodGISN1jbrIbx4O9ut80anmIMz7Z211V L83Qr05ingJZLuMfV6wBwC8Qo5D35t4OQ+1jXbast7Ve7DrzIUypiaTj4nP6joXXpx9O lCBk3/pWk+IgalstgxOE07gdtQG0TNgEsa642LJULPAR+qEknBnsxNY2bMxw0DVP3RXJ 0qYNT02wwXLfAp4wIC5r5hygHwhRlo6P9E4MfScV/DoB0cVz57aaJGsJ4oCFCtfiaJNA raMLmEUaGeZlTd4FY15MiW6WH0xFik42kUQrbqbgszuDHjGJGFAdkTY4CI8dR5tyVz0w 6h1Q== X-Gm-Message-State: APjAAAUBfqFkmZ4dn6A9ZgHc3mswkpZQDpvcnWRIVL15r4sB5cNQrZlQ pdjd8bVYr2d/EKK+NNFCbWihl8yRp5eg+IkIBoKtIarqyJHK2ddYeqCelonXTu2G2i0cCR9TY85 ZRxjZWvEMRyUJ4zuqL6AHdmWwqvWsUJPN9TY= X-Received: by 2002:a2e:7a07:: with SMTP id v7mr11448019ljc.208.1573824038422; Fri, 15 Nov 2019 05:20:38 -0800 (PST) X-Google-Smtp-Source: APXvYqyxFXP2mNsc87Z+RQVjwHXBRrtCroQSC10ZLbV3vxKa3Ps6nbCQkVp4nUXsnYmFbTK9gcgz9A== X-Received: by 2002:a2e:7a07:: with SMTP id v7mr11447999ljc.208.1573824038202; Fri, 15 Nov 2019 05:20:38 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk (borgediget.toke.dk. [85.204.121.218]) by smtp.gmail.com with ESMTPSA id a1sm4581906lfg.11.2019.11.15.05.20.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 05:20:37 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id D40151818C5; Fri, 15 Nov 2019 14:20:36 +0100 (CET) From: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= To: Johannes Berg 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, 15 Nov 2019 14:20:36 +0100 Message-ID: <157382403672.580235.12525941420808058808.stgit@toke.dk> User-Agent: StGit/0.21 MIME-Version: 1.0 X-MC-Unique: qlqU6GlqPx6qaGu6QC_igg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Make-wifi-fast] [PATCH v9 0/4] Add Airtime Queue Limits (AQL) to mac80211 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, 15 Nov 2019 13:20:43 -0000 This series is a first attempt at porting the Airtime Queue Limits concept = from the out-of-tree ath10k implementation[0] to mac80211. This version takes Ka= n's patch to do the throttling in mac80211, and replaces the driver API with th= e mechanism from the previous version of my series, which instead calculated = the expected airtime at dequeue time inside mac80211, storing it in the SKB cb field. This series also imports Felix' airtime calculation code from mt76 into mac80211, adjusting the API so it can be used from TX dequeue, by extractin= g the latest TX rate from the tx_stats structure kept for each station. As before, I've only compile tested this (lacking the proper hardware to do= more testing), but Kan has tested in on the QCA9984 platform. The series is also available in my git repo here: https://git.kernel.org/pub/scm/linux/kernel/git/toke/linux.git/log/?h=3Dmac= 80211-aql-09 [0] https://chromium-review.googlesource.com/c/chromiumos/third_party/kerne= l/+/1703105/7 Changelog: v9: - Use atomic_sub_return() instead of separate atomic_sub() and atomic_rea= d() - Add getter/setter for tx_time_est - Use get_sta_info_by_addrs() to find the station in ieee80211_report_used_skb() - Integrate everything back into one series v8: - Includes Toke's v7 version of "mac80211: Import airtime calculation cod= e from mt76" - Don't clobber sta's customized queue limit when configuring the default= via debugfs - Fix a racing condition when reset aql_tx_pending. v7: - Fix aql_total_pending_airtime underflow due to insufficient locking. v6: - Fix sta lookup in ieee80211_report_used_skb(). - Move call to ieee80211_sta_update_pending_airtime() to a bit later in __ieee80211_tx_status()=20 v5: - Add missing export of ieee80211_calc_rx_airtime() and make ieee80211_calc_tx_airtime_rate() static (kbuildbot). - Use skb_get_queue_mapping() to get the AC from the skb. - Take basic rate configuration for the BSS into account when calculating multicast rate. v4: - Fix calculation that clamps the maximum airtime to fit into 10 bits - Incorporate Rich Brown's nits for the commit message in Kan's patch - Add fewer local variables to ieee80211_tx_dequeue() v3: - Move the tx_time_est field so it's shared with ack_frame_id, and use un= its of 4us for the value stored in it. - Move the addition of the Ethernet header size into ieee80211_calc_expec= ted_tx_airtime() v2: - Integrate Kan's approach to airtime throttling. - Hopefully fix the cb struct alignment on big-endian architectures. --- Kan Yan (1): mac80211: Implement Airtime-based Queue Limit (AQL) Toke H=C3=B8iland-J=C3=B8rgensen (3): mac80211: Add new sta_info getter by sta/vif addrs mac80211: Import airtime calculation code from mt76 mac80211: Use Airtime-based Queue Limits (AQL) on packet dequeue include/net/cfg80211.h | 7 + include/net/mac80211.h | 57 ++++ net/mac80211/Makefile | 3=20 net/mac80211/airtime.c | 597 ++++++++++++++++++++++++++++++++++++++++= ++++ net/mac80211/debugfs.c | 85 ++++++ net/mac80211/debugfs_sta.c | 43 ++- net/mac80211/ieee80211_i.h | 8 + net/mac80211/main.c | 10 + net/mac80211/sta_info.c | 58 ++++ net/mac80211/sta_info.h | 11 + net/mac80211/status.c | 36 ++- net/mac80211/tx.c | 65 +++++ 12 files changed, 957 insertions(+), 23 deletions(-) create mode 100644 net/mac80211/airtime.c