16 #include <asm/uaccess.h>
17 #include <linux/bitops.h>
18 #include <linux/module.h>
19 #include <linux/types.h>
20 #include <linux/kernel.h>
22 #include <linux/string.h>
24 #include <linux/socket.h>
27 #include <linux/errno.h>
29 #include <linux/netdevice.h>
31 #include <linux/rtnetlink.h>
33 #include <linux/rbtree.h>
34 #include <linux/slab.h>
79 #define EST_MAX_INTERVAL 5
111 static void est_timer(
unsigned long arg)
117 list_for_each_entry_rcu(e, &elist[idx].
list, list) {
128 nbytes = e->
bstats->bytes;
129 npackets = e->
bstats->packets;
144 if (!list_empty(&elist[idx].list))
164 rb_link_node(&est->
node, parent, p);
181 else if (bstats < e->bstats || rate_est != e->
rate_est)
214 if (nla_len(opt) <
sizeof(*parm))
234 spin_lock_bh(&est_tree_lock);
235 if (!elist[idx].timer.function) {
236 INIT_LIST_HEAD(&elist[idx].list);
240 if (list_empty(&elist[idx].list))
243 list_add_rcu(&est->
list, &elist[idx].list);
245 spin_unlock_bh(&est_tree_lock);
265 spin_lock_bh(&est_tree_lock);
266 while ((e = gen_find_node(bstats, rate_est))) {
273 list_del_rcu(&e->
list);
276 spin_unlock_bh(&est_tree_lock);
315 spin_lock_bh(&est_tree_lock);
316 res = gen_find_node(bstats, rate_est) !=
NULL;
317 spin_unlock_bh(&est_tree_lock);