]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: iwlwifi: mvm: include link ID when releasing frames
authorBenjamin Berg <benjamin.berg@intel.com>
Wed, 20 Mar 2024 21:26:22 +0000 (23:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:37:55 +0000 (16:37 +0200)
[ Upstream commit e78d7877308989ef91b64a3c746ae31324c07caa ]

When releasing frames from the reorder buffer, the link ID was not
included in the RX status information. This subsequently led mac80211 to
drop the frame. Change it so that the link information is set
immediately when possible so that it doesn't not need to be filled in
anymore when submitting the frame to mac80211.

Fixes: b8a85a1d42d7 ("wifi: iwlwifi: mvm: rxmq: report link ID to mac80211")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Tested-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320232419.bbbd5e9bfe80.Iec1bf5c884e371f7bc5ea2534ed9ea8d3f2c0bf6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c

index 7bf2a5947e5e9f8c44900c832acc1ee71c677381..481dfbbe46162be3239ad4f3a78a8a297b00fabb 100644 (file)
@@ -236,21 +236,13 @@ static void iwl_mvm_add_rtap_sniffer_config(struct iwl_mvm *mvm,
 static void iwl_mvm_pass_packet_to_mac80211(struct iwl_mvm *mvm,
                                            struct napi_struct *napi,
                                            struct sk_buff *skb, int queue,
-                                           struct ieee80211_sta *sta,
-                                           struct ieee80211_link_sta *link_sta)
+                                           struct ieee80211_sta *sta)
 {
        if (unlikely(iwl_mvm_check_pn(mvm, skb, queue, sta))) {
                kfree_skb(skb);
                return;
        }
 
-       if (sta && sta->valid_links && link_sta) {
-               struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb);
-
-               rx_status->link_valid = 1;
-               rx_status->link_id = link_sta->link_id;
-       }
-
        ieee80211_rx_napi(mvm->hw, sta, skb, napi);
 }
 
@@ -587,7 +579,7 @@ static void iwl_mvm_release_frames(struct iwl_mvm *mvm,
                while ((skb = __skb_dequeue(skb_list))) {
                        iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb,
                                                        reorder_buf->queue,
-                                                       sta, NULL /* FIXME */);
+                                                       sta);
                        reorder_buf->num_stored--;
                }
        }
@@ -2214,6 +2206,11 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi,
                        if (IS_ERR(sta))
                                sta = NULL;
                        link_sta = rcu_dereference(mvm->fw_id_to_link_sta[id]);
+
+                       if (sta && sta->valid_links && link_sta) {
+                               rx_status->link_valid = 1;
+                               rx_status->link_id = link_sta->link_id;
+                       }
                }
        } else if (!is_multicast_ether_addr(hdr->addr2)) {
                /*
@@ -2357,8 +2354,7 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi,
                    !(desc->amsdu_info & IWL_RX_MPDU_AMSDU_LAST_SUBFRAME))
                        rx_status->flag |= RX_FLAG_AMSDU_MORE;
 
-               iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta,
-                                               link_sta);
+               iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta);
        }
 out:
        rcu_read_unlock();