From patchwork Tue Aug 27 11:01:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Gong X-Patchwork-Id: 11116699 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 DBF311395 for ; Tue, 27 Aug 2019 11:03:44 +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 B801120674 for ; Tue, 27 Aug 2019 11:03:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JZreP0ee"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="W1mriuvI"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="cAgQ2Ul2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B801120674 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=CtwkP4bIwR03l/Z0Xe3tCHFCO/c4RU5rbwBeLjhOFmk=; b=JZreP0ee1P6m2+Ecyh0wdE0xuH xJ6RKj35qu2pC7TMZacGF1CTCALU2Iwa95B4s/DOPo7dgBwpAfYaX7Bcw5tgsC/K3pP7WfnvSTx/3 b6jyh2CHD7PSgv20+42onGldx41AG17/kRD6FaLkmV/By6aZUCm9w6FCmxO7PzaAUCufbWilKAmTF wwiEv8ScnPRd8NfpXXiYfc8Z1lKmpffOJ2ycrEWvjuTT4K0MkdhGMILtwx4RUDo73UMn0urdu7EIB uiHUCcFj+N6v/m/ZAvqg19Eaq91Y1yS9Jy7l6YT0o7xoULFuZcq4QOY2K6IsU1Os/DnroizxjM+4/ kqraW3tA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i2ZGJ-0003jz-U7; Tue, 27 Aug 2019 11:03:44 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i2ZFc-0003A0-Kz for ath10k@lists.infradead.org; Tue, 27 Aug 2019 11:03:02 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id DBD2C61C0B; Tue, 27 Aug 2019 11:02:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1566903780; bh=NbCCwyT1TMgL5e+Laamk3/o5vb1zXr2GV1B8OIc8M5o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W1mriuvIDVvwVS2Ta0gN7KvIuGJocKr7/yD39Igay9rWdWCxk0NvFwjALguSjhbB/ 1JGgRqAQ86eky8YT9kcvLEkR7oeuCsPWuBn5IxtfIDy7jgd8DYVCnQOXWfgCQMAViJ 5TFKor6VozEOiP/ks3UOzOYjqmgGs/BIe7h+ZzLI= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED,SPF_NONE autolearn=no autolearn_force=no version=3.4.0 Received: from wgong-HP-Z240-SFF-Workstation.qca.qualcomm.com (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 207FA61C73; Tue, 27 Aug 2019 11:02:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1566903745; bh=NbCCwyT1TMgL5e+Laamk3/o5vb1zXr2GV1B8OIc8M5o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cAgQ2Ul2TSU6VnPYoehXjkq4L+fyUfYqLPuESgDxAsN5VgXFL0oUrv+/BivoAcLaz wyRE/rZN4ppeUqPX4xuvH03JxPKna3Gda7BfR20UD7ktGb8SL3Qd6hYNvWoLbHLYGy bGhb+mQlVXFCqSGRWxKj0gRqQpCwylVLIechd6o8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 207FA61C73 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 Subject: [PATCH v2 6/7] ath10k: enable alt data of TX path for sdio Date: Tue, 27 Aug 2019 19:01:46 +0800 Message-Id: <1566903707-27536-7-git-send-email-wgong@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1566903707-27536-1-git-send-email-wgong@codeaurora.org> References: <1566903707-27536-1-git-send-email-wgong@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190827_040300_815422_408D2DC7 X-CRM114-Status: GOOD ( 14.91 ) 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 [198.145.29.96 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -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 -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: linux-wireless@vger.kernel.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org The default credit size is 1792 bytes, but the IP mtu is 1500 bytes, then it has about 290 bytes's waste for each data packet on sdio transfer path for TX bundle, it will reduce the transmission utilization ratio for data packet. This patch enable the small credit size in firmware, firmware will use the new credit size 1556 bytes, it will increase the transmission utilization ratio for data packet on TX patch. It results in significant performance improvement on TX path. This patch only effect sdio chip, it will not effect PCI, SNOC etc. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00017-QCARMSWP-1. Signed-off-by: Wen Gong --- drivers/net/wireless/ath/ath10k/core.c | 16 ++++++++++++++++ drivers/net/wireless/ath/ath10k/htc.c | 11 +++++++++-- drivers/net/wireless/ath/ath10k/htc.h | 11 +++++++++-- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 351f4ed..7593d19 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -31,6 +31,7 @@ static unsigned int ath10k_cryptmode_param; static bool uart_print; static bool disable_tx_comp = true; +static bool alt_data = true; static bool skip_otp; static bool rawmode; static bool fw_diag_log; @@ -45,6 +46,15 @@ /* If upper layer need the TX complete status, it can enable tx complete */ module_param(disable_tx_comp, bool, 0644); + +/* alt_data is only used for sdio chip, for previous version of firmware, its + * alt data size is 1544 which is not enough for native wifi, so it need to + * alt_data for the firmware. + * If the firmware has changed alt data size to 1556, then it can enable + * alt_data for the firmware. + * alt_data will not effect PCI, SNOC etc. + */ +module_param(alt_data, bool, 0644); module_param(skip_otp, bool, 0644); module_param(rawmode, bool, 0644); module_param(fw_diag_log, bool, 0644); @@ -701,6 +711,12 @@ static void ath10k_init_sdio(struct ath10k *ar, enum ath10k_firmware_mode mode) */ param &= ~HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE; + /* If alternate credit size of 1556 as used by SDIO firmware is + * big enough for mac80211 / native wifi frames. enable it + */ + if (alt_data && mode == ATH10K_FIRMWARE_MODE_NORMAL) + param |= HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE; + if (mode == ATH10K_FIRMWARE_MODE_UTF) param &= ~HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET; else diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c index e0eb5f0..5cacab6 100644 --- a/drivers/net/wireless/ath/ath10k/htc.c +++ b/drivers/net/wireless/ath/ath10k/htc.c @@ -938,12 +938,15 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc) */ if (htc->control_resp_len >= sizeof(msg->hdr) + sizeof(msg->ready_ext)) { + htc->alt_data_credit_size = + __le16_to_cpu(msg->ready_ext.reserved) & 0x0fff; htc->max_msgs_per_htc_bundle = min_t(u8, msg->ready_ext.max_msgs_per_htc_bundle, HTC_HOST_MAX_MSG_PER_RX_BUNDLE); ath10k_dbg(ar, ATH10K_DBG_HTC, - "Extended ready message. RX bundle size: %d\n", - htc->max_msgs_per_htc_bundle); + "Extended ready message. RX bundle size: %d, alt size:%d\n", + htc->max_msgs_per_htc_bundle, + htc->alt_data_credit_size); } INIT_WORK(&ar->bundle_tx_work, ath10k_htc_bundle_tx_work); @@ -1095,6 +1098,10 @@ int ath10k_htc_connect_service(struct ath10k_htc *htc, ep->tx_credits = tx_alloc; ep->tx_credit_size = htc->target_credit_size; + if (conn_req->service_id == ATH10K_HTC_SVC_ID_HTT_DATA_MSG && + htc->alt_data_credit_size != 0) + ep->tx_credit_size = htc->alt_data_credit_size; + /* copy all the callbacks */ ep->ep_ops = conn_req->ep_ops; diff --git a/drivers/net/wireless/ath/ath10k/htc.h b/drivers/net/wireless/ath/ath10k/htc.h index d805ea5..f0a9e60af 100644 --- a/drivers/net/wireless/ath/ath10k/htc.h +++ b/drivers/net/wireless/ath/ath10k/htc.h @@ -139,8 +139,14 @@ struct ath10k_htc_ready_extended { struct ath10k_htc_ready base; u8 htc_version; /* @enum ath10k_htc_version */ u8 max_msgs_per_htc_bundle; - u8 pad0; - u8 pad1; + union { + __le16 reserved; + struct { + u8 pad0; + u8 pad1; + } __packed; + } __packed; + } __packed; struct ath10k_htc_conn_svc { @@ -377,6 +383,7 @@ struct ath10k_htc { int total_transmit_credits; int target_credit_size; u8 max_msgs_per_htc_bundle; + int alt_data_credit_size; }; int ath10k_htc_init(struct ath10k *ar);