@@ -51,19 +51,13 @@ enum mesh_path_flags {
51
51
*
52
52
*
53
53
* @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
58
54
* @MESH_WORK_ROOT: the mesh root station needs to send a frame
59
55
* @MESH_WORK_DRIFT_ADJUST: time to compensate for clock drift relative to other
60
56
* mesh nodes
61
57
* @MESH_WORK_MBSS_CHANGED: rebuild beacon and notify driver of BSS changes
62
58
*/
63
59
enum mesh_deferred_task_flags {
64
60
MESH_WORK_HOUSEKEEPING ,
65
- MESH_WORK_GROW_MPATH_TABLE ,
66
- MESH_WORK_GROW_MPP_TABLE ,
67
61
MESH_WORK_ROOT ,
68
62
MESH_WORK_DRIFT_ADJUST ,
69
63
MESH_WORK_MBSS_CHANGED ,
@@ -105,6 +99,7 @@ enum mesh_deferred_task_flags {
105
99
struct mesh_path {
106
100
u8 dst [ETH_ALEN ];
107
101
u8 mpp [ETH_ALEN ]; /* used for MPP or MAP */
102
+ struct rhash_head rhash ;
108
103
struct hlist_node gate_list ;
109
104
struct ieee80211_sub_if_data * sdata ;
110
105
struct sta_info __rcu * next_hop ;
@@ -129,34 +124,17 @@ struct mesh_path {
129
124
/**
130
125
* struct mesh_table
131
126
*
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
136
127
* @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
141
128
* @known_gates: list of known mesh gates and their mpaths by the station. The
142
129
* 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
145
131
*/
146
132
struct 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 */
152
133
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 ;
156
134
struct hlist_head * known_gates ;
157
135
spinlock_t gates_lock ;
158
136
159
- struct rcu_head rcu_head ;
137
+ struct rhashtable rhead ;
160
138
};
161
139
162
140
/* Recent multicast cache */
@@ -300,9 +278,6 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata,
300
278
void mesh_sta_cleanup (struct sta_info * sta );
301
279
302
280
/* 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 );
306
281
/* Mesh paths */
307
282
int mesh_path_error_tx (struct ieee80211_sub_if_data * sdata ,
308
283
u8 ttl , const u8 * target , u32 target_sn ,
0 commit comments