diff mbox series

[13/13] iwlwifi: mvm: starting from 22000 we have 32 Rx AMPDU sessions

Message ID iwlwifi.20220128153014.7120a90ed7d2.I9d6d907a2c1b965d1e42ff9f0886b1df627e4761@changeid (mailing list archive)
State Accepted
Commit 1daaa3e988c51191c44ee99c2a32a6ab36882d30
Delegated to: Luca Coelho
Headers show
Series iwlwifi: updates intended for v5.18 2022-01-28 | expand

Commit Message

Luca Coelho Jan. 28, 2022, 1:34 p.m. UTC
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

Those devices have more BAIDs, which is the hardware module
that tracks the BA session.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h | 3 +++
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h         | 1 -
 drivers/net/wireless/intel/iwlwifi/mvm/sta.c         | 6 +++---
 3 files changed, 6 insertions(+), 4 deletions(-)

Comments

Kalle Valo Feb. 17, 2022, 1:25 p.m. UTC | #1
Luca Coelho <luca@coelho.fi> writes:

> From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
>
> Those devices have more BAIDs, which is the hardware module
> that tracks the BA session.
>
> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> ---
>  drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h | 3 +++
>  drivers/net/wireless/intel/iwlwifi/mvm/mvm.h         | 1 -
>  drivers/net/wireless/intel/iwlwifi/mvm/sta.c         | 6 +++---
>  3 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h b/drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h
> index b0b8f067d544..5539d402daa9 100644
> --- a/drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h
> +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h
> @@ -264,6 +264,9 @@ struct iwl_rlc_config_cmd {
>  	u8 reserved[3];
>  } __packed; /* RLC_CONFIG_CMD_API_S_VER_2 */
>  
> +#define IWL_MAX_BAID_OLD	16 /* MAX_IMMEDIATE_BA_API_D_VER_2 */
> +#define IWL_MAX_BAID		32 /* MAX_IMMEDIATE_BA_API_D_VER_3 */

Nitpicking, but using "old" or "new" creates problems as often there
could be a third option :) No need to resend.
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h b/drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h
index b0b8f067d544..5539d402daa9 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h
@@ -264,6 +264,9 @@  struct iwl_rlc_config_cmd {
 	u8 reserved[3];
 } __packed; /* RLC_CONFIG_CMD_API_S_VER_2 */
 
+#define IWL_MAX_BAID_OLD	16 /* MAX_IMMEDIATE_BA_API_D_VER_2 */
+#define IWL_MAX_BAID		32 /* MAX_IMMEDIATE_BA_API_D_VER_3 */
+
 /**
  * enum iwl_rx_baid_action - BAID allocation/config action
  * @IWL_RX_BAID_ACTION_ADD: add a new BAID session
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 250effb8ed87..3208a7670505 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -1097,7 +1097,6 @@  struct iwl_mvm {
 	} cmd_ver;
 
 	struct ieee80211_vif *nan_vif;
-#define IWL_MAX_BAID	32
 	struct iwl_mvm_baid_data __rcu *baid_map[IWL_MAX_BAID];
 
 	/*
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index ef4d52672674..c8ffe31ca124 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -2464,8 +2464,6 @@  int iwl_mvm_rm_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
 	return ret;
 }
 
-#define IWL_MAX_RX_BA_SESSIONS 16
-
 static void iwl_mvm_sync_rxq_del_ba(struct iwl_mvm *mvm, u8 baid)
 {
 	struct iwl_mvm_delba_data notif = {
@@ -2657,10 +2655,12 @@  int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
 	struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta);
 	struct iwl_mvm_baid_data *baid_data = NULL;
 	int ret, baid;
+	u32 max_ba_id_sessions = iwl_mvm_has_new_tx_api(mvm) ? IWL_MAX_BAID :
+							       IWL_MAX_BAID_OLD;
 
 	lockdep_assert_held(&mvm->mutex);
 
-	if (start && mvm->rx_ba_sessions >= IWL_MAX_RX_BA_SESSIONS) {
+	if (start && mvm->rx_ba_sessions >= max_ba_id_sessions) {
 		IWL_WARN(mvm, "Not enough RX BA SESSIONS\n");
 		return -ENOSPC;
 	}