LinuxKPI: 802.11: stop queues during key updates

When beginning key updates do stop and afterwards re-enable the tx queues
to avoid packets being passed to the driver.  This is a theoretical
problem at this point but helps some cases.  These functions will likely
need refinement in the future.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit db480c29879cac1afba1d887d7b8871aa4eef6db)
This commit is contained in:
Bjoern A. Zeeb 2025-06-05 21:47:08 +00:00 committed by Franco Fichtner
parent 59ea420e71
commit 857d924cd9

View file

@ -174,6 +174,7 @@ static void lkpi_ieee80211_free_skb_mbuf(void *);
#ifdef LKPI_80211_WME
static int lkpi_wme_update(struct lkpi_hw *, struct ieee80211vap *, bool);
#endif
static void lkpi_ieee80211_wake_queues_locked(struct ieee80211_hw *);
static const char *
lkpi_rate_info_bw_to_str(enum rate_info_bw bw)
@ -1582,6 +1583,11 @@ lkpi_iv_key_update_begin(struct ieee80211vap *vap)
refcount_acquire(&lvif->ic_unlocked);
if (ntislocked)
refcount_acquire(&lvif->nt_unlocked);
/*
* Stop the queues while doing key updates.
*/
ieee80211_stop_queues(hw);
}
static void
@ -1600,6 +1606,11 @@ lkpi_iv_key_update_end(struct ieee80211vap *vap)
lvif = VAP_TO_LVIF(vap);
nt = &ic->ic_sta;
/*
* Re-enabled the queues after the key update.
*/
lkpi_ieee80211_wake_queues_locked(hw);
icislocked = IEEE80211_IS_LOCKED(ic);
MPASS(!icislocked);
ntislocked = IEEE80211_NODE_IS_LOCKED(nt);