From patchwork Tue Oct 15 17:18:57 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: 11191301 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 7BF3C1575 for ; Tue, 15 Oct 2019 17:19:14 +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 5858B20854 for ; Tue, 15 Oct 2019 17:19:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mIL6YK74"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="a8ygi3Z5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5858B20854 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=wDdIlc1TnWWQPsSeqLvC4uc6i6SFcpOzht7q8WI/J8w=; b=mIL6YK745/2fz/ gdQsV3lgl57c1Uy4nEbFxGRfVEfxQZRnvIJCooOxjA+d0B/jcFwx3SEC/+lHs7H0BrOkECQCFf7Ze OpmMomncUH6Sc5rWwS4zFNoR3veNBYnSP1ien9oNcQ8fchQsTav6pk0yhLrLAmdp8zTORc38UKc/0 22TvDgh0Yz2wV/Ddq7LngXlXhq2ZswAee5mq7avKgAMTfJwvslBD+WfP5cf1TZAQjzTmDHjLmMbsY hFGvmwEdhRxfGRT/cyjJgy+JxpSDy9n6uJhy88/WdMHZOk59cLADw0Qp8unVsjlBra2wRD9ajW5XQ EZCj0Y/vKvqYFCGoAXJw==; 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 1iKQTU-0006zT-E8; Tue, 15 Oct 2019 17:19:08 +0000 Received: from us-smtp-2.mimecast.com ([207.211.31.81] helo=us-smtp-delivery-1.mimecast.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iKQTR-0006yN-Ad for ath10k@lists.infradead.org; Tue, 15 Oct 2019 17:19:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571159943; 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=aiICBq+klD7gts5SC7Lw3KPTDcrLbo2thywzxGgTe5U=; b=a8ygi3Z5h1JihYNzjpsxf73M0d5eNV0TVdqPxenhfRFl5uO3iAUgymhOCQS/BFtrgxvPCN ZPmFPazC/Luiio3y0xHMXjiEB6jzXYclNE5Kax7J34PtpV5Xety5ONe+7+5nRQDvbeQjWw zvSDU7ZLPFKAapPSfP5t6yRUvUa6f2I= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-171-3Q168Y-SNr6yUlJJR2tqtA-1; Tue, 15 Oct 2019 13:19:01 -0400 Received: by mail-lj1-f198.google.com with SMTP id e3so4044568ljj.16 for ; Tue, 15 Oct 2019 10:19:00 -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=Y9ZicZO6b29gZwYmEAgc0Vga9o23GaUpVran/Wv7Gas=; b=LXutZqWF55LX3JYxR0leu6ddwbflHcygW2oK7jIHIqrwv7fsPoOyLG/znCuxFbjcWd S9v1XFqPLYnmQ38/EIR/I0zssGrn9PBZJIP/kMbGH2N/hrgKakqYsr5Io1dY2mK4+/ii sf2uqDKJ9UTokmFijk4CeyMOOfEfWKUUGpAINucp1SdXPRDwx3K6h3XiRm9rxbGX9k3A JxYmeGPiYQRz5VHvd0BuBcmT4UzYLafnUq0hVe/JGy6OContLsRdSEVdNDGiZsPZRbgX u6MSmlSgWmlykw5JcX1naijm4bsd3raK/Sat+TdriD1Ie3289tSVSbX62VfQESMZQQpd QS+A== X-Gm-Message-State: APjAAAWfcSoqAFVZqtMOgL3377MMKcxy7D2icaDbc5tHKHqrFRpdutrZ XcM2HjCUGEqw8BV4/rRSneD4r514am/wlndi+f/9iSQJhFZk6SVtvtD6ukBwetESJ/pN/whxgMj CRzXOV+EllOZJo7/ZvlCYdA== X-Received: by 2002:ac2:46d9:: with SMTP id p25mr9407711lfo.174.1571159939659; Tue, 15 Oct 2019 10:18:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4GGvaQ++TIAujXuUFP1I9PfblNVucnrgy1g/FJr66h0DYi2to2kGkxbuh0iD28epJYmQE3Q== X-Received: by 2002:ac2:46d9:: with SMTP id p25mr9407696lfo.174.1571159939436; Tue, 15 Oct 2019 10:18:59 -0700 (PDT) Received: from alrua-x1.borgediget.toke.dk ([2a00:7660:6da:443::2]) by smtp.gmail.com with ESMTPSA id v1sm5331272lfa.87.2019.10.15.10.18.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2019 10:18:58 -0700 (PDT) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id A2AF31803A8; Tue, 15 Oct 2019 19:18:57 +0200 (CEST) Subject: [PATCH v2 0/4] Add Airtime Queue Limits (AQL) to mac80211 From: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= To: Johannes Berg Date: Tue, 15 Oct 2019 19:18:57 +0200 Message-ID: <157115993755.2500430.12214017471129215800.stgit@toke.dk> User-Agent: StGit/0.20 MIME-Version: 1.0 X-MC-Unique: 3Q168Y-SNr6yUlJJR2tqtA-1 X-Mimecast-Spam-Score: 0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191015_101905_843480_5C96F7FB X-CRM114-Status: GOOD ( 10.94 ) 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 [207.211.31.81 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 Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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: 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: Rearrange ieee80211_tx_info 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 | 52 +++++- net/mac80211/Makefile | 3 net/mac80211/airtime.c | 375 ++++++++++++++++++++++++++++++++++++++++++++ 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 | 62 +++++++ 12 files changed, 693 insertions(+), 22 deletions(-) create mode 100644 net/mac80211/airtime.c