diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /net/sched/act_police.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'net/sched/act_police.c')
-rw-r--r-- | net/sched/act_police.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/net/sched/act_police.c b/net/sched/act_police.c index 7ebf7439b478..b3b9b32f4e00 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c | |||
@@ -22,8 +22,8 @@ | |||
22 | #include <net/act_api.h> | 22 | #include <net/act_api.h> |
23 | #include <net/netlink.h> | 23 | #include <net/netlink.h> |
24 | 24 | ||
25 | #define L2T(p,L) qdisc_l2t((p)->tcfp_R_tab, L) | 25 | #define L2T(p, L) qdisc_l2t((p)->tcfp_R_tab, L) |
26 | #define L2T_P(p,L) qdisc_l2t((p)->tcfp_P_tab, L) | 26 | #define L2T_P(p, L) qdisc_l2t((p)->tcfp_P_tab, L) |
27 | 27 | ||
28 | #define POL_TAB_MASK 15 | 28 | #define POL_TAB_MASK 15 |
29 | static struct tcf_common *tcf_police_ht[POL_TAB_MASK + 1]; | 29 | static struct tcf_common *tcf_police_ht[POL_TAB_MASK + 1]; |
@@ -37,8 +37,7 @@ static struct tcf_hashinfo police_hash_info = { | |||
37 | }; | 37 | }; |
38 | 38 | ||
39 | /* old policer structure from before tc actions */ | 39 | /* old policer structure from before tc actions */ |
40 | struct tc_police_compat | 40 | struct tc_police_compat { |
41 | { | ||
42 | u32 index; | 41 | u32 index; |
43 | int action; | 42 | int action; |
44 | u32 limit; | 43 | u32 limit; |
@@ -97,11 +96,6 @@ nla_put_failure: | |||
97 | goto done; | 96 | goto done; |
98 | } | 97 | } |
99 | 98 | ||
100 | static void tcf_police_free_rcu(struct rcu_head *head) | ||
101 | { | ||
102 | kfree(container_of(head, struct tcf_police, tcf_rcu)); | ||
103 | } | ||
104 | |||
105 | static void tcf_police_destroy(struct tcf_police *p) | 99 | static void tcf_police_destroy(struct tcf_police *p) |
106 | { | 100 | { |
107 | unsigned int h = tcf_hash(p->tcf_index, POL_TAB_MASK); | 101 | unsigned int h = tcf_hash(p->tcf_index, POL_TAB_MASK); |
@@ -122,7 +116,7 @@ static void tcf_police_destroy(struct tcf_police *p) | |||
122 | * gen_estimator est_timer() might access p->tcf_lock | 116 | * gen_estimator est_timer() might access p->tcf_lock |
123 | * or bstats, wait a RCU grace period before freeing p | 117 | * or bstats, wait a RCU grace period before freeing p |
124 | */ | 118 | */ |
125 | call_rcu(&p->tcf_rcu, tcf_police_free_rcu); | 119 | kfree_rcu(p, tcf_rcu); |
126 | return; | 120 | return; |
127 | } | 121 | } |
128 | } | 122 | } |
@@ -139,7 +133,7 @@ static const struct nla_policy police_policy[TCA_POLICE_MAX + 1] = { | |||
139 | static int tcf_act_police_locate(struct nlattr *nla, struct nlattr *est, | 133 | static int tcf_act_police_locate(struct nlattr *nla, struct nlattr *est, |
140 | struct tc_action *a, int ovr, int bind) | 134 | struct tc_action *a, int ovr, int bind) |
141 | { | 135 | { |
142 | unsigned h; | 136 | unsigned int h; |
143 | int ret = 0, err; | 137 | int ret = 0, err; |
144 | struct nlattr *tb[TCA_POLICE_MAX + 1]; | 138 | struct nlattr *tb[TCA_POLICE_MAX + 1]; |
145 | struct tc_police *parm; | 139 | struct tc_police *parm; |
@@ -298,8 +292,7 @@ static int tcf_act_police(struct sk_buff *skb, struct tc_action *a, | |||
298 | 292 | ||
299 | spin_lock(&police->tcf_lock); | 293 | spin_lock(&police->tcf_lock); |
300 | 294 | ||
301 | police->tcf_bstats.bytes += qdisc_pkt_len(skb); | 295 | bstats_update(&police->tcf_bstats, skb); |
302 | police->tcf_bstats.packets++; | ||
303 | 296 | ||
304 | if (police->tcfp_ewma_rate && | 297 | if (police->tcfp_ewma_rate && |
305 | police->tcf_rate_est.bps >= police->tcfp_ewma_rate) { | 298 | police->tcf_rate_est.bps >= police->tcfp_ewma_rate) { |
@@ -403,7 +396,6 @@ static void __exit | |||
403 | police_cleanup_module(void) | 396 | police_cleanup_module(void) |
404 | { | 397 | { |
405 | tcf_unregister_action(&act_police_ops); | 398 | tcf_unregister_action(&act_police_ops); |
406 | rcu_barrier(); /* Wait for completion of call_rcu()'s (tcf_police_free_rcu) */ | ||
407 | } | 399 | } |
408 | 400 | ||
409 | module_init(police_init_module); | 401 | module_init(police_init_module); |