X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=net%2Fsched%2Fact_police.c;h=07ffdf9c5e59adfd1b771b33cc1da012d1c40807;hb=1e90474c377e92db7262a8968a45c1dd980ca9e5;hp=bf90e60f8411c1ff49281bef88360a98f2a32188;hpb=f79e3185dd0f8650022518d7624c876d8929061b;p=firefly-linux-kernel-4.4.55.git diff --git a/net/sched/act_police.c b/net/sched/act_police.c index bf90e60f8411..07ffdf9c5e59 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c @@ -16,14 +16,13 @@ #include #include #include -#include #include #include #include #include -#define L2T(p,L) ((p)->tcfp_R_tab->data[(L)>>(p)->tcfp_R_tab->rate.cell_log]) -#define L2T_P(p,L) ((p)->tcfp_P_tab->data[(L)>>(p)->tcfp_P_tab->rate.cell_log]) +#define L2T(p,L) qdisc_l2t((p)->tcfp_R_tab, L) +#define L2T_P(p,L) qdisc_l2t((p)->tcfp_P_tab, L) #define POL_TAB_MASK 15 static struct tcf_common *tcf_police_ht[POL_TAB_MASK + 1]; @@ -57,7 +56,7 @@ static int tcf_act_police_walker(struct sk_buff *skb, struct netlink_callback *c int err = 0, index = -1, i = 0, s_i = 0, n_i = 0; struct rtattr *r; - read_lock(&police_lock); + read_lock_bh(&police_lock); s_i = cb->args[0]; @@ -86,7 +85,7 @@ static int tcf_act_police_walker(struct sk_buff *skb, struct netlink_callback *c } } done: - read_unlock(&police_lock); + read_unlock_bh(&police_lock); if (n_i) cb->args[0] += n_i; return n_i; @@ -175,12 +174,12 @@ static int tcf_act_police_locate(struct rtattr *rta, struct rtattr *est, override: if (parm->rate.rate) { err = -ENOMEM; - R_tab = qdisc_get_rtab(&parm->rate, tb[TCA_POLICE_RATE-1]); + R_tab = qdisc_get_rtab(&parm->rate, (struct nlattr *)tb[TCA_POLICE_RATE-1]); if (R_tab == NULL) goto failure; if (parm->peakrate.rate) { P_tab = qdisc_get_rtab(&parm->peakrate, - tb[TCA_POLICE_PEAKRATE-1]); + (struct nlattr *)tb[TCA_POLICE_PEAKRATE-1]); if (P_tab == NULL) { qdisc_put_rtab(R_tab); goto failure; @@ -217,7 +216,7 @@ override: if (est) gen_replace_estimator(&police->tcf_bstats, &police->tcf_rate_est, - &police->tcf_lock, est); + &police->tcf_lock, (struct nlattr *)est); spin_unlock_bh(&police->tcf_lock); if (ret != ACT_P_CREATED)