Skip to content

Commit d5216a2

Browse files
lkaufman-heegrumbach
authored andcommitted
iwlwifi: mvm: use bss client queue for bss station
Use the reserved BSS Client queue when connecting to an AP in DQA mode. Signed-off-by: Liad Kaufman <[email protected]> Signed-off-by: Emmanuel Grumbach <[email protected]>
1 parent 0e32d59 commit d5216a2

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ enum {
8989
/*
9090
* DQA queue numbers
9191
*
92+
* @IWL_MVM_DQA_BSS_CLIENT_QUEUE: a queue reserved for BSS activity, to ensure
93+
* that we are never left without the possibility to connect to an AP.
9294
* @IWL_MVM_DQA_MIN_MGMT_QUEUE: first TXQ in pool for MGMT and non-QOS frames.
9395
* Each MGMT queue is mapped to a single STA
9496
* MGMT frames are frames that return true on ieee80211_is_mgmt()
@@ -100,6 +102,7 @@ enum {
100102
* @IWL_MVM_DQA_MAX_DATA_QUEUE: last TXQ in pool for DATA frames
101103
*/
102104
enum iwl_mvm_dqa_txq {
105+
IWL_MVM_DQA_BSS_CLIENT_QUEUE = 4,
103106
IWL_MVM_DQA_MIN_MGMT_QUEUE = 5,
104107
IWL_MVM_DQA_MAX_MGMT_QUEUE = 8,
105108
IWL_MVM_DQA_MIN_DATA_QUEUE = 10,

drivers/net/wireless/intel/iwlwifi/mvm/sta.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,8 @@ static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm,
336336
* as aggregatable.
337337
* Mark all DATA queues as allowing to be aggregated at some point
338338
*/
339-
cfg.aggregate = (queue >= IWL_MVM_DQA_MIN_DATA_QUEUE);
339+
cfg.aggregate = (queue >= IWL_MVM_DQA_MIN_DATA_QUEUE ||
340+
queue == IWL_MVM_DQA_BSS_CLIENT_QUEUE);
340341

341342
IWL_DEBUG_TX_QUEUES(mvm, "Allocating queue #%d to sta %d on tid %d\n",
342343
queue, mvmsta->sta_id, tid);
@@ -448,16 +449,22 @@ void iwl_mvm_add_new_dqa_stream_wk(struct work_struct *wk)
448449
}
449450

450451
static int iwl_mvm_reserve_sta_stream(struct iwl_mvm *mvm,
451-
struct ieee80211_sta *sta)
452+
struct ieee80211_sta *sta,
453+
enum nl80211_iftype vif_type)
452454
{
453455
struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
454456
int queue;
455457

456458
spin_lock_bh(&mvm->queue_info_lock);
457459

458460
/* Make sure we have free resources for this STA */
459-
queue = iwl_mvm_find_free_queue(mvm, IWL_MVM_DQA_MIN_DATA_QUEUE,
460-
IWL_MVM_DQA_MAX_DATA_QUEUE);
461+
if (vif_type == NL80211_IFTYPE_STATION && !sta->tdls &&
462+
!mvm->queue_info[IWL_MVM_DQA_BSS_CLIENT_QUEUE].hw_queue_refcount &&
463+
!mvm->queue_info[IWL_MVM_DQA_BSS_CLIENT_QUEUE].setup_reserved)
464+
queue = IWL_MVM_DQA_BSS_CLIENT_QUEUE;
465+
else
466+
queue = iwl_mvm_find_free_queue(mvm, IWL_MVM_DQA_MIN_DATA_QUEUE,
467+
IWL_MVM_DQA_MAX_DATA_QUEUE);
461468
if (queue < 0) {
462469
spin_unlock_bh(&mvm->queue_info_lock);
463470
IWL_ERR(mvm, "No available queues for new station\n");
@@ -551,7 +558,8 @@ int iwl_mvm_add_sta(struct iwl_mvm *mvm,
551558
}
552559

553560
if (iwl_mvm_is_dqa_supported(mvm)) {
554-
ret = iwl_mvm_reserve_sta_stream(mvm, sta);
561+
ret = iwl_mvm_reserve_sta_stream(mvm, sta,
562+
ieee80211_vif_type_p2p(vif));
555563
if (ret)
556564
goto err;
557565
}

0 commit comments

Comments
 (0)