mac80211: improve mesh fast tx patch
authorFelix Fietkau <nbd@nbd.name>
Sat, 13 Apr 2024 14:05:07 +0000 (16:05 +0200)
committerFelix Fietkau <nbd@nbd.name>
Sat, 13 Apr 2024 14:33:45 +0000 (16:33 +0200)
Change hash key struct size for faster lookup.
Fix clearing cache entries for forwarding

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/kernel/mac80211/patches/subsys/310-mac80211-split-mesh-fast-tx-cache-into-local-proxied.patch
package/kernel/mac80211/patches/subsys/314-wifi-mac80211-fix-race-condition-on-enabling-fast-xm.patch

index 4853cef723171e82906dabb649a08ce4bf7d2412..e142cfa4fed9bf0c861ffd970826f6194a890c75 100644 (file)
@@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
 --- a/net/mac80211/mesh.h
 +++ b/net/mac80211/mesh.h
-@@ -134,9 +134,33 @@ struct mesh_path {
+@@ -134,9 +134,38 @@ struct mesh_path {
  #define MESH_FAST_TX_CACHE_TIMEOUT            8000 /* msecs */
  
  /**
@@ -47,13 +47,18 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 + * @MESH_FAST_TX_TYPE_LOCAL: tx from the local vif address as SA
 + * @MESH_FAST_TX_TYPE_PROXIED: local tx with a different SA (e.g. bridged)
 + * @MESH_FAST_TX_TYPE_FORWARDED: forwarded from a different mesh point
++ * @NUM_MESH_FAST_TX_TYPE: number of entry types
 + */
 +enum ieee80211_mesh_fast_tx_type {
 +      MESH_FAST_TX_TYPE_LOCAL,
 +      MESH_FAST_TX_TYPE_PROXIED,
 +      MESH_FAST_TX_TYPE_FORWARDED,
++
++      /* must be last */
++      NUM_MESH_FAST_TX_TYPE
 +};
 +
++
 +/**
 + * struct ieee80211_mesh_fast_tx_key - cached mesh fast tx entry key
 + *
@@ -62,7 +67,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 + */
 +struct ieee80211_mesh_fast_tx_key {
 +      u8 addr[ETH_ALEN] __aligned(2);
-+      enum ieee80211_mesh_fast_tx_type type;
++      u16 type;
 +};
 +
 +/**
@@ -73,7 +78,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
   * @fast_tx: base fast_tx data
   * @hdr: cached mesh and rfc1042 headers
   * @hdrlen: length of mesh + rfc1042
-@@ -147,7 +171,7 @@ struct mesh_path {
+@@ -147,7 +176,7 @@ struct mesh_path {
   */
  struct ieee80211_mesh_fast_tx {
        struct rhash_head rhash;
@@ -82,7 +87,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
        struct ieee80211_fast_tx fast_tx;
        u8 hdr[sizeof(struct ieee80211s_hdr) + sizeof(rfc1042_header)];
-@@ -333,7 +357,8 @@ void mesh_path_tx_root_frame(struct ieee
+@@ -333,7 +362,8 @@ void mesh_path_tx_root_frame(struct ieee
  
  bool mesh_action_is_path_sel(struct ieee80211_mgmt *mgmt);
  struct ieee80211_mesh_fast_tx *
@@ -178,7 +183,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 -      entry = rhashtable_lookup_fast(&cache->rht, addr, fast_tx_rht_params);
 -      if (entry)
 -              mesh_fast_tx_entry_free(cache, entry);
-+      for (i = MESH_FAST_TX_TYPE_LOCAL; i < MESH_FAST_TX_TYPE_FORWARDED; i++) {
++      for (i = 0; i < NUM_MESH_FAST_TX_TYPE; i++) {
 +              key.type = i;
 +              entry = rhashtable_lookup_fast(&cache->rht, &key, fast_tx_rht_params);
 +              if (entry)
index 12ed2142abca2c182126c0cf0fce277d4ebec0a8..e7a7010c7fbb0998d4d5616f91a63a91b016be1c 100644 (file)
@@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/net/mac80211/sta_info.c
 +++ b/net/mac80211/sta_info.c
-@@ -914,6 +914,7 @@ static int sta_info_insert_finish(struct
+@@ -918,6 +918,7 @@ static int sta_info_insert_finish(struct
  
        if (ieee80211_vif_is_mesh(&sdata->vif))
                mesh_accept_plinks_update(sdata);