From patchwork Fri Oct 18 14:40:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= X-Patchwork-Id: 11198607 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B4175112C for ; Fri, 18 Oct 2019 14:40:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8DDF8222C3 for ; Fri, 18 Oct 2019 14:40:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kEnmIUCb"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bnUv6hjI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8DDF8222C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:To:From: Subject:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=mLn/FK9BFbD+tdCtIitVYE+RzDaP264vnYoA5mscHYI=; b=kEnmIUCbMtTvZv ijsUrI0Ve7/uJqTOD2Oa84KzMvCUXzAb09+5JrHLzMko76GDM2cEIDwflGr6XreBZJhABh1JLTX5J WYe5WX29p3PRmh0E70eAb/CekrN5tQVPRqTDIWOxL5mP24ka2fKVgwzJXaeP77NjIsyaFxEaKsBlc YuPd2m+WMPxDaTarb4PSrbAJoaRa+ghSLmjq0w5CFLgloF1wMEcc3FQ0CYw0rVwLAUHtysmGYbVG+ vKTiMZZ0BK4wI1rqxHBuF6WPvo3eQzibCxwEPM5sLA0a5h4XAczZbYKgOt2DaFIrk6PTsDFfqV7zt V7HgjUOY8VuhheSXmnGA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLTQf-0008N4-Uj; Fri, 18 Oct 2019 14:40:33 +0000 Received: from us-smtp-1.mimecast.com ([205.139.110.61] helo=us-smtp-delivery-1.mimecast.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLTQc-0008Kh-2y for ath10k@lists.infradead.org; Fri, 18 Oct 2019 14:40:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571409628; 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=4jQ/tW2DJnux5IJz+rjWj2biWuzQKo2eWZ9vfDg1dJM=; b=bnUv6hjIKVEVKbWXo5JzzJNjkCVoFzIrj4LdrB1AdQjK2R+pfXa/Ax3tdwp4aI/4rbBNOv IL/uGxBAJjcONgjBl8QyO4A+bT4zg8g5DZGFDE4+AI5MuACJWKKtAqovhAZEiaeC/ETzd/ OMiOq0n0gnRDomng94J3JhJV/Kkjbf0= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-228-ukYW5mpUPt6m6kBn3JXUEQ-1; Fri, 18 Oct 2019 10:40:24 -0400 Received: by mail-lf1-f71.google.com with SMTP id q3so1318952lfo.8 for ; Fri, 18 Oct 2019 07:40:24 -0700 (PDT) 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=e7FaDhgC1zTkjFC0jsJQQgggehot9KAb85p12pfkR44=; b=tcu3+22DvjuMSJhXRb/wnUxSV5AG2gnkYuOyh0e5neoISFHrcjbTcG7D0t2upOO38s G9TslyS28Q92b+vlbSrtYbS65jMv1Evx6cUNeaTq31TYt30cCrXPFUoEJD7sfGkqx9MY h/svSrTV5/Kk+j1H3rRYoqahntuYXp7SplCDN8Zgbz+oQ4nyyqzllXe9ea8k9Rd7oORp 1eX3TPlSoaE0rpIu4ToWMU5lSDTATZW3ooMzeNCmdu8TMURIEPZuA0QVk/y6EX5lhiJB vjKAZa0miDEBl3jFslmc6p3EbUJZGmqRwtqPtrit81o2geBpB4/czEnwm6h951KaoxLC djaw== X-Gm-Message-State: APjAAAXiVj0Z9UWIHgVWKVqDX+fpwgceNe66+dzM9dStwhhThDzGR7hL 8a8Su1mLQo2WYAJUKdm1XhjmzB1WPRKbyvHWaJlpSPkCg0YD/qrBUwQBTj/g0eGrRlxCqVejE6p FW1bOtgSQgll20XHsspGzCQ== X-Received: by 2002:ac2:50c4:: with SMTP id h4mr5868993lfm.15.1571409623105; Fri, 18 Oct 2019 07:40:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1oW0Pilzv/j0cmg+z4cw3p8bFy2vRDcI9r/1HPABPVkHKj9AY00UN3Q8sVxFdt9bvMFmBOQ== X-Received: by 2002:ac2:50c4:: with SMTP id h4mr5868984lfm.15.1571409622930; Fri, 18 Oct 2019 07:40:22 -0700 (PDT) Received: from alrua-x1.borgediget.toke.dk ([2a00:7660:6da:443::2]) by smtp.gmail.com with ESMTPSA id u26sm2688629lfd.19.2019.10.18.07.40.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2019 07:40:21 -0700 (PDT) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 0EDCF1804B6; Fri, 18 Oct 2019 16:40:21 +0200 (CEST) Subject: [PATCH v3 0/4] Add Airtime Queue Limits (AQL) to mac80211 From: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= To: Johannes Berg Date: Fri, 18 Oct 2019 16:40:21 +0200 Message-ID: <157140962094.2866668.3383184317264069493.stgit@toke.dk> User-Agent: StGit/0.20 MIME-Version: 1.0 X-MC-Unique: ukYW5mpUPt6m6kBn3JXUEQ-1 X-Mimecast-Spam-Score: 0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191018_074030_203986_8F6E4F82 X-CRM114-Status: GOOD ( 11.25 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [205.139.110.61 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kan Yan , Rajkumar Manoharan , Kevin Hayes , make-wifi-fast@lists.bufferbloat.net, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org, John Crispin , Lorenzo Bianconi , Felix Fietkau Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org 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 Kan's patch to do the throttling in mac80211, and replaces the driver API with the 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 extracting 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). So I'm hoping someone with a proper testing setup can take the whole thing for a spin... :) The series is also available in my git repo here: https://git.kernel.org/pub/scm/linux/kernel/git/toke/linux.git/log/?h=mac80211-aql-02 Changelog: v3: - Move the tx_time_est field so it's shared with ack_frame_id, and use units of 4us for the value stored in it. - Move the addition of the Ethernet header size into ieee80211_calc_expected_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øiland-Jørgensen (3): mac80211: Shrink the size of ack_frame_id to make room for tx_time_est 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 | 30 +++- net/mac80211/Makefile | 3 net/mac80211/airtime.c | 377 ++++++++++++++++++++++++++++++++++++++++++++ net/mac80211/cfg.c | 2 net/mac80211/debugfs.c | 78 +++++++++ net/mac80211/debugfs_sta.c | 43 ++++- net/mac80211/ieee80211_i.h | 8 + net/mac80211/main.c | 9 + net/mac80211/sta_info.c | 32 ++++ net/mac80211/sta_info.h | 8 + net/mac80211/status.c | 38 ++++ net/mac80211/tx.c | 67 +++++++- 13 files changed, 684 insertions(+), 18 deletions(-) create mode 100644 net/mac80211/airtime.c