act_police.c (ebf8889bd1fe3615991ff4494635d237280652a2) act_police.c (1e90474c377e92db7262a8968a45c1dd980ca9e5)
1/*
2 * net/sched/police.c Input police filter.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 *

--- 160 unchanged lines hidden (view full) ---

169 ret = ACT_P_CREATED;
170 police->tcf_refcnt = 1;
171 spin_lock_init(&police->tcf_lock);
172 if (bind)
173 police->tcf_bindcnt = 1;
174override:
175 if (parm->rate.rate) {
176 err = -ENOMEM;
1/*
2 * net/sched/police.c Input police filter.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 *

--- 160 unchanged lines hidden (view full) ---

169 ret = ACT_P_CREATED;
170 police->tcf_refcnt = 1;
171 spin_lock_init(&police->tcf_lock);
172 if (bind)
173 police->tcf_bindcnt = 1;
174override:
175 if (parm->rate.rate) {
176 err = -ENOMEM;
177 R_tab = qdisc_get_rtab(&parm->rate, tb[TCA_POLICE_RATE-1]);
177 R_tab = qdisc_get_rtab(&parm->rate, (struct nlattr *)tb[TCA_POLICE_RATE-1]);
178 if (R_tab == NULL)
179 goto failure;
180 if (parm->peakrate.rate) {
181 P_tab = qdisc_get_rtab(&parm->peakrate,
178 if (R_tab == NULL)
179 goto failure;
180 if (parm->peakrate.rate) {
181 P_tab = qdisc_get_rtab(&parm->peakrate,
182 tb[TCA_POLICE_PEAKRATE-1]);
182 (struct nlattr *)tb[TCA_POLICE_PEAKRATE-1]);
183 if (P_tab == NULL) {
184 qdisc_put_rtab(R_tab);
185 goto failure;
186 }
187 }
188 }
189 /* No failure allowed after this point */
190 spin_lock_bh(&police->tcf_lock);

--- 20 unchanged lines hidden (view full) ---

211 police->tcf_action = parm->action;
212
213 if (tb[TCA_POLICE_AVRATE-1])
214 police->tcfp_ewma_rate =
215 *(u32*)RTA_DATA(tb[TCA_POLICE_AVRATE-1]);
216 if (est)
217 gen_replace_estimator(&police->tcf_bstats,
218 &police->tcf_rate_est,
183 if (P_tab == NULL) {
184 qdisc_put_rtab(R_tab);
185 goto failure;
186 }
187 }
188 }
189 /* No failure allowed after this point */
190 spin_lock_bh(&police->tcf_lock);

--- 20 unchanged lines hidden (view full) ---

211 police->tcf_action = parm->action;
212
213 if (tb[TCA_POLICE_AVRATE-1])
214 police->tcfp_ewma_rate =
215 *(u32*)RTA_DATA(tb[TCA_POLICE_AVRATE-1]);
216 if (est)
217 gen_replace_estimator(&police->tcf_bstats,
218 &police->tcf_rate_est,
219 &police->tcf_lock, est);
219 &police->tcf_lock, (struct nlattr *)est);
220
221 spin_unlock_bh(&police->tcf_lock);
222 if (ret != ACT_P_CREATED)
223 return ret;
224
225 police->tcfp_t_c = psched_get_time();
226 police->tcf_index = parm->index ? parm->index :
227 tcf_hash_new_index(&police_idx_gen, &police_hash_info);

--- 152 unchanged lines hidden ---
220
221 spin_unlock_bh(&police->tcf_lock);
222 if (ret != ACT_P_CREATED)
223 return ret;
224
225 police->tcfp_t_c = psched_get_time();
226 police->tcf_index = parm->index ? parm->index :
227 tcf_hash_new_index(&police_idx_gen, &police_hash_info);

--- 152 unchanged lines hidden ---