Skip to content

Commit dc3998e

Browse files
alexw65500jmberg-intel
authored andcommitted
mac80211: AMPDU handling for rekeys with Extended Key ID
Extended Key ID allows A-MPDU sessions while rekeying as long as each A-MPDU aggregates only MPDUs with one keyid together. Drivers able to segregate MPDUs accordingly can tell mac80211 to not stop A-MPDU sessions when rekeying by setting the new flag IEEE80211_HW_AMPDU_KEYBORDER_SUPPORT. Signed-off-by: Alexander Wetzel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 3e47bf1 commit dc3998e

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

include/net/mac80211.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,6 +2268,10 @@ struct ieee80211_txq {
22682268
* @IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID: Hardware supports multi BSSID
22692269
* only for HE APs. Applies if @IEEE80211_HW_SUPPORTS_MULTI_BSSID is set.
22702270
*
2271+
* @IEEE80211_HW_AMPDU_KEYBORDER_SUPPORT: The card and driver is only
2272+
* aggregating MPDUs with the same keyid, allowing mac80211 to keep Tx
2273+
* A-MPDU sessions active while rekeying with Extended Key ID.
2274+
*
22712275
* @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays
22722276
*/
22732277
enum ieee80211_hw_flags {
@@ -2319,6 +2323,7 @@ enum ieee80211_hw_flags {
23192323
IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN,
23202324
IEEE80211_HW_SUPPORTS_MULTI_BSSID,
23212325
IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID,
2326+
IEEE80211_HW_AMPDU_KEYBORDER_SUPPORT,
23222327

23232328
/* keep last, obviously */
23242329
NUM_IEEE80211_HW_FLAGS

net/mac80211/debugfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ static const char *hw_flag_names[] = {
271271
FLAG(TX_STATUS_NO_AMPDU_LEN),
272272
FLAG(SUPPORTS_MULTI_BSSID),
273273
FLAG(SUPPORTS_ONLY_HE_MULTI_BSSID),
274+
FLAG(AMPDU_KEYBORDER_SUPPORT),
274275
#undef FLAG
275276
};
276277

net/mac80211/key.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ int ieee80211_set_tx_key(struct ieee80211_key *key)
270270

271271
sta->ptk_idx = key->conf.keyidx;
272272

273-
clear_sta_flag(sta, WLAN_STA_BLOCK_BA);
273+
if (!ieee80211_hw_check(&local->hw, AMPDU_KEYBORDER_SUPPORT))
274+
clear_sta_flag(sta, WLAN_STA_BLOCK_BA);
274275
ieee80211_check_fast_xmit(sta);
275276

276277
return 0;
@@ -288,15 +289,16 @@ static void ieee80211_pairwise_rekey(struct ieee80211_key *old,
288289
if (new->conf.flags & IEEE80211_KEY_FLAG_NO_AUTO_TX) {
289290
/* Extended Key ID key install, initial one or rekey */
290291

291-
if (sta->ptk_idx != INVALID_PTK_KEYIDX) {
292+
if (sta->ptk_idx != INVALID_PTK_KEYIDX &&
293+
!ieee80211_hw_check(&local->hw, AMPDU_KEYBORDER_SUPPORT)) {
292294
/* Aggregation Sessions with Extended Key ID must not
293295
* mix MPDUs with different keyIDs within one A-MPDU.
294296
* Tear down running Tx aggregation sessions and block
295297
* new Rx/Tx aggregation requests during rekey to
296-
* ensure there are no A-MPDUs for the driver to
297-
* aggregate. (Blocking Tx only would be sufficient but
298-
* WLAN_STA_BLOCK_BA gets the job done for the few ms
299-
* we need it.)
298+
* ensure there are no A-MPDUs when the driver is not
299+
* supporting A-MPDU key borders. (Blocking Tx only
300+
* would be sufficient but WLAN_STA_BLOCK_BA gets the
301+
* job done for the few ms we need it.)
300302
*/
301303
set_sta_flag(sta, WLAN_STA_BLOCK_BA);
302304
mutex_lock(&sta->ampdu_mlme.mtx);

0 commit comments

Comments
 (0)