From 857d924cd99847e1dadfb4deabd6c4e06f2a4e4e Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Thu, 5 Jun 2025 21:47:08 +0000 Subject: [PATCH] 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) --- sys/compat/linuxkpi/common/src/linux_80211.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index da4342b0c47..6cbcb971001 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -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);