Skip to contentSkip to conversation

pull request: iwlwifi 2013-02-12

PATCH In review Emmanuel Grumbach 4 participants 19 messages Feb 12, 2014 – Feb 13, 2014 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

Hi John,

One single patch for this pull request for 3.14.

As explicitly written in the commit message, we prefer to disable Tx AMPDU on NICs supported by iwldvm. This feature gives a big boost in Tx performance, but the firmware is buggy and we can't rely on it. Our hope is that most of the users out there want wifi to surf on the web which means that they care more for Rx traffic than for Tx. People who want to enable it can do so with a simple Kconfig entry. Rx AMPDU is still enabled by default.

Please pull - thanks.

emmanuel

The following changes since commit c512865446e6dd5b6e91e81187e75b734ad7cfc7:

iwlwifi: mvm: don't allow A band if SKU forbids it (2014-02-02
11:08:42 +0200)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes.git
for-john

for you to fetch changes up to 930e106d90ca902c8ede0a8cb206cee1ef3c5cc0:

iwlwifi: disable TX AMPDU by default for iwldvm (2014-02-12 10:38:44
+0200)

----------------------------------------------------------------
Emmanuel Grumbach (1):
iwlwifi: disable TX AMPDU by default for iwldvm

 drivers/net/wireless/iwlwifi/Kconfig         |   10 ++++++++
 drivers/net/wireless/iwlwifi/dvm/mac80211.c  |    8 +++----
 drivers/net/wireless/iwlwifi/dvm/tx.c        |   32
++++++++++++++------------
 drivers/net/wireless/iwlwifi/iwl-drv.c       |    2 +-
 drivers/net/wireless/iwlwifi/iwl-modparams.h |    1 -
 drivers/net/wireless/iwlwifi/iwl-nvm-parse.c |    2 --
 drivers/net/wireless/iwlwifi/mvm/mac80211.c  |    8 -------
 7 files changed, 32 insertions(+), 31 deletions(-)
#1 lore raw

PATCH 1/1 iwlwifi: disable TX AMPDU by default for iwldvm

From: Emmanuel Grumbach <[email protected]>

We have had a bug in TX AMPDU in iwldvm for a very long time. This bug has been raised in many bugzillas and threads on linux-wireless mailing list.

The bug is in firmware and we won't be able to fix it in the near future. Hence, we prefer to disable TX AMPDU by default in iwldvm. This doesn't affect iwlmvm which supports 7160 / 3160 and up.

---
 drivers/net/wireless/iwlwifi/Kconfig         |   10 ++++++++
 drivers/net/wireless/iwlwifi/dvm/mac80211.c  |    8 +++----
 drivers/net/wireless/iwlwifi/dvm/tx.c        |   32 ++++++++++++++------------
 drivers/net/wireless/iwlwifi/iwl-drv.c       |    2 +-
 drivers/net/wireless/iwlwifi/iwl-modparams.h |    1 -
 drivers/net/wireless/iwlwifi/iwl-nvm-parse.c |    2 --
 drivers/net/wireless/iwlwifi/mvm/mac80211.c  |    8 -------
 7 files changed, 32 insertions(+), 31 deletions(-)
drivers/net/wireless/iwlwifi/Kconfig +10 -0
index 3eb2102..ec28564 100644
@@ -128,3 +128,13 @@ config IWLWIFI_DEVICE_TRACING
 	  If unsure, say Y so we can help you better when problems
 	  occur.
 endmenu
+
+config IWLWIFI_TX_AMPDU
+	bool "Enable TX AMPDU (EXPERIMENTAL)"
+	depends on IWLDVM
+	help
+	  Say Y here to enable TX AMPDU. TX APMDU should give a
+	  significant boost to TX throughput but the firmware has
+	  a bug that prevents it from working properly.
+
+	  If unsure, say N which is the default.
drivers/net/wireless/iwlwifi/dvm/mac80211.c +4 -4
index c24d1d3..12d3613 100644
@@ -105,7 +105,6 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
 
 	/* Tell mac80211 our characteristics */
 	hw->flags = IEEE80211_HW_SIGNAL_DBM |
-		    IEEE80211_HW_AMPDU_AGGREGATION |
 		    IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC |
 		    IEEE80211_HW_SPECTRUM_MGMT |
 		    IEEE80211_HW_REPORTS_TX_ACK_STATUS |
@@ -126,7 +125,8 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
 
 	if (priv->nvm_data->sku_cap_11n_enable)
 		hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS |
-			     IEEE80211_HW_SUPPORTS_STATIC_SMPS;
+			     IEEE80211_HW_SUPPORTS_STATIC_SMPS |
+			     IEEE80211_HW_AMPDU_AGGREGATION;
 
 	/*
 	 * Enable 11w if advertised by firmware and software crypto
@@ -729,10 +729,10 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
 	case IEEE80211_AMPDU_TX_START:
 		if (!priv->trans->ops->txq_enable)
 			break;
-		if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG)
-			break;
+#ifdef CPTCFG_IWLWIFI_TX_AMPDU
 		IWL_DEBUG_HT(priv, "start Tx\n");
 		ret = iwlagn_tx_agg_start(priv, vif, sta, tid, ssn);
+#endif
 		break;
 	case IEEE80211_AMPDU_TX_STOP_FLUSH:
 	case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT:
drivers/net/wireless/iwlwifi/dvm/tx.c +17 -15
index a6839df..f1a0386 100644
@@ -480,21 +480,6 @@ drop_unlock_priv:
 	return -1;
 }
 
-static int iwlagn_alloc_agg_txq(struct iwl_priv *priv, int mq)
-{
-	int q;
-
-	for (q = IWLAGN_FIRST_AMPDU_QUEUE;
-	     q < priv->cfg->base_params->num_of_queues; q++) {
-		if (!test_and_set_bit(q, priv->agg_q_alloc)) {
-			priv->queue_to_mac80211[q] = mq;
-			return q;
-		}
-	}
-
-	return -ENOSPC;
-}
-
 static void iwlagn_dealloc_agg_txq(struct iwl_priv *priv, int q)
 {
 	clear_bit(q, priv->agg_q_alloc);
@@ -592,6 +577,22 @@ turn_off:
 	return 0;
 }
 
+#ifdef CPTCFG_IWLWIFI_TX_AMPDU
+static int iwlagn_alloc_agg_txq(struct iwl_priv *priv, int mq)
+{
+	int q;
+
+	for (q = IWLAGN_FIRST_AMPDU_QUEUE;
+	     q < priv->cfg->base_params->num_of_queues; q++) {
+		if (!test_and_set_bit(q, priv->agg_q_alloc)) {
+			priv->queue_to_mac80211[q] = mq;
+			return q;
+		}
+	}
+
+	return -ENOSPC;
+}
+
 int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif,
 			struct ieee80211_sta *sta, u16 tid, u16 *ssn)
 {
@@ -650,6 +651,7 @@ int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif,
 
 	return ret;
 }
+#endif /* CPTCFG_IWLWIFI_TX_AMPDU */
 
 int iwlagn_tx_agg_flush(struct iwl_priv *priv, struct ieee80211_vif *vif,
 			struct ieee80211_sta *sta, u16 tid)
drivers/net/wireless/iwlwifi/iwl-drv.c +1 -1
index c372816..2a77602 100644
@@ -1286,7 +1286,7 @@ module_param_named(swcrypto, iwlwifi_mod_params.sw_crypto, int, S_IRUGO);
 MODULE_PARM_DESC(swcrypto, "using crypto in software (default 0 [hardware])");
 module_param_named(11n_disable, iwlwifi_mod_params.disable_11n, uint, S_IRUGO);
 MODULE_PARM_DESC(11n_disable,
-	"disable 11n functionality, bitmap: 1: full, 2: agg TX, 4: agg RX");
+	"disable 11n functionality, bitmap: 1: full, 4: agg RX");
 module_param_named(amsdu_size_8K, iwlwifi_mod_params.amsdu_size_8K,
 		   int, S_IRUGO);
 MODULE_PARM_DESC(amsdu_size_8K, "enable 8K amsdu size (default 0)");
drivers/net/wireless/iwlwifi/iwl-modparams.h +0 -1
index 0a84ade..9589c06 100644
@@ -80,7 +80,6 @@ enum iwl_power_level {
 };
 
 #define IWL_DISABLE_HT_ALL	BIT(0)
-#define IWL_DISABLE_HT_TXAGG	BIT(1)
 #define IWL_DISABLE_HT_RXAGG	BIT(2)
 
 /**
drivers/net/wireless/iwlwifi/iwl-nvm-parse.c +0 -2
index 725e954..810c76d 100644
@@ -369,8 +369,6 @@ iwl_parse_nvm_data(struct device *dev, const struct iwl_cfg *cfg,
 	data->sku_cap_band_24GHz_enable = sku & NVM_SKU_CAP_BAND_24GHZ;
 	data->sku_cap_band_52GHz_enable = sku & NVM_SKU_CAP_BAND_52GHZ;
 	data->sku_cap_11n_enable = sku & NVM_SKU_CAP_11N_ENABLE;
-	if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_ALL)
-		data->sku_cap_11n_enable = false;
 
 	/* check overrides (some devices have wrong NVM) */
 	if (cfg->valid_tx_ant)
drivers/net/wireless/iwlwifi/mvm/mac80211.c +0 -8
index 6bf9766..b068799 100644
@@ -347,20 +347,12 @@ static int iwl_mvm_mac_ampdu_action(struct ieee80211_hw *hw,
 
 	switch (action) {
 	case IEEE80211_AMPDU_RX_START:
-		if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_RXAGG) {
-			ret = -EINVAL;
-			break;
-		}
 		ret = iwl_mvm_sta_rx_agg(mvm, sta, tid, *ssn, true);
 		break;
 	case IEEE80211_AMPDU_RX_STOP:
 		ret = iwl_mvm_sta_rx_agg(mvm, sta, tid, 0, false);
 		break;
 	case IEEE80211_AMPDU_TX_START:
-		if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG) {
-			ret = -EINVAL;
-			break;
-		}
 		ret = iwl_mvm_sta_tx_agg_start(mvm, vif, sta, tid, ssn);
 		break;
 	case IEEE80211_AMPDU_TX_STOP_CONT:
Signature · 1 line
1.7.9.5
#2 lore raw

Re: [PATCH] iwlwifi: disable TX AMPDU by default for iwldvm

Quoted 10 lines · Emmanuel Grumbach

From: Emmanuel Grumbach <[email protected]>

We have had a bug in TX AMPDU in iwldvm for a very long time. This bug has been raised in many bugzillas and threads on linux-wireless mailing list.

The bug is in firmware and we won't be able to fix it in the near future. Hence, we prefer to disable TX AMPDU by default in iwldvm. This doesn't affect iwlmvm which supports 7160 / 3160 and up.

...

Quoted 2 lines

#define IWL_DISABLE_HT_ALL BIT(0)
-#define IWL_DISABLE_HT_TXAGG BIT(1)

Whouln't simple change, by setting disable_11=2 by default, make the same effect, and allow easly to enable TX aggregation (without kernel recompile) ?

Stanislaw

#3 lore raw

Re: [PATCH] iwlwifi: disable TX AMPDU by default for iwldvm

Quoted 12 lines · Stanislaw Gruszka
Quoted 10 lines · Emmanuel Grumbach

From: Emmanuel Grumbach <[email protected]>

We have had a bug in TX AMPDU in iwldvm for a very long time. This bug has been raised in many bugzillas and threads on linux-wireless mailing list.

The bug is in firmware and we won't be able to fix it in the near future. Hence, we prefer to disable TX AMPDU by default in iwldvm. This doesn't affect iwlmvm which supports 7160 / 3160 and up.

Quoted 8 lines

...

Quoted 2 lines

#define IWL_DISABLE_HT_ALL BIT(0)
-#define IWL_DISABLE_HT_TXAGG BIT(1)

Whouln't simple change, by setting disable_11=2 by default, make the same effect, and allow easly to enable TX aggregation (without kernel recompile) ?

Also, does the bug affect all iwldvm devices ? They have different firmware images, so I wonder if this is needed for all DVM devices.

Stanislaw

#4 lore raw

RE: [PATCH] iwlwifi: disable TX AMPDU by default for iwldvm

Quoted 14 lines · Stanislaw Gruszka
Quoted 12 lines · Emmanuel Grumbach
Quoted 10 lines

From: Emmanuel Grumbach <[email protected]>

We have had a bug in TX AMPDU in iwldvm for a very long time. This bug has been raised in many bugzillas and threads on linux-wireless mailing list.

The bug is in firmware and we won't be able to fix it in the near future. Hence, we prefer to disable TX AMPDU by default in iwldvm. This doesn't affect iwlmvm which supports 7160 /
3160 and up.

Quoted 9 lines
Quoted 8 lines

...

Quoted 2 lines

#define IWL_DISABLE_HT_ALL BIT(0)
-#define IWL_DISABLE_HT_TXAGG BIT(1)

Whouln't simple change, by setting disable_11=2 by default, make the same effect, and allow easly to enable TX aggregation (without kernel recompile) ?

I guess at that point, I prefer to have a compilation flag. In Redhat / Fedora you'd disable it by default right?
Also the module parameter is for iwlwifi which includes iwlmvm. When I did this change I mainly thought about distros not wanting to change their modprobe.conf files. I want to give the possibility for distro to disable TX AMPDU for iwldvm and keep it enable for iwlmvm. We can move the module parameter to be iwldvm only, this would be the best, but it'd require distro to make changes... Ignoring the disable_11n module parameter in iwlmvm seems odd (even if this is what I do know for IWL_DISABLE_HT_ALL and IWL_DISABLE_HT_RXAGG). If you (as a distro representative) have a better idea, I am willing to hear. After all, this change is mostly intended to make distro's life easier...

Quoted 2 lines

Also, does the bug affect all iwldvm devices ? They have different firmware images, so I wonder if this is needed for all DVM devices.

I have seen reports from many users and many devices - and unfortunately I have never been able to reproduce - so I can't know if it affects all the devices. All I can see is that I saw reports on very old devices (5150) and with more recent devices (2230).

#5 lore raw

RE: [PATCH] iwlwifi: disable TX AMPDU by default for iwldvm

Quoted 4 lines · Emmanuel

I have seen reports from many users and many devices - and unfortunately I have never been able to reproduce - so I can't know if it affects all the devices. All I can see is that I saw reports on very old devices (5150) and with more recent devices (2230).

Is 5100 a very old device ? I have one of those cards in a laptop and starting 11n TX traffic usually results in a crash like this: http://pastebin.com/HtUdCLR3

Sujith

#6 lore raw

RE: [PATCH] iwlwifi: disable TX AMPDU by default for iwldvm

Quoted 11 lines
Quoted 4 lines · Emmanuel

I have seen reports from many users and many devices - and unfortunately I have never been able to reproduce - so I can't know if it affects all the devices. All I can see is that I saw reports on very old devices (5150) and with more recent devices (2230).

Is 5100 a very old device ? I have one of those cards in a laptop and starting 11n TX traffic usually results in a crash like this:
http://pastebin.com/HtUdCLR3

5100 is the first device supported by iwldvm. I think it was shipped in 2008.

#7 lore raw

RE: [PATCH] iwlwifi: disable TX AMPDU by default for iwldvm

Quoted 1 line · Emmanuel

5100 is the first device supported by iwldvm. I think it was shipped in 2008.

Ok, guess I can't test TX performance with this card. :)

Sujith

#8 lore raw

Re: [PATCH] iwlwifi: disable TX AMPDU by default for iwldvm

In reply to Grumbach, Emmanuel
Quoted 19 lines · Emmanuel
Quoted 19 lines · Stanislaw Gruszka
Quoted 17 lines · Emmanuel Grumbach
Quoted 10 lines

From: Emmanuel Grumbach <[email protected]>

We have had a bug in TX AMPDU in iwldvm for a very long time. This bug has been raised in many bugzillas and threads on linux-wireless mailing list.

The bug is in firmware and we won't be able to fix it in the near future. Hence, we prefer to disable TX AMPDU by default in iwldvm. This doesn't affect iwlmvm which supports 7160 /
3160 and up.

...

Quoted 2 lines

#define IWL_DISABLE_HT_ALL BIT(0)
-#define IWL_DISABLE_HT_TXAGG BIT(1)

Quoted 6 lines
Quoted 4 lines
Quoted 3 lines

Whouln't simple change, by setting disable_11=2 by default, make the same effect, and allow easly to enable TX aggregation (without kernel recompile) ?

I guess at that point, I prefer to have a compilation flag. In Redhat / Fedora you'd disable it by default right?

No, we do not have any extra options in /etc/modprobe.d/ for iwlwifi, all is running with default settings.

Quoted 2 lines

Also the module parameter is for iwlwifi which includes iwlmvm. When I did this change I mainly thought about distros not wanting to change their modprobe.conf files. I want to give the possibility for distro to disable TX AMPDU for iwldvm and keep it enable for iwlmvm. We can move the module parameter to be iwldvm only, this would be the best, but it'd require distro to make changes... Ignoring the disable_11n module parameter in iwlmvm seems odd (even if this is what I do know for IWL_DISABLE_HT_ALL and IWL_DISABLE_HT_RXAGG). If you (as a distro representative) have a better idea, I am willing to hear. After all, this change is mostly intended to make distro's life easier...

If somebody has working aggregation and we will remove that from kernel, we will get complains. Telling that he/she have to recompile kernel to get functionality back, will not make live easier to anyone. Setting module option is much much easier.

In the past we have in iwlwifi module parameters initialized differently for different devices. Though, it does not work with many devices on the system, this is not an issue since normal users have only one device. I guess the same could be used here:
0 - default (device specific), 1 - disable TX AGG, 2 - disable RX AGG, 4 - force enable TX AGG, 8 - force enable RX AGG.

Quoted 4 lines
Quoted 2 lines

Also, does the bug affect all iwldvm devices ? They have different firmware images, so I wonder if this is needed for all DVM devices.

I have seen reports from many users and many devices - and unfortunately I have never been able to reproduce

So, that is argument to do not remove support for TX agg. If someone has that working, he/she still should be able to use it.

Stanislaw

#9 lore raw

pull request: iwlwifi 2014-02-12 (FIXED)

In reply to Emmanuel Grumbach
Quoted 21 lines · Emmanuel Grumbach

Hi John,

One single patch for this pull request for 3.14.

As explicitly written in the commit message, we prefer to disable Tx AMPDU on NICs supported by iwldvm. This feature gives a big boost in Tx performance, but the firmware is buggy and we can't rely on it. Our hope is that most of the users out there want wifi to surf on the web which means that they care more for Rx traffic than for Tx. People who want to enable it can do so with a simple Kconfig entry. Rx AMPDU is still enabled by default.

Please pull - thanks.

emmanuel

The following changes since commit c512865446e6dd5b6e91e81187e75b734ad7cfc7:

iwlwifi: mvm: don't allow A band if SKU forbids it (2014-02-02
11:08:42 +0200)

Quoted 8 lines

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes.git
for-john

for you to fetch changes up to 930e106d90ca902c8ede0a8cb206cee1ef3c5cc0:

I had to edit the patch - 63f1809aa672dc439e7750b551ff9926a79312e0

#10 lore raw

PATCH 1/1 iwlwifi: disable TX AMPDU by default for iwldvm

From: Emmanuel Grumbach <[email protected]>

We have had a bug in TX AMPDU in iwldvm for a very long time. This bug has been raised in many bugzillas and threads on linux-wireless mailing list.

The bug is in firmware and we won't be able to fix it in the near future. Hence, we prefer to disable TX AMPDU by default in iwldvm. This doesn't affect iwlmvm which supports 7160 / 3160 and up.

---
 drivers/net/wireless/iwlwifi/Kconfig         |   10 ++++++++
 drivers/net/wireless/iwlwifi/dvm/mac80211.c  |    8 +++----
 drivers/net/wireless/iwlwifi/dvm/tx.c        |   32 ++++++++++++++------------
 drivers/net/wireless/iwlwifi/iwl-drv.c       |    2 +-
 drivers/net/wireless/iwlwifi/iwl-modparams.h |    1 -
 drivers/net/wireless/iwlwifi/iwl-nvm-parse.c |    2 --
 drivers/net/wireless/iwlwifi/mvm/mac80211.c  |    8 -------
 7 files changed, 32 insertions(+), 31 deletions(-)
drivers/net/wireless/iwlwifi/Kconfig +10 -0
index 3eb2102..ec28564 100644
@@ -128,3 +128,13 @@ config IWLWIFI_DEVICE_TRACING
 	  If unsure, say Y so we can help you better when problems
 	  occur.
 endmenu
+
+config IWLWIFI_TX_AMPDU
+	bool "Enable TX AMPDU (EXPERIMENTAL)"
+	depends on IWLDVM
+	help
+	  Say Y here to enable TX AMPDU. TX APMDU should give a
+	  significant boost to TX throughput but the firmware has
+	  a bug that prevents it from working properly.
+
+	  If unsure, say N which is the default.
drivers/net/wireless/iwlwifi/dvm/mac80211.c +4 -4
index c24d1d3..e678c83 100644
@@ -105,7 +105,6 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
 
 	/* Tell mac80211 our characteristics */
 	hw->flags = IEEE80211_HW_SIGNAL_DBM |
-		    IEEE80211_HW_AMPDU_AGGREGATION |
 		    IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC |
 		    IEEE80211_HW_SPECTRUM_MGMT |
 		    IEEE80211_HW_REPORTS_TX_ACK_STATUS |
@@ -126,7 +125,8 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
 
 	if (priv->nvm_data->sku_cap_11n_enable)
 		hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS |
-			     IEEE80211_HW_SUPPORTS_STATIC_SMPS;
+			     IEEE80211_HW_SUPPORTS_STATIC_SMPS |
+			     IEEE80211_HW_AMPDU_AGGREGATION;
 
 	/*
 	 * Enable 11w if advertised by firmware and software crypto
@@ -729,10 +729,10 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
 	case IEEE80211_AMPDU_TX_START:
 		if (!priv->trans->ops->txq_enable)
 			break;
-		if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG)
-			break;
+#ifdef CONFIG_IWLWIFI_TX_AMPDU
 		IWL_DEBUG_HT(priv, "start Tx\n");
 		ret = iwlagn_tx_agg_start(priv, vif, sta, tid, ssn);
+#endif
 		break;
 	case IEEE80211_AMPDU_TX_STOP_FLUSH:
 	case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT:
drivers/net/wireless/iwlwifi/dvm/tx.c +17 -15
index a6839df..b19418c 100644
@@ -480,21 +480,6 @@ drop_unlock_priv:
 	return -1;
 }
 
-static int iwlagn_alloc_agg_txq(struct iwl_priv *priv, int mq)
-{
-	int q;
-
-	for (q = IWLAGN_FIRST_AMPDU_QUEUE;
-	     q < priv->cfg->base_params->num_of_queues; q++) {
-		if (!test_and_set_bit(q, priv->agg_q_alloc)) {
-			priv->queue_to_mac80211[q] = mq;
-			return q;
-		}
-	}
-
-	return -ENOSPC;
-}
-
 static void iwlagn_dealloc_agg_txq(struct iwl_priv *priv, int q)
 {
 	clear_bit(q, priv->agg_q_alloc);
@@ -592,6 +577,22 @@ turn_off:
 	return 0;
 }
 
+#ifdef CONFIG_IWLWIFI_TX_AMPDU
+static int iwlagn_alloc_agg_txq(struct iwl_priv *priv, int mq)
+{
+	int q;
+
+	for (q = IWLAGN_FIRST_AMPDU_QUEUE;
+	     q < priv->cfg->base_params->num_of_queues; q++) {
+		if (!test_and_set_bit(q, priv->agg_q_alloc)) {
+			priv->queue_to_mac80211[q] = mq;
+			return q;
+		}
+	}
+
+	return -ENOSPC;
+}
+
 int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif,
 			struct ieee80211_sta *sta, u16 tid, u16 *ssn)
 {
@@ -650,6 +651,7 @@ int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif,
 
 	return ret;
 }
+#endif /* CONFIG_IWLWIFI_TX_AMPDU */
 
 int iwlagn_tx_agg_flush(struct iwl_priv *priv, struct ieee80211_vif *vif,
 			struct ieee80211_sta *sta, u16 tid)
drivers/net/wireless/iwlwifi/iwl-drv.c +1 -1
index c372816..2a77602 100644
@@ -1286,7 +1286,7 @@ module_param_named(swcrypto, iwlwifi_mod_params.sw_crypto, int, S_IRUGO);
 MODULE_PARM_DESC(swcrypto, "using crypto in software (default 0 [hardware])");
 module_param_named(11n_disable, iwlwifi_mod_params.disable_11n, uint, S_IRUGO);
 MODULE_PARM_DESC(11n_disable,
-	"disable 11n functionality, bitmap: 1: full, 2: agg TX, 4: agg RX");
+	"disable 11n functionality, bitmap: 1: full, 4: agg RX");
 module_param_named(amsdu_size_8K, iwlwifi_mod_params.amsdu_size_8K,
 		   int, S_IRUGO);
 MODULE_PARM_DESC(amsdu_size_8K, "enable 8K amsdu size (default 0)");
drivers/net/wireless/iwlwifi/iwl-modparams.h +0 -1
index 0a84ade..9589c06 100644
@@ -80,7 +80,6 @@ enum iwl_power_level {
 };
 
 #define IWL_DISABLE_HT_ALL	BIT(0)
-#define IWL_DISABLE_HT_TXAGG	BIT(1)
 #define IWL_DISABLE_HT_RXAGG	BIT(2)
 
 /**
drivers/net/wireless/iwlwifi/iwl-nvm-parse.c +0 -2
index 725e954..810c76d 100644
@@ -369,8 +369,6 @@ iwl_parse_nvm_data(struct device *dev, const struct iwl_cfg *cfg,
 	data->sku_cap_band_24GHz_enable = sku & NVM_SKU_CAP_BAND_24GHZ;
 	data->sku_cap_band_52GHz_enable = sku & NVM_SKU_CAP_BAND_52GHZ;
 	data->sku_cap_11n_enable = sku & NVM_SKU_CAP_11N_ENABLE;
-	if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_ALL)
-		data->sku_cap_11n_enable = false;
 
 	/* check overrides (some devices have wrong NVM) */
 	if (cfg->valid_tx_ant)
drivers/net/wireless/iwlwifi/mvm/mac80211.c +0 -8
index 6bf9766..b068799 100644
@@ -347,20 +347,12 @@ static int iwl_mvm_mac_ampdu_action(struct ieee80211_hw *hw,
 
 	switch (action) {
 	case IEEE80211_AMPDU_RX_START:
-		if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_RXAGG) {
-			ret = -EINVAL;
-			break;
-		}
 		ret = iwl_mvm_sta_rx_agg(mvm, sta, tid, *ssn, true);
 		break;
 	case IEEE80211_AMPDU_RX_STOP:
 		ret = iwl_mvm_sta_rx_agg(mvm, sta, tid, 0, false);
 		break;
 	case IEEE80211_AMPDU_TX_START:
-		if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG) {
-			ret = -EINVAL;
-			break;
-		}
 		ret = iwl_mvm_sta_tx_agg_start(mvm, vif, sta, tid, ssn);
 		break;
 	case IEEE80211_AMPDU_TX_STOP_CONT:
Signature · 1 line
1.7.9.5
#11 lore raw

RFC 1/1 iwlwifi: refactor the TX / RX ampdu override

Note that this modifies the module parameter values / string which means that distro will need to update their *.conf file (if any).

Change-Id Icfd5a1a6100fcb126e560046551bfb0d1f28179c
---
 drivers/net/wireless/iwlwifi/dvm/mac80211.c     | 22 ++++++++++++++++++++--
 drivers/net/wireless/iwlwifi/iwl-drv.c          |  4 ++--
 drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c |  2 --
 drivers/net/wireless/iwlwifi/iwl-modparams.h    | 13 +++++++------
 drivers/net/wireless/iwlwifi/iwl-nvm-parse.c    |  2 --
 drivers/net/wireless/iwlwifi/mvm/mac80211.c     | 22 ++++++++++++++++++++--
 6 files changed, 49 insertions(+), 16 deletions(-)
drivers/net/wireless/iwlwifi/dvm/mac80211.c +20 -2
index ad8f81d..0a9c2ec 100644
@@ -697,6 +697,24 @@ static int iwlagn_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 	return ret;
 }
 
+static inline bool iwl_enable_rx_ampdu(struct iwl_cfg *cfg)
+{
+	if (iwlwifi_mod_params.override_ampdu & IWL_DISABLE_HT_RXAGG)
+		return false;
+	return true;
+}
+
+static inline bool iwl_enable_tx_ampdu(struct iwl_cfg *cfg)
+{
+	if (iwlwifi_mod_params.override_ampdu & IWL_DISABLE_HT_TXAGG)
+		return false;
+	if (iwlwifi_mod_params.override_ampdu & IWL_ENABLE_HT_TXAGG)
+		return true;
+
+	/* disabled by default */
+	return false;
+}
+
 static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
 				   struct ieee80211_vif *vif,
 				   enum ieee80211_ampdu_mlme_action action,
@@ -718,7 +736,7 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
 
 	switch (action) {
 	case IEEE80211_AMPDU_RX_START:
-		if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_RXAGG)
+		if (!iwl_enable_rx_ampdu(priv->cfg))
 			break;
 		IWL_DEBUG_HT(priv, "start Rx\n");
 		ret = iwl_sta_rx_agg_start(priv, sta, tid, *ssn);
@@ -730,7 +748,7 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
 	case IEEE80211_AMPDU_TX_START:
 		if (!priv->trans->ops->txq_enable)
 			break;
-		if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG)
+		if (!iwl_enable_tx_ampdu(priv->cfg))
 			break;
 		IWL_DEBUG_HT(priv, "start Tx\n");
 		ret = iwlagn_tx_agg_start(priv, vif, sta, tid, ssn);
drivers/net/wireless/iwlwifi/iwl-drv.c +2 -2
index 65bc944..68e8f3b 100644
@@ -1661,8 +1661,8 @@ MODULE_PARM_DESC(xvt_default_mode, "xVT is the default operation mode (default:
 
 module_param_named(swcrypto, iwlwifi_mod_params.sw_crypto, int, S_IRUGO);
 MODULE_PARM_DESC(swcrypto, "using crypto in software (default 0 [hardware])");
-module_param_named(11n_disable, iwlwifi_mod_params.disable_11n, uint, S_IRUGO);
-MODULE_PARM_DESC(11n_disable,
+module_param_named(override_ampdu, iwlwifi_mod_params.override_ampdu, uint, S_IRUGO);
+MODULE_PARM_DESC(override_ampdu,
 	"disable 11n functionality, bitmap: 1: full, 2: agg TX, 4: agg RX");
 module_param_named(amsdu_size_8K, iwlwifi_mod_params.amsdu_size_8K,
 		   int, S_IRUGO);
drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c +0 -2
index c44cf11..ae98cb7 100644
@@ -893,8 +893,6 @@ iwl_parse_eeprom_data(struct device *dev, const struct iwl_cfg *cfg,
 	data->sku_cap_band_24GHz_enable = sku & EEPROM_SKU_CAP_BAND_24GHZ;
 	data->sku_cap_band_52GHz_enable = sku & EEPROM_SKU_CAP_BAND_52GHZ;
 	data->sku_cap_ipan_enable = sku & EEPROM_SKU_CAP_IPAN_ENABLE;
-	if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_ALL)
-		data->sku_cap_11n_enable = false;
 
 	data->nvm_version = iwl_eeprom_query16(eeprom, eeprom_size,
 					       EEPROM_VERSION);
drivers/net/wireless/iwlwifi/iwl-modparams.h +7 -6
index 1d2f793..9022091 100644
@@ -79,9 +79,10 @@ enum iwl_power_level {
 	IWL_POWER_NUM
 };
 
-#define IWL_DISABLE_HT_ALL	BIT(0)
-#define IWL_DISABLE_HT_TXAGG	BIT(1)
-#define IWL_DISABLE_HT_RXAGG	BIT(2)
+#define IWL_DISABLE_HT_TXAGG	BIT(0)
+#define IWL_DISABLE_HT_RXAGG	BIT(1)
+#define IWL_ENABLE_HT_TXAGG	BIT(2)
+#define IWL_ENABLE_HT_RXAGG	BIT(3)
 
 /**
  * struct iwl_mod_params
@@ -89,8 +90,8 @@ enum iwl_power_level {
  * Holds the module parameters
  *
  * @sw_crypto: using hardware encryption, default = 0
- * @disable_11n: disable 11n capabilities, default = 0,
- *	use IWL_DISABLE_HT_* constants
+ * @override_ampdu: disable 11n capabilities, default = 0,
+ *	use IWL_[DIS,EN]ABLE_HT_* constants
  * @amsdu_size_8K: enable 8K amsdu size, default = 0
  * @restart_fw: restart firmware, default = 1
  * @wd_disable: disable stuck queue check, default = 1
@@ -104,7 +105,7 @@ enum iwl_power_level {
  */
 struct iwl_mod_params {
 	int sw_crypto;
-	unsigned int disable_11n;
+	unsigned int override_ampdu;
 	int amsdu_size_8K;
 	bool restart_fw;
 	int  wd_disable;
drivers/net/wireless/iwlwifi/iwl-nvm-parse.c +0 -2
index 3f3536c..9a4ae64 100644
@@ -498,8 +498,6 @@ iwl_parse_nvm_data(struct device *dev, const struct iwl_cfg *cfg,
 	data->sku_cap_band_52GHz_enable = sku & NVM_SKU_CAP_BAND_52GHZ;
 	data->sku_cap_11n_enable = sku & NVM_SKU_CAP_11N_ENABLE;
 	data->sku_cap_11ac_enable = sku & NVM_SKU_CAP_11AC_ENABLE;
-	if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_ALL)
-		data->sku_cap_11n_enable = false;
 
 	/* check overrides (some devices have wrong NVM) */
 	if (cfg->valid_tx_ant)
drivers/net/wireless/iwlwifi/mvm/mac80211.c +20 -2
index 19925bb..daa7d9b 100644
@@ -468,6 +468,24 @@ static void iwl_mvm_mac_tx(struct ieee80211_hw *hw,
 	ieee80211_free_txskb(hw, skb);
 }
 
+static inline bool iwl_enable_rx_ampdu(struct iwl_cfg *cfg)
+{
+	if (iwlwifi_mod_params.override_ampdu & IWL_DISABLE_HT_RXAGG)
+		return false;
+	return true;
+}
+
+static inline bool iwl_enable_tx_ampdu(struct iwl_cfg *cfg)
+{
+	if (iwlwifi_mod_params.override_ampdu & IWL_DISABLE_HT_TXAGG)
+		return false;
+	if (iwlwifi_mod_params.override_ampdu & IWL_ENABLE_HT_TXAGG)
+		return true;
+
+	/* enabled by default */
+	return true;
+}
+
 static int iwl_mvm_mac_ampdu_action(struct ieee80211_hw *hw,
 				    struct ieee80211_vif *vif,
 				    enum ieee80211_ampdu_mlme_action action,
@@ -487,7 +505,7 @@ static int iwl_mvm_mac_ampdu_action(struct ieee80211_hw *hw,
 
 	switch (action) {
 	case IEEE80211_AMPDU_RX_START:
-		if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_RXAGG) {
+		if (!iwl_enable_rx_ampdu(mvm->cfg)) {
 			ret = -EINVAL;
 			break;
 		}
@@ -497,7 +515,7 @@ static int iwl_mvm_mac_ampdu_action(struct ieee80211_hw *hw,
 		ret = iwl_mvm_sta_rx_agg(mvm, sta, tid, 0, false);
 		break;
 	case IEEE80211_AMPDU_TX_START:
-		if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG) {
+		if (!iwl_enable_tx_ampdu(mvm->cfg)) {
 			ret = -EINVAL;
 			break;
 		}
Signature · 1 line
1.8.3.2
#12 lore raw

Re: [RFC] iwlwifi: refactor the TX / RX ampdu override

Quoted 3 lines · Emmanuel Grumbach

Note that this modifies the module parameter values / string which means that distro will need to update their *.conf file (if any).

Hmm, this is not something that I would like to do ...

drivers/net/wireless/iwlwifi/iwl-modparams.h enum iwl_power_level { · line 85

Quoted 8 lines
drivers/net/wireless/iwlwifi/iwl-modparams.h +4 -4
-#define IWL_DISABLE_HT_ALL	BIT(0)
-#define IWL_DISABLE_HT_TXAGG	BIT(1)
-#define IWL_DISABLE_HT_RXAGG	BIT(2)
-#define IWL_DISABLE_HT_ALL	BIT(1)
+#define IWL_DISABLE_HT_TXAGG	BIT(1)
+#define IWL_DISABLE_HT_RXAGG	BIT(1)
+#define IWL_ENABLE_HT_TXAGG	BIT(2)
+#define IWL_ENABLE_HT_RXAGG	BIT(3)

I think we can keep IWL_DISABLE_HT_ALL option. I should be possible to make some per-device type default settings and if disable_11n == 0 use them. Otherwise use settings from module parameter. Will that work ?

Stanislaw

#13 lore raw

RE: [RFC] iwlwifi: refactor the TX / RX ampdu override

Quoted 7 lines

Subject: Re: [RFC] iwlwifi: refactor the TX / RX ampdu override

Quoted 2 lines · Emmanuel Grumbach

Note that this modifies the module parameter values / string which means that distro will need to update their *.conf file (if any).

Hmm, this is not something that I would like to do ...

I thought you didn't care - ok - I'll respin

Quoted 13 lines

drivers/net/wireless/iwlwifi/iwl-modparams.h enum iwl_power_level { · line 85

Quoted 9 lines
drivers/net/wireless/iwlwifi/iwl-modparams.h +4 -4
-#define IWL_DISABLE_HT_ALL	BIT(0)
-#define IWL_DISABLE_HT_TXAGG	BIT(1)
-#define IWL_DISABLE_HT_RXAGG	BIT(2)
-#define IWL_DISABLE_HT_ALL	BIT(1)
+#define IWL_DISABLE_HT_TXAGG	BIT(1)
+#define IWL_DISABLE_HT_RXAGG	BIT(1)
+#define IWL_ENABLE_HT_TXAGG	BIT(2)
+#define IWL_ENABLE_HT_RXAGG	BIT(3)

I think we can keep IWL_DISABLE_HT_ALL option. I should be possible to make some per-device type default settings and if disable_11n == 0 use them. Otherwise use settings from module parameter. Will that work ?

I'd prefer to have the default based on the iwldvm vs. iwlmvm instead of adding yet another per-HW field. But yeah - it is possible.

#14 lore raw

Re: [RFC] iwlwifi: refactor the TX / RX ampdu override

Quoted 5 lines · Emmanuel
Quoted 3 lines

I think we can keep IWL_DISABLE_HT_ALL option. I should be possible to make some per-device type default settings and if disable_11n == 0 use them. Otherwise use settings from module parameter. Will that work ?

I'd prefer to have the default based on the iwldvm vs. iwlmvm instead of adding yet another per-HW field. But yeah - it is possible.

I re-think changing default settings do disable TX AGG and must tell that this is very odd. I would prefer to stay defaults as they are now. Users can disable TX aggregation using module option.

I also not sure if that is really a firmware bug, it is rather more probable that TX aggregation worked pretty fine on 5100 and other older devices, but some driver changes broke that.

Stanislaw

#15 lore raw

Re: [RFC] iwlwifi: refactor the TX / RX ampdu override

Quoted 10 lines · Stanislaw Gruszka
Quoted 5 lines · Emmanuel
Quoted 3 lines

I think we can keep IWL_DISABLE_HT_ALL option. I should be possible to make some per-device type default settings and if disable_11n == 0 use them. Otherwise use settings from module parameter. Will that work ?

I'd prefer to have the default based on the iwldvm vs. iwlmvm instead of adding yet another per-HW field. But yeah - it is possible.

I re-think changing default settings do disable TX AGG and must tell that this is very odd. I would prefer to stay defaults as they are now. Users can disable TX aggregation using module option.

I disagree. We have bugs there - it is pretty much obvious. I remember a tracing from 2.6.39 which was before the re-architecture I made in the driver with clear FW bugs. I don't remember what device though. This is why I want to disable this by default.
You asked me to do this with a module parameter and not with a Kconfig option - I agreed.
Now - if you want to ship with a different settings, you can... but we both know the risk.

Quoted 4 lines

I also not sure if that is really a firmware bug, it is rather more probable that TX aggregation worked pretty fine on 5100 and other older devices, but some driver changes broke that.

Frankly, I don't really remember that... I have to say that I might not have been in the business at that period...

#16 lore raw

Re: [RFC] iwlwifi: refactor the TX / RX ampdu override

Quoted 8 lines · Emmanuel Grumbach
Quoted 7 lines · Stanislaw Gruszka
Quoted 5 lines · Emmanuel
Quoted 3 lines

I think we can keep IWL_DISABLE_HT_ALL option. I should be possible to make some per-device type default settings and if disable_11n == 0 use them. Otherwise use settings from module parameter. Will that work ?

I'd prefer to have the default based on the iwldvm vs. iwlmvm instead of adding yet another per-HW field. But yeah - it is possible.

Quoted 8 lines
Quoted 3 lines

I re-think changing default settings do disable TX AGG and must tell that this is very odd. I would prefer to stay defaults as they are now. Users can disable TX aggregation using module option.

I disagree. We have bugs there - it is pretty much obvious. I remember a tracing from 2.6.39 which was before the re-architecture I made in the driver with clear FW bugs. I don't remember what device though. This is why I want to disable this by default.

Sure, it's up to you. But anyway, disabling feature because it buggy, after having it run for 5 years or so, it's odd :-)

Stanislaw

#17 lore raw

PATCH 1/1 iwlwifi: disable TX AMPDU by default for iwldvm

In reply to Emmanuel Grumbach

NICs supported by iwldvm don't handle well TX AMPDU. Disable it by default, still leave the possibility to the user to force enable it with a debug parameter.

NICs supported by iwlmvm don't suffer from the same issue, leave TX AMPDU enabled by default for these.

---
 drivers/net/wireless/iwlwifi/dvm/mac80211.c  | 22 ++++++++++++++++++++--
 drivers/net/wireless/iwlwifi/iwl-drv.c       |  2 +-
 drivers/net/wireless/iwlwifi/iwl-modparams.h | 11 +++++++----
 drivers/net/wireless/iwlwifi/mvm/mac80211.c  | 22 ++++++++++++++++++++--
 4 files changed, 48 insertions(+), 9 deletions(-)
drivers/net/wireless/iwlwifi/dvm/mac80211.c +20 -2
index ad8f81d..99bf6f9 100644
@@ -697,6 +697,24 @@ static int iwlagn_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 	return ret;
 }
 
+static inline bool iwl_enable_rx_ampdu(const struct iwl_cfg *cfg)
+{
+	if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_RXAGG)
+		return false;
+	return true;
+}
+
+static inline bool iwl_enable_tx_ampdu(const struct iwl_cfg *cfg)
+{
+	if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG)
+		return false;
+	if (iwlwifi_mod_params.disable_11n & IWL_ENABLE_HT_TXAGG)
+		return true;
+
+	/* disabled by default */
+	return false;
+}
+
 static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
 				   struct ieee80211_vif *vif,
 				   enum ieee80211_ampdu_mlme_action action,
@@ -718,7 +736,7 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
 
 	switch (action) {
 	case IEEE80211_AMPDU_RX_START:
-		if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_RXAGG)
+		if (!iwl_enable_rx_ampdu(priv->cfg))
 			break;
 		IWL_DEBUG_HT(priv, "start Rx\n");
 		ret = iwl_sta_rx_agg_start(priv, sta, tid, *ssn);
@@ -730,7 +748,7 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
 	case IEEE80211_AMPDU_TX_START:
 		if (!priv->trans->ops->txq_enable)
 			break;
-		if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG)
+		if (!iwl_enable_tx_ampdu(priv->cfg))
 			break;
 		IWL_DEBUG_HT(priv, "start Tx\n");
 		ret = iwlagn_tx_agg_start(priv, vif, sta, tid, ssn);
drivers/net/wireless/iwlwifi/iwl-drv.c +1 -1
index 65bc944..dfdeccd 100644
@@ -1663,7 +1663,7 @@ module_param_named(swcrypto, iwlwifi_mod_params.sw_crypto, int, S_IRUGO);
 MODULE_PARM_DESC(swcrypto, "using crypto in software (default 0 [hardware])");
 module_param_named(11n_disable, iwlwifi_mod_params.disable_11n, uint, S_IRUGO);
 MODULE_PARM_DESC(11n_disable,
-	"disable 11n functionality, bitmap: 1: full, 2: agg TX, 4: agg RX");
+	"disable 11n functionality, bitmap: 1: full, 2: disable agg TX, 4: disable agg RX, 8 enable agg TX");
 module_param_named(amsdu_size_8K, iwlwifi_mod_params.amsdu_size_8K,
 		   int, S_IRUGO);
 MODULE_PARM_DESC(amsdu_size_8K, "enable 8K amsdu size (default 0)");
drivers/net/wireless/iwlwifi/iwl-modparams.h +7 -4
index 1d2f793..34ce808 100644
@@ -79,9 +79,12 @@ enum iwl_power_level {
 	IWL_POWER_NUM
 };
 
-#define IWL_DISABLE_HT_ALL	BIT(0)
-#define IWL_DISABLE_HT_TXAGG	BIT(1)
-#define IWL_DISABLE_HT_RXAGG	BIT(2)
+enum iwl_disable_11n {
+	IWL_DISABLE_HT_ALL	 = BIT(0),
+	IWL_DISABLE_HT_TXAGG	 = BIT(1),
+	IWL_DISABLE_HT_RXAGG	 = BIT(2),
+	IWL_ENABLE_HT_TXAGG	 = BIT(3),
+};
 
 /**
  * struct iwl_mod_params
@@ -90,7 +93,7 @@ enum iwl_power_level {
  *
  * @sw_crypto: using hardware encryption, default = 0
  * @disable_11n: disable 11n capabilities, default = 0,
- *	use IWL_DISABLE_HT_* constants
+ *	use IWL_[DIS,EN]ABLE_HT_* constants
  * @amsdu_size_8K: enable 8K amsdu size, default = 0
  * @restart_fw: restart firmware, default = 1
  * @wd_disable: disable stuck queue check, default = 1
drivers/net/wireless/iwlwifi/mvm/mac80211.c +20 -2
index 19925bb..068f785 100644
@@ -468,6 +468,24 @@ static void iwl_mvm_mac_tx(struct ieee80211_hw *hw,
 	ieee80211_free_txskb(hw, skb);
 }
 
+static inline bool iwl_enable_rx_ampdu(const struct iwl_cfg *cfg)
+{
+	if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_RXAGG)
+		return false;
+	return true;
+}
+
+static inline bool iwl_enable_tx_ampdu(const struct iwl_cfg *cfg)
+{
+	if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG)
+		return false;
+	if (iwlwifi_mod_params.disable_11n & IWL_ENABLE_HT_TXAGG)
+		return true;
+
+	/* enabled by default */
+	return true;
+}
+
 static int iwl_mvm_mac_ampdu_action(struct ieee80211_hw *hw,
 				    struct ieee80211_vif *vif,
 				    enum ieee80211_ampdu_mlme_action action,
@@ -487,7 +505,7 @@ static int iwl_mvm_mac_ampdu_action(struct ieee80211_hw *hw,
 
 	switch (action) {
 	case IEEE80211_AMPDU_RX_START:
-		if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_RXAGG) {
+		if (!iwl_enable_rx_ampdu(mvm->cfg)) {
 			ret = -EINVAL;
 			break;
 		}
@@ -497,7 +515,7 @@ static int iwl_mvm_mac_ampdu_action(struct ieee80211_hw *hw,
 		ret = iwl_mvm_sta_rx_agg(mvm, sta, tid, 0, false);
 		break;
 	case IEEE80211_AMPDU_TX_START:
-		if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG) {
+		if (!iwl_enable_tx_ampdu(mvm->cfg)) {
 			ret = -EINVAL;
 			break;
 		}
Signature · 1 line
1.8.3.2
#18 lore raw

Re: pull request: iwlwifi 2014-02-12 (FIXED)

In reply to Emmanuel Grumbach
Quoted 24 lines
Quoted 24 lines

Hi John,

One single patch for this pull request for 3.14.

As explicitly written in the commit message, we prefer to disable Tx AMPDU on NICs supported by iwldvm. This feature gives a big boost in Tx performance, but the firmware is buggy and we can't rely on it. Our hope is that most of the users out there want wifi to surf on the web which means that they care more for Rx traffic than for Tx. People who want to enable it can do so with a simple Kconfig entry. Rx AMPDU is still enabled by default.

Please pull - thanks.

emmanuel

The following changes since commit c512865446e6dd5b6e91e81187e75b734ad7cfc7:

iwlwifi: mvm: don't allow A band if SKU forbids it (2014-02-02
11:08:42 +0200)

are available in the git repository at:

Quoted 8 lines
Quoted 5 lines

git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes.git
for-john

for you to fetch changes up to 930e106d90ca902c8ede0a8cb206cee1ef3c5cc0:

I had to edit the patch - 63f1809aa672dc439e7750b551ff9926a79312e0

John - as you can see Stanislaw isn't happy with this. Please don't pull this right now - I'll try to find an agreed solution.