Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2629590ybl; Thu, 29 Aug 2019 10:41:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCXZPlIiEi4FT9PS5KTLaqBy1DQ1PtrvmxV6ONpdEATkySbZc27FX24/zc8iPn2EBYvCQI X-Received: by 2002:a62:3744:: with SMTP id e65mr13313315pfa.69.1567100492695; Thu, 29 Aug 2019 10:41:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567100492; cv=none; d=google.com; s=arc-20160816; b=pk36QIRzAnN41qOQhIxD95Sh0MD198r6HAIsfyistPsZZA2Mz99YI/mCgVIkWq/v3K 4+4TTNzCEWCnEoPWUNZFYt6nBuiMyFz0VGZtXQrv8KfpO3ubqYg1M7Lh8aphfBeD9Caj kkus1QMmtWorIdCAe7OknTOwA6n1R+g3x4vskkjrV1ndhfz6WlCTaUCuwuhy6WK1Qjsk 0okDlzMLtQpji6UM3bfDc01BZv6++SDIqfsVuldDqTliaCqvtUhTuEt05BYDhy+UxgOa jBuAykhn6u7oE8sDJO9/VlO00oS0m0wVDfwKh7BmOCa/RuYueouC1mbHk3aBYrAnL3uN pfHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature:dkim-signature; bh=iUspPaWO7bz1WQQHL+4C8e2ZUr0VjHtRTwhClSmnIXo=; b=q6Qivlhf2j+5FBUKoHd7Rmrub9LwnS2a0ymYC4Tcf5S5Urm5VFqCvWq3CimM0Y4JGM XYqRe4yaklETJemv8kNoQzTuhv2UgVUhYsst9w8KqOHpYQsHibNoCPPWUTh9AACgbsqW lHzMbp1Kd2JtWknlDePhRUU0JFiF/cbIVKsJrDGdyW6oHDsClBTDRZnSycW5DJ2rtv11 QpJj8Jd6BL9koV+ShFOiMZaUkBCEVfXRZnWCN2WDz7faerqAiXUpstcCLjFBf+NPV6Or un9h1bs6Ptec94NLlQjl/U1QKaDBO4N5sF7cwudVFr4AaIp6RJ1ixtzlvVY7Mc7eNkKz 7NFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=GGNOVSsZ; dkim=pass header.i=@codeaurora.org header.s=default header.b=juG+sVLB; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a24si3216863pfi.205.2019.08.29.10.41.11; Thu, 29 Aug 2019 10:41:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=GGNOVSsZ; dkim=pass header.i=@codeaurora.org header.s=default header.b=juG+sVLB; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727410AbfH2Rj3 (ORCPT + 99 others); Thu, 29 Aug 2019 13:39:29 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:46722 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727228AbfH2Rj3 (ORCPT ); Thu, 29 Aug 2019 13:39:29 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 178B97B16A; Thu, 29 Aug 2019 12:34:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1567082050; bh=IQh+1Blz9wUhzZHO89vK8iZ9hrzgRVa01+tKcFeLg7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GGNOVSsZ/cE3RXbasYv09yif7k8ZUzX0WL9cS6MuMpLt8nxlKKlyYz7GxnftumcGz hBqERctA+Wy+g1cszaLvPTjjplTCerca0/KwPCKZ8m+EUwAvFuw07qpzDEjfruVc76 Vg4bCgLrZvR85p1bi8yijK7B/uono48/iXIYm68Y= 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 BDB8F88A29; Wed, 28 Aug 2019 13:16:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1566998203; bh=IQh+1Blz9wUhzZHO89vK8iZ9hrzgRVa01+tKcFeLg7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=juG+sVLBFl733A3TNE2rdgpI27+EhdQcEjhz0u8EzBMNyt5EizKeAHBbWoGfZYnfC QEadNU61onrkJg2YwZV8dQHPP0W2T25vnuqjJ0r6kNXpkO2njK2oq4LxtMtLou1Bwh 56tcemw1mrzmm10A+0kkyWn3dmG7pat6kWokNcLg= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org BDB8F88A29 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 Cc: linux-wireless@vger.kernel.org Subject: [PATCH v3 7/8] ath10k: enable alt data of TX path for sdio Date: Wed, 28 Aug 2019 21:16:16 +0800 Message-Id: <1566998177-2658-8-git-send-email-wgong@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1566998177-2658-1-git-send-email-wgong@codeaurora.org> References: <1566998177-2658-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 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 --- v2:no change v3:change some code style drivers/net/wireless/ath/ath10k/core.c | 19 +++++++++++++++++-- drivers/net/wireless/ath/ath10k/htc.c | 11 +++++++++-- drivers/net/wireless/ath/ath10k/htc.h | 11 +++++++++-- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 9841533..9fd07c7 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); @@ -698,9 +708,14 @@ static void ath10k_init_sdio(struct ath10k *ar, enum ath10k_firmware_mode mode) param &= ~HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET; /* Alternate credit size of 1544 as used by SDIO firmware is - * not big enough for mac80211 / native wifi frames. disable it + * not big enough for mac80211 / native wifi frames. disable it. + * If alternate credit size of 1556 as used by SDIO firmware is + * big enough for mac80211 / native wifi frames. enable it */ - param &= ~HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE; + if (alt_data && mode == ATH10K_FIRMWARE_MODE_NORMAL) + param |= HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE; + else + param &= ~HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE; if (mode == ATH10K_FIRMWARE_MODE_UTF) param &= ~HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET; diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c index 5269168..04298e1 100644 --- a/drivers/net/wireless/ath/ath10k/htc.c +++ b/drivers/net/wireless/ath/ath10k/htc.c @@ -940,12 +940,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); @@ -1097,6 +1100,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 7b8e0d0..f3a6ebb 100644 --- a/drivers/net/wireless/ath/ath10k/htc.h +++ b/drivers/net/wireless/ath/ath10k/htc.h @@ -141,8 +141,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 { @@ -379,6 +385,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); -- 1.9.1