diff mbox

[RFC/RFT] ath10k: disable wake_tx_queue for older devices

Message ID 1463489221-24989-1-git-send-email-michal.kazior@tieto.com (mailing list archive)
State Not Applicable
Delegated to: Kalle Valo
Headers show

Commit Message

Michal Kazior May 17, 2016, 12:47 p.m. UTC
Some setups suffer performance regressions with
current wake_tx_queue implementation.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
Hi Roman,

Can you give this patch a try and see if it helps
with your performance problems, please?


 drivers/net/wireless/ath/ath10k/core.h |  1 +
 drivers/net/wireless/ath/ath10k/mac.c  | 24 ++++++++++++++++++++++--
 2 files changed, 23 insertions(+), 2 deletions(-)

Comments

Kalle Valo June 2, 2016, 1:14 p.m. UTC | #1
Michal Kazior <michal.kazior@tieto.com> writes:

> Some setups suffer performance regressions with
> current wake_tx_queue implementation.
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
> ---
> Hi Roman,
>
> Can you give this patch a try and see if it helps
> with your performance problems, please?

Did anyone seeing the performance regression manage to test this? It
would be good to get feedback, good or bad, before I push this to 4.7.

Full patch here:

https://patchwork.kernel.org/patch/9111981/
Roman Yeryomin June 8, 2016, 11:39 a.m. UTC | #2
On 2 June 2016 at 16:14, Valo, Kalle <kvalo@qca.qualcomm.com> wrote:
> Michal Kazior <michal.kazior@tieto.com> writes:
>
>> Some setups suffer performance regressions with
>> current wake_tx_queue implementation.
>>
>> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
>> ---
>> Hi Roman,
>>
>> Can you give this patch a try and see if it helps
>> with your performance problems, please?
>
> Did anyone seeing the performance regression manage to test this? It
> would be good to get feedback, good or bad, before I push this to 4.7.
>
> Full patch here:
>
> https://patchwork.kernel.org/patch/9111981/

Sorry, didn't try yet, bad timing for me :(
Will try to test by the end of the week

Regards,
Roman
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kalle Valo June 29, 2016, 8:58 a.m. UTC | #3
Roman Yeryomin <leroi.lists@gmail.com> writes:

> On 2 June 2016 at 16:14, Valo, Kalle <kvalo@qca.qualcomm.com> wrote:
>> Michal Kazior <michal.kazior@tieto.com> writes:
>>
>>> Some setups suffer performance regressions with
>>> current wake_tx_queue implementation.
>>>
>>> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
>>> ---
>>> Hi Roman,
>>>
>>> Can you give this patch a try and see if it helps
>>> with your performance problems, please?
>>
>> Did anyone seeing the performance regression manage to test this? It
>> would be good to get feedback, good or bad, before I push this to 4.7.
>>
>> Full patch here:
>>
>> https://patchwork.kernel.org/patch/9111981/
>
> Sorry, didn't try yet, bad timing for me :(
> Will try to test by the end of the week

Roman, did you have a chance to test this?

Michal, could you submit this patch as a formal patch, please? I think
we should take it even if Roman hasn't tested it.
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 1379054000f9..44e7c2cd2e9b 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -657,6 +657,7 @@  struct ath10k_fw_components {
 struct ath10k {
 	struct ath_common ath_common;
 	struct ieee80211_hw *hw;
+	struct ieee80211_ops *ops;
 	struct device *dev;
 	u8 mac_addr[ETH_ALEN];
 
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 0e24f9ee8bff..5fa3888afa41 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -7396,21 +7396,32 @@  static const struct ieee80211_channel ath10k_5ghz_channels[] = {
 struct ath10k *ath10k_mac_create(size_t priv_size)
 {
 	struct ieee80211_hw *hw;
+	struct ieee80211_ops *ops;
 	struct ath10k *ar;
 
-	hw = ieee80211_alloc_hw(sizeof(struct ath10k) + priv_size, &ath10k_ops);
-	if (!hw)
+	ops = kmemdup(&ath10k_ops, sizeof(ath10k_ops), GFP_KERNEL);
+	if (!ops)
 		return NULL;
 
+	hw = ieee80211_alloc_hw(sizeof(struct ath10k) + priv_size, ops);
+	if (!hw) {
+		kfree(ops);
+		return NULL;
+	}
+
 	ar = hw->priv;
 	ar->hw = hw;
+	ar->ops = ops;
 
 	return ar;
 }
 
 void ath10k_mac_destroy(struct ath10k *ar)
 {
+	struct ieee80211_ops *ops = ar->ops;
+
 	ieee80211_free_hw(ar->hw);
+	kfree(ops);
 }
 
 static const struct ieee80211_iface_limit ath10k_if_limits[] = {
@@ -7838,6 +7849,15 @@  int ath10k_mac_register(struct ath10k *ar)
 			ath10k_warn(ar, "failed to initialise DFS pattern detector\n");
 	}
 
+	/* Current wake_tx_queue implementation imposes a significant
+	 * performance penalty in some setups. The tx scheduling code needs
+	 * more work anyway so disable the wake_tx_queue unless firmware
+	 * supports the pull-push mechanism.
+	 */
+	if (!test_bit(ATH10K_FW_FEATURE_PEER_FLOW_CONTROL,
+		      ar->running_fw->fw_file.fw_features))
+		ar->ops->wake_tx_queue = NULL;
+
 	ret = ath_regd_init(&ar->ath_common.regulatory, ar->hw->wiphy,
 			    ath10k_reg_notifier);
 	if (ret) {