From patchwork Tue Feb 11 12:26:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11375355 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 902A7924 for ; Tue, 11 Feb 2020 12:26:25 +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 6E4B920714 for ; Tue, 11 Feb 2020 12:26:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SsTEYO2H" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E4B920714 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=phrozen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=ath11k-bounces+patchwork-ath11k=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:Subject:To :From: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=TuqphAP2ggtg6ezsZ5hYHaMktCG/huKmBrA0lmbFxu8=; b=SsTEYO2HJHSOJJ Pw0wmP4orfD2rzQooNnYBgHlm4XckYBseGwqtAoq9dSl1bLdVi7GLgRTuwl5jV3kHfWHRfuKbsEjw VWTnjv0EhAlSXMhY5YRyD98ewlsaUXrtUFaVroMgx6PvnwLo0+YUZbq3owYtNI5E6PM/MsoE8Hjsf l0QUg31zPO3p/39AXHb3YbYEtrnNC2gqWa/gt7G3AjnorpU5RbsYr1F9bT8vaYfuLob5SR6GMGA0f Fz8uFFQUWGy+BgIwGxaMS8bZ+OGlzr4CPbGkpCKp/UI8Soqzgr0n6GysBNwZtWvgaDOfNuT/ZKIhN cPJDADiaO/4hXllULg/w==; 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 1j1UcR-0003Q6-U5; Tue, 11 Feb 2020 12:26:23 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1UcP-0003PC-09 for ath11k@lists.infradead.org; Tue, 11 Feb 2020 12:26:22 +0000 Received: from [46.59.221.152] (helo=bertha.fritz.box) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1j1UcH-000356-04; Tue, 11 Feb 2020 13:26:13 +0100 From: John Crispin To: Johannes Berg , Kalle Valo Subject: [PATCH 1/2] mac80211: allow setting queue_len for drivers not using wake_tx_queue Date: Tue, 11 Feb 2020 13:26:04 +0100 Message-Id: <20200211122605.13002-1-john@phrozen.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200211_042621_201276_26DFCE57 X-CRM114-Status: GOOD ( 10.76 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, John Crispin Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org Currently a mac80211 driver can only set the txq_limit when using wake_tx_queue. Not all drivers use wake_tx_queue. This patch adds a new element to wiphy allowing a driver to set a custom tx_queue_len and the code that will apply it in case it is set. The current default is 1000 which is too low for ath11k when doing HE rates. Signed-off-by: John Crispin --- include/net/cfg80211.h | 2 ++ net/mac80211/iface.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 0939645567e9..254080a04ee3 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -4742,6 +4742,8 @@ struct wiphy { u32 txq_memory_limit; u32 txq_quantum; + unsigned long tx_queue_len; + u8 support_mbssid:1, support_only_he_mbssid:1; diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 3c00408e9c8c..128b3468d13e 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -1834,6 +1834,10 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, if_setup, txqs, 1); if (!ndev) return -ENOMEM; + + if (!local->ops->wake_tx_queue && local->hw.wiphy->tx_queue_len) + ndev->tx_queue_len = local->hw.wiphy->tx_queue_len; + dev_net_set(ndev, wiphy_net(local->hw.wiphy)); ndev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); From patchwork Tue Feb 11 12:26:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11375357 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 BD5ED139A for ; Tue, 11 Feb 2020 12:26:25 +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 9C48520714 for ; Tue, 11 Feb 2020 12:26:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CWz5vy/0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C48520714 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=phrozen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=ath11k-bounces+patchwork-ath11k=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:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oFnOx+LCRdSFSbHB86qlWa3JNvSXLfKFArzi60vTCR4=; b=CWz5vy/0Xk89NK OQniaVGXJ/YQx3MIm/HfcGeD9cWzI2gnhvbTveT0A1Hn0hQpqx9nEBIo9YrIhUXuy1VThDeiTUi7o YCFdr7umB0tPpHc/ezypuhJlcc2srAQtbJuoBgMXD/PB0G3/p+gue6LLNUUKks+fOPU+ZQs6VWv+s 5Saw4fhFLY7b1G8H9pHww5CGVUFo4kMKBUF5r92uXO8vwBKHagla7IYS2NqA7Ce1+MpzMOcLzlvtd mBAcH+g4u3xjIhRYpsQ5LuDBN2vqtdVPlp+/iFQme+FoStiNJtb0YHIPOdACb/8wwwqZCnSgZBysg kZLcEeHBhyD2TF5eTBTw==; 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 1j1UcS-0003QQ-4q; Tue, 11 Feb 2020 12:26:24 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1UcO-0003PD-WD for ath11k@lists.infradead.org; Tue, 11 Feb 2020 12:26:22 +0000 Received: from [46.59.221.152] (helo=bertha.fritz.box) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1j1UcH-000356-8p; Tue, 11 Feb 2020 13:26:13 +0100 From: John Crispin To: Johannes Berg , Kalle Valo Subject: [PATCH 2/2] ath11k: set queue_len to 4096 Date: Tue, 11 Feb 2020 13:26:05 +0100 Message-Id: <20200211122605.13002-2-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200211122605.13002-1-john@phrozen.org> References: <20200211122605.13002-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200211_042621_201412_3EE44010 X-CRM114-Status: GOOD ( 10.11 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, John Crispin Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org The driver currently does not use wake_txq_queue. This leads to the tx_queue_len being defaulted to 1000. Setting this parameter will change the queue_len to 4096 which is more fitting for HE. Signed-off-by: John Crispin --- drivers/net/wireless/ath/ath11k/hw.h | 1 + drivers/net/wireless/ath/ath11k/mac.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/hw.h b/drivers/net/wireless/ath/ath11k/hw.h index dd39333ec0ea..9973477ae373 100644 --- a/drivers/net/wireless/ath/ath11k/hw.h +++ b/drivers/net/wireless/ath/ath11k/hw.h @@ -62,6 +62,7 @@ #define TARGET_RX_BATCHMODE 1 #define ATH11K_HW_MAX_QUEUES 4 +#define ATH11K_QUEUE_LEN 4096 #define ATH11k_HW_RATECODE_CCK_SHORT_PREAM_MASK 0x4 diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 139ecbcf0179..c0606e4a8967 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -6025,6 +6025,7 @@ static int __ath11k_mac_register(struct ath11k *ar) ar->hw->wiphy->max_ap_assoc_sta = ar->max_num_stations; ar->hw->queues = ATH11K_HW_MAX_QUEUES; + ar->hw->wiphy->tx_queue_len = ATH11K_QUEUE_LEN; ar->hw->offchannel_tx_hw_queue = ATH11K_HW_MAX_QUEUES - 1; ar->hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF;