@@ -51,19 +51,13 @@ enum mesh_path_flags {
5151 *
5252 *
5353 * @MESH_WORK_HOUSEKEEPING: run the periodic mesh housekeeping tasks
54- * @MESH_WORK_GROW_MPATH_TABLE: the mesh path table is full and needs
55- * to grow.
56- * @MESH_WORK_GROW_MPP_TABLE: the mesh portals table is full and needs to
57- * grow
5854 * @MESH_WORK_ROOT: the mesh root station needs to send a frame
5955 * @MESH_WORK_DRIFT_ADJUST: time to compensate for clock drift relative to other
6056 * mesh nodes
6157 * @MESH_WORK_MBSS_CHANGED: rebuild beacon and notify driver of BSS changes
6258 */
6359enum mesh_deferred_task_flags {
6460 MESH_WORK_HOUSEKEEPING ,
65- MESH_WORK_GROW_MPATH_TABLE ,
66- MESH_WORK_GROW_MPP_TABLE ,
6761 MESH_WORK_ROOT ,
6862 MESH_WORK_DRIFT_ADJUST ,
6963 MESH_WORK_MBSS_CHANGED ,
@@ -105,6 +99,7 @@ enum mesh_deferred_task_flags {
10599struct mesh_path {
106100 u8 dst [ETH_ALEN ];
107101 u8 mpp [ETH_ALEN ]; /* used for MPP or MAP */
102+ struct rhash_head rhash ;
108103 struct hlist_node gate_list ;
109104 struct ieee80211_sub_if_data * sdata ;
110105 struct sta_info __rcu * next_hop ;
@@ -129,34 +124,17 @@ struct mesh_path {
129124/**
130125 * struct mesh_table
131126 *
132- * @hash_buckets: array of hash buckets of the table
133- * @hashwlock: array of locks to protect write operations, one per bucket
134- * @hash_mask: 2^size_order - 1, used to compute hash idx
135- * @hash_rnd: random value used for hash computations
136127 * @entries: number of entries in the table
137- * @free_node: function to free nodes of the table
138- * @copy_node: function to copy nodes of the table
139- * @size_order: determines size of the table, there will be 2^size_order hash
140- * buckets
141128 * @known_gates: list of known mesh gates and their mpaths by the station. The
142129 * gate's mpath may or may not be resolved and active.
143- *
144- * rcu_head: RCU head to free the table
130+ * @rhash: the rhashtable containing struct mesh_paths, keyed by dest addr
145131 */
146132struct mesh_table {
147- /* Number of buckets will be 2^N */
148- struct hlist_head * hash_buckets ;
149- spinlock_t * hashwlock ; /* One per bucket, for add/del */
150- unsigned int hash_mask ; /* (2^size_order) - 1 */
151- __u32 hash_rnd ; /* Used for hash generation */
152133 atomic_t entries ; /* Up to MAX_MESH_NEIGHBOURS */
153- void (* free_node ) (struct hlist_node * p , bool free_leafs );
154- int (* copy_node ) (struct hlist_node * p , struct mesh_table * newtbl );
155- int size_order ;
156134 struct hlist_head * known_gates ;
157135 spinlock_t gates_lock ;
158136
159- struct rcu_head rcu_head ;
137+ struct rhashtable rhead ;
160138};
161139
162140/* Recent multicast cache */
@@ -300,9 +278,6 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata,
300278void mesh_sta_cleanup (struct sta_info * sta );
301279
302280/* Private interfaces */
303- /* Mesh tables */
304- void mesh_mpath_table_grow (struct ieee80211_sub_if_data * sdata );
305- void mesh_mpp_table_grow (struct ieee80211_sub_if_data * sdata );
306281/* Mesh paths */
307282int mesh_path_error_tx (struct ieee80211_sub_if_data * sdata ,
308283 u8 ttl , const u8 * target , u32 target_sn ,
0 commit comments