wifi: iwlwifi: separate AP link management queues
authorJohannes Berg <johannes.berg@intel.com>
Wed, 29 Mar 2023 07:05:39 +0000 (10:05 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 30 Mar 2023 10:08:44 +0000 (12:08 +0200)
The link management queues associated with the broadcast stations
were forgotten and so the same queue was used with both broadcast
stations. This leads to lost frames and warnings on cleanup and
HW restart.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230329100040.0671fa976832.Id5aa9856fd5984e447f247e6d0c3979d9794a21a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
drivers/net/wireless/intel/iwlwifi/mvm/sta.c
drivers/net/wireless/intel/iwlwifi/mvm/tx.c

index 26686cc..ca788a4 100644 (file)
@@ -181,7 +181,7 @@ int iwl_mvm_mld_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 
        if (vif->type == NL80211_IFTYPE_AP ||
            vif->type == NL80211_IFTYPE_ADHOC) {
-               queue = &mvm->probe_queue;
+               queue = &mvm_link->mgmt_queue;
        } else if (vif->type == NL80211_IFTYPE_P2P_DEVICE) {
                queue = &mvm->p2p_dev_queue;
        } else {
@@ -327,7 +327,7 @@ int iwl_mvm_mld_rm_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
        switch (vif->type) {
        case NL80211_IFTYPE_AP:
        case NL80211_IFTYPE_ADHOC:
-               queueptr = &mvm->probe_queue;
+               queueptr = &link->mgmt_queue;
                break;
        case NL80211_IFTYPE_P2P_DEVICE:
                queueptr = &mvm->p2p_dev_queue;
index 022f7bd..707c930 100644 (file)
@@ -299,6 +299,7 @@ struct iwl_probe_resp_data {
  *     data to be inserted into probe response.
  * @he_ru_2mhz_block: 26-tone RU OFDMA transmissions should be blocked
  * @queue_params: QoS params for this MAC
+ * @mgmt_queue: queue number for unbufferable management frames
  */
 struct iwl_mvm_vif_link_info {
        u8 bssid[ETH_ALEN];
@@ -329,6 +330,8 @@ struct iwl_mvm_vif_link_info {
         * to have the data for the MAC context
         */
        struct ieee80211_tx_queue_params queue_params[IEEE80211_NUM_ACS];
+
+       u16 mgmt_queue;
 };
 
 /**
index db6a341..a57de37 100644 (file)
@@ -2348,10 +2348,18 @@ int iwl_mvm_send_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
                }
 
                if (vif->type == NL80211_IFTYPE_AP ||
-                   vif->type == NL80211_IFTYPE_ADHOC)
+                   vif->type == NL80211_IFTYPE_ADHOC) {
+                       /* for queue management */
                        mvm->probe_queue = queue;
-               else if (vif->type == NL80211_IFTYPE_P2P_DEVICE)
+                       /* for use in TX */
+                       mvmvif->deflink.mgmt_queue = queue;
+               } else if (vif->type == NL80211_IFTYPE_P2P_DEVICE) {
                        mvm->p2p_dev_queue = queue;
+               }
+       } else if (vif->type == NL80211_IFTYPE_AP ||
+                  vif->type == NL80211_IFTYPE_ADHOC) {
+               /* set it for use in TX */
+               mvmvif->deflink.mgmt_queue = mvm->probe_queue;
        }
 
        return 0;
@@ -2384,6 +2392,10 @@ void iwl_mvm_free_bcast_sta_queues(struct iwl_mvm *mvm,
        queue = *queueptr;
        iwl_mvm_disable_txq(mvm, NULL, mvmvif->deflink.bcast_sta.sta_id,
                            queueptr, IWL_MAX_TID_COUNT);
+
+       if (vif->type == NL80211_IFTYPE_AP || vif->type == NL80211_IFTYPE_ADHOC)
+               mvmvif->deflink.mgmt_queue = mvm->probe_queue;
+
        if (iwl_mvm_has_new_tx_api(mvm))
                return;
 
index f5b92d9..2c84293 100644 (file)
@@ -626,7 +626,7 @@ static int iwl_mvm_get_ctrl_vif_queue(struct iwl_mvm *mvm,
                if (ieee80211_is_mgmt(fc) &&
                    (!ieee80211_is_bufferable_mmpdu(fc) ||
                     ieee80211_is_deauth(fc) || ieee80211_is_disassoc(fc)))
-                       return mvm->probe_queue;
+                       return link->mgmt_queue;
 
                if (!ieee80211_has_order(fc) && !ieee80211_is_probe_req(fc) &&
                    is_multicast_ether_addr(hdr->addr1))
@@ -634,7 +634,7 @@ static int iwl_mvm_get_ctrl_vif_queue(struct iwl_mvm *mvm,
 
                WARN_ONCE(info->control.vif->type != NL80211_IFTYPE_ADHOC,
                          "fc=0x%02x", le16_to_cpu(fc));
-               return mvm->probe_queue;
+               return link->mgmt_queue;
        case NL80211_IFTYPE_P2P_DEVICE:
                if (ieee80211_is_mgmt(fc))
                        return mvm->p2p_dev_queue;