From patchwork Wed Aug 8 10:40:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Gong X-Patchwork-Id: 10559731 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 944FA13AC for ; Wed, 8 Aug 2018 10:40:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 836272A601 for ; Wed, 8 Aug 2018 10:40:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 77A192A631; Wed, 8 Aug 2018 10:40:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20B422A601 for ; Wed, 8 Aug 2018 10:40:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726894AbeHHM7k (ORCPT ); Wed, 8 Aug 2018 08:59:40 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:35540 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726793AbeHHM7k (ORCPT ); Wed, 8 Aug 2018 08:59:40 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 353E860B73; Wed, 8 Aug 2018 10:40:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1533724833; bh=245hdoBhLHDU5Fld0aDI+GOmR/kanzJfdNkt8uEmr0A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FhJEwPlUnj3F58ub85uMhqxTub4RGjzsIELco64Z3P+kYSrxAtZfHZdk81sbJsFDI GQIKRXoi5WxKXJJAzhgErJJRonToAigkjHUqRL0kCZRZAzoe3OqbDDLW4ds8qzv70Y AY0hcucBAZHfwrFFzTmV8cspQMLbJAl+CH1AEKtA= Received: from localhost.localdomain (unknown [180.166.53.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: wgong@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 084BA606FA; Wed, 8 Aug 2018 10:40:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1533724832; bh=245hdoBhLHDU5Fld0aDI+GOmR/kanzJfdNkt8uEmr0A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DJwJ0gmc65Sgyq66YWOFXKyrba+1X4g1E0PXAh82lAs8HztiPJeb1jS6J+bubV7nI 6kEF0k5EFNcTEkEX+eylbYSwMD0DF2SgBnOZDXSg3a721AorpEk35Fe/KR1v7ACKUL Q+DzkzRCi68sjr+ooTX4qEJAVva91h7OYSCJhQdM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 084BA606FA Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=wgong@codeaurora.org From: Wen Gong To: ath10k@lists.infradead.org, johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org Subject: [PATCH v2 1/2] mac80211: Change sk_pacing_shift saved to ieee80211_hw Date: Wed, 8 Aug 2018 18:40:01 +0800 Message-Id: <1533724802-30944-2-git-send-email-wgong@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1533724802-30944-1-git-send-email-wgong@codeaurora.org> References: <1533724802-30944-1-git-send-email-wgong@codeaurora.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add the skb_pacing_shift adjustment, this change make it configurable for other driver. If no other driver set it, then mac8011 will use the default value. Signed-off-by: Wen Gong --- V2: -add the description for tx_sk_pacing_shift include/net/mac80211.h | 5 +++++ net/mac80211/main.c | 2 ++ net/mac80211/tx.c | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 5790f55..9804d65 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -2290,6 +2290,10 @@ enum ieee80211_hw_flags { * supported by HW. * @max_nan_de_entries: maximum number of NAN DE functions supported by the * device. + * + * @tx_sk_pacing_shift: The TCP stack allow more than a single ms of data + * to be queued in the stack. The value is a bit-shift of 1 second, e.g. 8 + * is ~4ms of queued data. It only affects local TCP sockets. */ struct ieee80211_hw { struct ieee80211_conf conf; @@ -2325,6 +2329,7 @@ struct ieee80211_hw { u8 n_cipher_schemes; const struct ieee80211_cipher_scheme *cipher_schemes; u8 max_nan_de_entries; + u8 tx_sk_pacing_shift; }; static inline bool _ieee80211_hw_check(struct ieee80211_hw *hw, diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 4fb2709..23490fa 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -594,6 +594,8 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len, local->ops = ops; local->use_chanctx = use_chanctx; + local->hw.tx_sk_pacing_shift = 8; + /* set up some defaults */ local->hw.queues = 1; local->hw.max_rates = 1; diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 6a79d56..80855a8 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -3601,7 +3601,7 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb, * second, so 8 is ~4ms of queued data. Only affects local TCP * sockets. */ - sk_pacing_shift_update(skb->sk, 8); + sk_pacing_shift_update(skb->sk, sdata->local->hw.tx_sk_pacing_shift); fast_tx = rcu_dereference(sta->fast_tx); From patchwork Wed Aug 8 10:40:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Gong X-Patchwork-Id: 10559733 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D145E13AC for ; Wed, 8 Aug 2018 10:40:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF2A52A601 for ; Wed, 8 Aug 2018 10:40:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B3B752A631; Wed, 8 Aug 2018 10:40:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43A102A630 for ; Wed, 8 Aug 2018 10:40:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726957AbeHHM7l (ORCPT ); Wed, 8 Aug 2018 08:59:41 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:35592 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726793AbeHHM7l (ORCPT ); Wed, 8 Aug 2018 08:59:41 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 9334E60B23; Wed, 8 Aug 2018 10:40:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1533724834; bh=Oab5dVF/tHJ3gbEG+S9NUCWSiYQ7jW0ByzghU7IEvpk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cnk71QxGkz6VAoOUeTRqO8O4D2KXoLe0gu/4d/PQPgzKUlOBV74qCcZ+10lZgTuZi Je3+hxoMJfeLixCzgdXkvwGs8pQckheLeAXuv+M8/Q31i0hJKgG/xLsd/l1ApK4LaI LVi/zdgT5Zp7/geoedXImTx22RzYaqA6omlGMkOs= Received: from localhost.localdomain (unknown [180.166.53.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: wgong@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5224A60B74; Wed, 8 Aug 2018 10:40:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1533724834; bh=Oab5dVF/tHJ3gbEG+S9NUCWSiYQ7jW0ByzghU7IEvpk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cnk71QxGkz6VAoOUeTRqO8O4D2KXoLe0gu/4d/PQPgzKUlOBV74qCcZ+10lZgTuZi Je3+hxoMJfeLixCzgdXkvwGs8pQckheLeAXuv+M8/Q31i0hJKgG/xLsd/l1ApK4LaI LVi/zdgT5Zp7/geoedXImTx22RzYaqA6omlGMkOs= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5224A60B74 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=wgong@codeaurora.org From: Wen Gong To: ath10k@lists.infradead.org, johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org Subject: [PATCH v2 2/2] ath10k: Set sk_pacing_shift to 6 for 11AC WiFi chips Date: Wed, 8 Aug 2018 18:40:02 +0800 Message-Id: <1533724802-30944-3-git-send-email-wgong@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1533724802-30944-1-git-send-email-wgong@codeaurora.org> References: <1533724802-30944-1-git-send-email-wgong@codeaurora.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Upstream kernel has an interface to help adjust sk_pacing_shift to help improve TCP UL throughput. The sk_pacing_shift is 8 in mac80211, this is based on test with 11N WiFi chips with ath9k. For QCA6174/QCA9377 PCI 11AC chips, the 11AC VHT80 TCP UL throughput testing result shows 6 is the optimal. Overwrite the sk_pacing_shift to 6 in ath10k driver for QCA6174/9377 PCI. Tested with QCA6174 PCI with firmware WLAN.RM.4.4.1-00109-QCARMSWPZ-1, but this will also affect QCA9377 PCI. It's not a regression with new firmware releases. There have 2 test result of different settings: ARM CPU based device with QCA6174A PCI with different sk_pacing_shift: sk_pacing_shift throughput(Mbps) CPU utilization 6 500(-P5) ~75% idle, Focus on CPU1: ~14%idle 7 454(-P5) ~80% idle, Focus on CPU1: ~4%idle 8 288 ~90% idle, Focus on CPU1: ~35%idle 9 ~200 ~92% idle, Focus on CPU1: ~50%idle 5G TCP UL VTH80 on X86 platform with QCA6174A PCI with sk_packing_shift set to 6: tcp_limit_output_bytes throughput(Mbps) default(262144)+1 Stream 336 default(262144)+2 Streams 558 default(262144)+3 Streams 584 default(262144)+4 Streams 602 default(262144)+5 Streams 598 changed(2621440)+1 Stream 598 changed(2621440)+2 Streams 601 Signed-off-by: Wen Gong --- V2: -add the optimal for configurable for each hardware type drivers/net/wireless/ath/ath10k/core.c | 6 ++++++ drivers/net/wireless/ath/ath10k/hw.h | 6 ++++++ drivers/net/wireless/ath/ath10k/mac.c | 3 +++ 3 files changed, 15 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 85c58eb..fbd13ec 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -189,6 +189,7 @@ .per_ce_irq = false, .shadow_reg_support = false, .rri_on_ddr = false, + .tx_sk_pacing_shift = SK_PACING_SHIFT_6174, }, { .id = QCA6174_HW_2_1_VERSION, @@ -221,6 +222,7 @@ .per_ce_irq = false, .shadow_reg_support = false, .rri_on_ddr = false, + .tx_sk_pacing_shift = SK_PACING_SHIFT_6174, }, { .id = QCA6174_HW_3_0_VERSION, @@ -253,6 +255,7 @@ .per_ce_irq = false, .shadow_reg_support = false, .rri_on_ddr = false, + .tx_sk_pacing_shift = SK_PACING_SHIFT_6174, }, { .id = QCA6174_HW_3_2_VERSION, @@ -288,6 +291,7 @@ .per_ce_irq = false, .shadow_reg_support = false, .rri_on_ddr = false, + .tx_sk_pacing_shift = SK_PACING_SHIFT_6174, }, { .id = QCA99X0_HW_2_0_DEV_VERSION, @@ -443,6 +447,7 @@ .per_ce_irq = false, .shadow_reg_support = false, .rri_on_ddr = false, + .tx_sk_pacing_shift = SK_PACING_SHIFT_9377, }, { .id = QCA9377_HW_1_1_DEV_VERSION, @@ -477,6 +482,7 @@ .per_ce_irq = false, .shadow_reg_support = false, .rri_on_ddr = false, + .tx_sk_pacing_shift = SK_PACING_SHIFT_9377, }, { .id = QCA4019_HW_1_0_DEV_VERSION, diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h index a274bd8..1f956d6 100644 --- a/drivers/net/wireless/ath/ath10k/hw.h +++ b/drivers/net/wireless/ath/ath10k/hw.h @@ -161,6 +161,9 @@ enum qca9377_chip_id_rev { #define REG_DUMP_COUNT_QCA988X 60 +#define SK_PACING_SHIFT_6174 6 +#define SK_PACING_SHIFT_9377 6 + struct ath10k_fw_ie { __le32 id; __le32 len; @@ -589,6 +592,9 @@ struct ath10k_hw_params { /* Number of bytes to be the offset for each FFT sample */ int spectral_bin_offset; + + /* Number of shift to override the default value of ieee80211_hw*/ + u8 tx_sk_pacing_shift; }; struct htt_rx_desc; diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 95243b4..4f2c07f 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -8361,6 +8361,9 @@ int ath10k_mac_register(struct ath10k *ar) ar->hw->wiphy->max_scan_ssids = WLAN_SCAN_PARAMS_MAX_SSID; ar->hw->wiphy->max_scan_ie_len = WLAN_SCAN_PARAMS_MAX_IE_LEN; + if (ar->hw_params.tx_sk_pacing_shift != 0) + ar->hw->tx_sk_pacing_shift = ar->hw_params.tx_sk_pacing_shift; + ar->hw->vif_data_size = sizeof(struct ath10k_vif); ar->hw->sta_data_size = sizeof(struct ath10k_sta); ar->hw->txq_data_size = sizeof(struct ath10k_txq);