diff options
Diffstat (limited to 'net/sched')
31 files changed, 97 insertions, 87 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c index a606025814a..f2fb67e701a 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c | |||
@@ -365,10 +365,10 @@ static struct tc_action_ops *tc_lookup_action_id(u32 type) | |||
365 | } | 365 | } |
366 | #endif | 366 | #endif |
367 | 367 | ||
368 | int tcf_action_exec(struct sk_buff *skb, struct tc_action *act, | 368 | int tcf_action_exec(struct sk_buff *skb, const struct tc_action *act, |
369 | struct tcf_result *res) | 369 | struct tcf_result *res) |
370 | { | 370 | { |
371 | struct tc_action *a; | 371 | const struct tc_action *a; |
372 | int ret = -1; | 372 | int ret = -1; |
373 | 373 | ||
374 | if (skb->tc_verd & TC_NCLS) { | 374 | if (skb->tc_verd & TC_NCLS) { |
@@ -1115,9 +1115,10 @@ nlmsg_failure: | |||
1115 | 1115 | ||
1116 | static int __init tc_action_init(void) | 1116 | static int __init tc_action_init(void) |
1117 | { | 1117 | { |
1118 | rtnl_register(PF_UNSPEC, RTM_NEWACTION, tc_ctl_action, NULL); | 1118 | rtnl_register(PF_UNSPEC, RTM_NEWACTION, tc_ctl_action, NULL, NULL); |
1119 | rtnl_register(PF_UNSPEC, RTM_DELACTION, tc_ctl_action, NULL); | 1119 | rtnl_register(PF_UNSPEC, RTM_DELACTION, tc_ctl_action, NULL, NULL); |
1120 | rtnl_register(PF_UNSPEC, RTM_GETACTION, tc_ctl_action, tc_dump_action); | 1120 | rtnl_register(PF_UNSPEC, RTM_GETACTION, tc_ctl_action, tc_dump_action, |
1121 | NULL); | ||
1121 | 1122 | ||
1122 | return 0; | 1123 | return 0; |
1123 | } | 1124 | } |
diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c index 6cdf9abe475..453a73431ac 100644 --- a/net/sched/act_csum.c +++ b/net/sched/act_csum.c | |||
@@ -500,7 +500,7 @@ fail: | |||
500 | } | 500 | } |
501 | 501 | ||
502 | static int tcf_csum(struct sk_buff *skb, | 502 | static int tcf_csum(struct sk_buff *skb, |
503 | struct tc_action *a, struct tcf_result *res) | 503 | const struct tc_action *a, struct tcf_result *res) |
504 | { | 504 | { |
505 | struct tcf_csum *p = a->priv; | 505 | struct tcf_csum *p = a->priv; |
506 | int action; | 506 | int action; |
diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c index 2b4ab4b05ce..b77f5a06a65 100644 --- a/net/sched/act_gact.c +++ b/net/sched/act_gact.c | |||
@@ -125,7 +125,8 @@ static int tcf_gact_cleanup(struct tc_action *a, int bind) | |||
125 | return 0; | 125 | return 0; |
126 | } | 126 | } |
127 | 127 | ||
128 | static int tcf_gact(struct sk_buff *skb, struct tc_action *a, struct tcf_result *res) | 128 | static int tcf_gact(struct sk_buff *skb, const struct tc_action *a, |
129 | struct tcf_result *res) | ||
129 | { | 130 | { |
130 | struct tcf_gact *gact = a->priv; | 131 | struct tcf_gact *gact = a->priv; |
131 | int action = TC_ACT_SHOT; | 132 | int action = TC_ACT_SHOT; |
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c index 9fc211a1b20..60f8f616e8f 100644 --- a/net/sched/act_ipt.c +++ b/net/sched/act_ipt.c | |||
@@ -195,7 +195,7 @@ static int tcf_ipt_cleanup(struct tc_action *a, int bind) | |||
195 | return tcf_ipt_release(ipt, bind); | 195 | return tcf_ipt_release(ipt, bind); |
196 | } | 196 | } |
197 | 197 | ||
198 | static int tcf_ipt(struct sk_buff *skb, struct tc_action *a, | 198 | static int tcf_ipt(struct sk_buff *skb, const struct tc_action *a, |
199 | struct tcf_result *res) | 199 | struct tcf_result *res) |
200 | { | 200 | { |
201 | int ret = 0, result = 0; | 201 | int ret = 0, result = 0; |
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index 961386e2f2c..e051398fdf6 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c | |||
@@ -154,7 +154,7 @@ static int tcf_mirred_cleanup(struct tc_action *a, int bind) | |||
154 | return 0; | 154 | return 0; |
155 | } | 155 | } |
156 | 156 | ||
157 | static int tcf_mirred(struct sk_buff *skb, struct tc_action *a, | 157 | static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a, |
158 | struct tcf_result *res) | 158 | struct tcf_result *res) |
159 | { | 159 | { |
160 | struct tcf_mirred *m = a->priv; | 160 | struct tcf_mirred *m = a->priv; |
@@ -196,8 +196,7 @@ static int tcf_mirred(struct sk_buff *skb, struct tc_action *a, | |||
196 | 196 | ||
197 | skb2->skb_iif = skb->dev->ifindex; | 197 | skb2->skb_iif = skb->dev->ifindex; |
198 | skb2->dev = dev; | 198 | skb2->dev = dev; |
199 | dev_queue_xmit(skb2); | 199 | err = dev_queue_xmit(skb2); |
200 | err = 0; | ||
201 | 200 | ||
202 | out: | 201 | out: |
203 | if (err) { | 202 | if (err) { |
diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c index 762b027650a..001d1b35486 100644 --- a/net/sched/act_nat.c +++ b/net/sched/act_nat.c | |||
@@ -102,7 +102,7 @@ static int tcf_nat_cleanup(struct tc_action *a, int bind) | |||
102 | return tcf_hash_release(&p->common, bind, &nat_hash_info); | 102 | return tcf_hash_release(&p->common, bind, &nat_hash_info); |
103 | } | 103 | } |
104 | 104 | ||
105 | static int tcf_nat(struct sk_buff *skb, struct tc_action *a, | 105 | static int tcf_nat(struct sk_buff *skb, const struct tc_action *a, |
106 | struct tcf_result *res) | 106 | struct tcf_result *res) |
107 | { | 107 | { |
108 | struct tcf_nat *p = a->priv; | 108 | struct tcf_nat *p = a->priv; |
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index 7affe9a9275..10d3aed8656 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c | |||
@@ -120,7 +120,7 @@ static int tcf_pedit_cleanup(struct tc_action *a, int bind) | |||
120 | return 0; | 120 | return 0; |
121 | } | 121 | } |
122 | 122 | ||
123 | static int tcf_pedit(struct sk_buff *skb, struct tc_action *a, | 123 | static int tcf_pedit(struct sk_buff *skb, const struct tc_action *a, |
124 | struct tcf_result *res) | 124 | struct tcf_result *res) |
125 | { | 125 | { |
126 | struct tcf_pedit *p = a->priv; | 126 | struct tcf_pedit *p = a->priv; |
diff --git a/net/sched/act_police.c b/net/sched/act_police.c index b3b9b32f4e0..6fb3f5af0f8 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c | |||
@@ -282,7 +282,7 @@ static int tcf_act_police_cleanup(struct tc_action *a, int bind) | |||
282 | return ret; | 282 | return ret; |
283 | } | 283 | } |
284 | 284 | ||
285 | static int tcf_act_police(struct sk_buff *skb, struct tc_action *a, | 285 | static int tcf_act_police(struct sk_buff *skb, const struct tc_action *a, |
286 | struct tcf_result *res) | 286 | struct tcf_result *res) |
287 | { | 287 | { |
288 | struct tcf_police *police = a->priv; | 288 | struct tcf_police *police = a->priv; |
diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c index a34a22de60b..73e0a3ab4d5 100644 --- a/net/sched/act_simple.c +++ b/net/sched/act_simple.c | |||
@@ -36,7 +36,8 @@ static struct tcf_hashinfo simp_hash_info = { | |||
36 | }; | 36 | }; |
37 | 37 | ||
38 | #define SIMP_MAX_DATA 32 | 38 | #define SIMP_MAX_DATA 32 |
39 | static int tcf_simp(struct sk_buff *skb, struct tc_action *a, struct tcf_result *res) | 39 | static int tcf_simp(struct sk_buff *skb, const struct tc_action *a, |
40 | struct tcf_result *res) | ||
40 | { | 41 | { |
41 | struct tcf_defact *d = a->priv; | 42 | struct tcf_defact *d = a->priv; |
42 | 43 | ||
diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c index 5f6f0c7c390..35dbbe91027 100644 --- a/net/sched/act_skbedit.c +++ b/net/sched/act_skbedit.c | |||
@@ -39,7 +39,7 @@ static struct tcf_hashinfo skbedit_hash_info = { | |||
39 | .lock = &skbedit_lock, | 39 | .lock = &skbedit_lock, |
40 | }; | 40 | }; |
41 | 41 | ||
42 | static int tcf_skbedit(struct sk_buff *skb, struct tc_action *a, | 42 | static int tcf_skbedit(struct sk_buff *skb, const struct tc_action *a, |
43 | struct tcf_result *res) | 43 | struct tcf_result *res) |
44 | { | 44 | { |
45 | struct tcf_skbedit *d = a->priv; | 45 | struct tcf_skbedit *d = a->priv; |
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index bb2c523f815..a69d44f1dac 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c | |||
@@ -40,9 +40,9 @@ static DEFINE_RWLOCK(cls_mod_lock); | |||
40 | 40 | ||
41 | /* Find classifier type by string name */ | 41 | /* Find classifier type by string name */ |
42 | 42 | ||
43 | static struct tcf_proto_ops *tcf_proto_lookup_ops(struct nlattr *kind) | 43 | static const struct tcf_proto_ops *tcf_proto_lookup_ops(struct nlattr *kind) |
44 | { | 44 | { |
45 | struct tcf_proto_ops *t = NULL; | 45 | const struct tcf_proto_ops *t = NULL; |
46 | 46 | ||
47 | if (kind) { | 47 | if (kind) { |
48 | read_lock(&cls_mod_lock); | 48 | read_lock(&cls_mod_lock); |
@@ -132,7 +132,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg) | |||
132 | struct Qdisc *q; | 132 | struct Qdisc *q; |
133 | struct tcf_proto **back, **chain; | 133 | struct tcf_proto **back, **chain; |
134 | struct tcf_proto *tp; | 134 | struct tcf_proto *tp; |
135 | struct tcf_proto_ops *tp_ops; | 135 | const struct tcf_proto_ops *tp_ops; |
136 | const struct Qdisc_class_ops *cops; | 136 | const struct Qdisc_class_ops *cops; |
137 | unsigned long cl; | 137 | unsigned long cl; |
138 | unsigned long fh; | 138 | unsigned long fh; |
@@ -610,10 +610,10 @@ EXPORT_SYMBOL(tcf_exts_dump_stats); | |||
610 | 610 | ||
611 | static int __init tc_filter_init(void) | 611 | static int __init tc_filter_init(void) |
612 | { | 612 | { |
613 | rtnl_register(PF_UNSPEC, RTM_NEWTFILTER, tc_ctl_tfilter, NULL); | 613 | rtnl_register(PF_UNSPEC, RTM_NEWTFILTER, tc_ctl_tfilter, NULL, NULL); |
614 | rtnl_register(PF_UNSPEC, RTM_DELTFILTER, tc_ctl_tfilter, NULL); | 614 | rtnl_register(PF_UNSPEC, RTM_DELTFILTER, tc_ctl_tfilter, NULL, NULL); |
615 | rtnl_register(PF_UNSPEC, RTM_GETTFILTER, tc_ctl_tfilter, | 615 | rtnl_register(PF_UNSPEC, RTM_GETTFILTER, tc_ctl_tfilter, |
616 | tc_dump_tfilter); | 616 | tc_dump_tfilter, NULL); |
617 | 617 | ||
618 | return 0; | 618 | return 0; |
619 | } | 619 | } |
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c index 8be8872dd57..ea1f70b5a5f 100644 --- a/net/sched/cls_basic.c +++ b/net/sched/cls_basic.c | |||
@@ -39,7 +39,7 @@ static const struct tcf_ext_map basic_ext_map = { | |||
39 | .police = TCA_BASIC_POLICE | 39 | .police = TCA_BASIC_POLICE |
40 | }; | 40 | }; |
41 | 41 | ||
42 | static int basic_classify(struct sk_buff *skb, struct tcf_proto *tp, | 42 | static int basic_classify(struct sk_buff *skb, const struct tcf_proto *tp, |
43 | struct tcf_result *res) | 43 | struct tcf_result *res) |
44 | { | 44 | { |
45 | int r; | 45 | int r; |
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c index 32a335194ca..f84fdc3a7f2 100644 --- a/net/sched/cls_cgroup.c +++ b/net/sched/cls_cgroup.c | |||
@@ -101,7 +101,7 @@ struct cls_cgroup_head { | |||
101 | struct tcf_ematch_tree ematches; | 101 | struct tcf_ematch_tree ematches; |
102 | }; | 102 | }; |
103 | 103 | ||
104 | static int cls_cgroup_classify(struct sk_buff *skb, struct tcf_proto *tp, | 104 | static int cls_cgroup_classify(struct sk_buff *skb, const struct tcf_proto *tp, |
105 | struct tcf_result *res) | 105 | struct tcf_result *res) |
106 | { | 106 | { |
107 | struct cls_cgroup_head *head = tp->root; | 107 | struct cls_cgroup_head *head = tp->root; |
diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c index 8ec01391d98..6994214db8f 100644 --- a/net/sched/cls_flow.c +++ b/net/sched/cls_flow.c | |||
@@ -121,7 +121,7 @@ static u32 flow_get_proto_src(struct sk_buff *skb) | |||
121 | if (!pskb_network_may_pull(skb, sizeof(*iph))) | 121 | if (!pskb_network_may_pull(skb, sizeof(*iph))) |
122 | break; | 122 | break; |
123 | iph = ip_hdr(skb); | 123 | iph = ip_hdr(skb); |
124 | if (iph->frag_off & htons(IP_MF | IP_OFFSET)) | 124 | if (ip_is_fragment(iph)) |
125 | break; | 125 | break; |
126 | poff = proto_ports_offset(iph->protocol); | 126 | poff = proto_ports_offset(iph->protocol); |
127 | if (poff >= 0 && | 127 | if (poff >= 0 && |
@@ -163,7 +163,7 @@ static u32 flow_get_proto_dst(struct sk_buff *skb) | |||
163 | if (!pskb_network_may_pull(skb, sizeof(*iph))) | 163 | if (!pskb_network_may_pull(skb, sizeof(*iph))) |
164 | break; | 164 | break; |
165 | iph = ip_hdr(skb); | 165 | iph = ip_hdr(skb); |
166 | if (iph->frag_off & htons(IP_MF | IP_OFFSET)) | 166 | if (ip_is_fragment(iph)) |
167 | break; | 167 | break; |
168 | poff = proto_ports_offset(iph->protocol); | 168 | poff = proto_ports_offset(iph->protocol); |
169 | if (poff >= 0 && | 169 | if (poff >= 0 && |
@@ -356,7 +356,7 @@ static u32 flow_key_get(struct sk_buff *skb, int key) | |||
356 | } | 356 | } |
357 | } | 357 | } |
358 | 358 | ||
359 | static int flow_classify(struct sk_buff *skb, struct tcf_proto *tp, | 359 | static int flow_classify(struct sk_buff *skb, const struct tcf_proto *tp, |
360 | struct tcf_result *res) | 360 | struct tcf_result *res) |
361 | { | 361 | { |
362 | struct flow_head *head = tp->root; | 362 | struct flow_head *head = tp->root; |
diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c index 26e7bc4ffb7..389af152ec4 100644 --- a/net/sched/cls_fw.c +++ b/net/sched/cls_fw.c | |||
@@ -77,7 +77,7 @@ static inline int fw_hash(u32 handle) | |||
77 | return handle & (HTSIZE - 1); | 77 | return handle & (HTSIZE - 1); |
78 | } | 78 | } |
79 | 79 | ||
80 | static int fw_classify(struct sk_buff *skb, struct tcf_proto *tp, | 80 | static int fw_classify(struct sk_buff *skb, const struct tcf_proto *tp, |
81 | struct tcf_result *res) | 81 | struct tcf_result *res) |
82 | { | 82 | { |
83 | struct fw_head *head = (struct fw_head *)tp->root; | 83 | struct fw_head *head = (struct fw_head *)tp->root; |
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c index a907905376d..13ab66e9df5 100644 --- a/net/sched/cls_route.c +++ b/net/sched/cls_route.c | |||
@@ -125,7 +125,7 @@ static inline int route4_hash_wild(void) | |||
125 | return 0; \ | 125 | return 0; \ |
126 | } | 126 | } |
127 | 127 | ||
128 | static int route4_classify(struct sk_buff *skb, struct tcf_proto *tp, | 128 | static int route4_classify(struct sk_buff *skb, const struct tcf_proto *tp, |
129 | struct tcf_result *res) | 129 | struct tcf_result *res) |
130 | { | 130 | { |
131 | struct route4_head *head = (struct route4_head *)tp->root; | 131 | struct route4_head *head = (struct route4_head *)tp->root; |
diff --git a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h index 402c44b241a..b01427924f8 100644 --- a/net/sched/cls_rsvp.h +++ b/net/sched/cls_rsvp.h | |||
@@ -130,7 +130,7 @@ static struct tcf_ext_map rsvp_ext_map = { | |||
130 | return r; \ | 130 | return r; \ |
131 | } | 131 | } |
132 | 132 | ||
133 | static int rsvp_classify(struct sk_buff *skb, struct tcf_proto *tp, | 133 | static int rsvp_classify(struct sk_buff *skb, const struct tcf_proto *tp, |
134 | struct tcf_result *res) | 134 | struct tcf_result *res) |
135 | { | 135 | { |
136 | struct rsvp_session **sht = ((struct rsvp_head *)tp->root)->ht; | 136 | struct rsvp_session **sht = ((struct rsvp_head *)tp->root)->ht; |
@@ -167,7 +167,7 @@ restart: | |||
167 | dst = &nhptr->daddr; | 167 | dst = &nhptr->daddr; |
168 | protocol = nhptr->protocol; | 168 | protocol = nhptr->protocol; |
169 | xprt = ((u8 *)nhptr) + (nhptr->ihl<<2); | 169 | xprt = ((u8 *)nhptr) + (nhptr->ihl<<2); |
170 | if (nhptr->frag_off & htons(IP_MF | IP_OFFSET)) | 170 | if (ip_is_fragment(nhptr)) |
171 | return -1; | 171 | return -1; |
172 | #endif | 172 | #endif |
173 | 173 | ||
@@ -425,7 +425,7 @@ static int rsvp_change(struct tcf_proto *tp, unsigned long base, | |||
425 | struct rsvp_filter *f, **fp; | 425 | struct rsvp_filter *f, **fp; |
426 | struct rsvp_session *s, **sp; | 426 | struct rsvp_session *s, **sp; |
427 | struct tc_rsvp_pinfo *pinfo = NULL; | 427 | struct tc_rsvp_pinfo *pinfo = NULL; |
428 | struct nlattr *opt = tca[TCA_OPTIONS-1]; | 428 | struct nlattr *opt = tca[TCA_OPTIONS]; |
429 | struct nlattr *tb[TCA_RSVP_MAX + 1]; | 429 | struct nlattr *tb[TCA_RSVP_MAX + 1]; |
430 | struct tcf_exts e; | 430 | struct tcf_exts e; |
431 | unsigned int h1, h2; | 431 | unsigned int h1, h2; |
@@ -439,7 +439,7 @@ static int rsvp_change(struct tcf_proto *tp, unsigned long base, | |||
439 | if (err < 0) | 439 | if (err < 0) |
440 | return err; | 440 | return err; |
441 | 441 | ||
442 | err = tcf_exts_validate(tp, tb, tca[TCA_RATE-1], &e, &rsvp_ext_map); | 442 | err = tcf_exts_validate(tp, tb, tca[TCA_RATE], &e, &rsvp_ext_map); |
443 | if (err < 0) | 443 | if (err < 0) |
444 | return err; | 444 | return err; |
445 | 445 | ||
@@ -449,8 +449,8 @@ static int rsvp_change(struct tcf_proto *tp, unsigned long base, | |||
449 | 449 | ||
450 | if (f->handle != handle && handle) | 450 | if (f->handle != handle && handle) |
451 | goto errout2; | 451 | goto errout2; |
452 | if (tb[TCA_RSVP_CLASSID-1]) { | 452 | if (tb[TCA_RSVP_CLASSID]) { |
453 | f->res.classid = nla_get_u32(tb[TCA_RSVP_CLASSID-1]); | 453 | f->res.classid = nla_get_u32(tb[TCA_RSVP_CLASSID]); |
454 | tcf_bind_filter(tp, &f->res, base); | 454 | tcf_bind_filter(tp, &f->res, base); |
455 | } | 455 | } |
456 | 456 | ||
@@ -462,7 +462,7 @@ static int rsvp_change(struct tcf_proto *tp, unsigned long base, | |||
462 | err = -EINVAL; | 462 | err = -EINVAL; |
463 | if (handle) | 463 | if (handle) |
464 | goto errout2; | 464 | goto errout2; |
465 | if (tb[TCA_RSVP_DST-1] == NULL) | 465 | if (tb[TCA_RSVP_DST] == NULL) |
466 | goto errout2; | 466 | goto errout2; |
467 | 467 | ||
468 | err = -ENOBUFS; | 468 | err = -ENOBUFS; |
@@ -471,19 +471,19 @@ static int rsvp_change(struct tcf_proto *tp, unsigned long base, | |||
471 | goto errout2; | 471 | goto errout2; |
472 | 472 | ||
473 | h2 = 16; | 473 | h2 = 16; |
474 | if (tb[TCA_RSVP_SRC-1]) { | 474 | if (tb[TCA_RSVP_SRC]) { |
475 | memcpy(f->src, nla_data(tb[TCA_RSVP_SRC-1]), sizeof(f->src)); | 475 | memcpy(f->src, nla_data(tb[TCA_RSVP_SRC]), sizeof(f->src)); |
476 | h2 = hash_src(f->src); | 476 | h2 = hash_src(f->src); |
477 | } | 477 | } |
478 | if (tb[TCA_RSVP_PINFO-1]) { | 478 | if (tb[TCA_RSVP_PINFO]) { |
479 | pinfo = nla_data(tb[TCA_RSVP_PINFO-1]); | 479 | pinfo = nla_data(tb[TCA_RSVP_PINFO]); |
480 | f->spi = pinfo->spi; | 480 | f->spi = pinfo->spi; |
481 | f->tunnelhdr = pinfo->tunnelhdr; | 481 | f->tunnelhdr = pinfo->tunnelhdr; |
482 | } | 482 | } |
483 | if (tb[TCA_RSVP_CLASSID-1]) | 483 | if (tb[TCA_RSVP_CLASSID]) |
484 | f->res.classid = nla_get_u32(tb[TCA_RSVP_CLASSID-1]); | 484 | f->res.classid = nla_get_u32(tb[TCA_RSVP_CLASSID]); |
485 | 485 | ||
486 | dst = nla_data(tb[TCA_RSVP_DST-1]); | 486 | dst = nla_data(tb[TCA_RSVP_DST]); |
487 | h1 = hash_dst(dst, pinfo ? pinfo->protocol : 0, pinfo ? pinfo->tunnelid : 0); | 487 | h1 = hash_dst(dst, pinfo ? pinfo->protocol : 0, pinfo ? pinfo->tunnelid : 0); |
488 | 488 | ||
489 | err = -ENOMEM; | 489 | err = -ENOMEM; |
@@ -642,8 +642,7 @@ nla_put_failure: | |||
642 | return -1; | 642 | return -1; |
643 | } | 643 | } |
644 | 644 | ||
645 | static struct tcf_proto_ops RSVP_OPS = { | 645 | static struct tcf_proto_ops RSVP_OPS __read_mostly = { |
646 | .next = NULL, | ||
647 | .kind = RSVP_ID, | 646 | .kind = RSVP_ID, |
648 | .classify = rsvp_classify, | 647 | .classify = rsvp_classify, |
649 | .init = rsvp_init, | 648 | .init = rsvp_init, |
diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c index 36667fa6423..dbe199234c6 100644 --- a/net/sched/cls_tcindex.c +++ b/net/sched/cls_tcindex.c | |||
@@ -79,7 +79,7 @@ tcindex_lookup(struct tcindex_data *p, u16 key) | |||
79 | } | 79 | } |
80 | 80 | ||
81 | 81 | ||
82 | static int tcindex_classify(struct sk_buff *skb, struct tcf_proto *tp, | 82 | static int tcindex_classify(struct sk_buff *skb, const struct tcf_proto *tp, |
83 | struct tcf_result *res) | 83 | struct tcf_result *res) |
84 | { | 84 | { |
85 | struct tcindex_data *p = PRIV(tp); | 85 | struct tcindex_data *p = PRIV(tp); |
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 3b93fc0c895..939b627b479 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c | |||
@@ -93,7 +93,7 @@ static inline unsigned int u32_hash_fold(__be32 key, | |||
93 | return h; | 93 | return h; |
94 | } | 94 | } |
95 | 95 | ||
96 | static int u32_classify(struct sk_buff *skb, struct tcf_proto *tp, struct tcf_result *res) | 96 | static int u32_classify(struct sk_buff *skb, const struct tcf_proto *tp, struct tcf_result *res) |
97 | { | 97 | { |
98 | struct { | 98 | struct { |
99 | struct tc_u_knode *knode; | 99 | struct tc_u_knode *knode; |
diff --git a/net/sched/em_meta.c b/net/sched/em_meta.c index 49130e8abff..1363bf14e61 100644 --- a/net/sched/em_meta.c +++ b/net/sched/em_meta.c | |||
@@ -404,12 +404,6 @@ META_COLLECTOR(int_sk_alloc) | |||
404 | dst->value = (__force int) skb->sk->sk_allocation; | 404 | dst->value = (__force int) skb->sk->sk_allocation; |
405 | } | 405 | } |
406 | 406 | ||
407 | META_COLLECTOR(int_sk_route_caps) | ||
408 | { | ||
409 | SKIP_NONLOCAL(skb); | ||
410 | dst->value = skb->sk->sk_route_caps; | ||
411 | } | ||
412 | |||
413 | META_COLLECTOR(int_sk_hash) | 407 | META_COLLECTOR(int_sk_hash) |
414 | { | 408 | { |
415 | SKIP_NONLOCAL(skb); | 409 | SKIP_NONLOCAL(skb); |
@@ -530,7 +524,6 @@ static struct meta_ops __meta_ops[TCF_META_TYPE_MAX + 1][TCF_META_ID_MAX + 1] = | |||
530 | [META_ID(SK_ERR_QLEN)] = META_FUNC(int_sk_err_qlen), | 524 | [META_ID(SK_ERR_QLEN)] = META_FUNC(int_sk_err_qlen), |
531 | [META_ID(SK_FORWARD_ALLOCS)] = META_FUNC(int_sk_fwd_alloc), | 525 | [META_ID(SK_FORWARD_ALLOCS)] = META_FUNC(int_sk_fwd_alloc), |
532 | [META_ID(SK_ALLOCS)] = META_FUNC(int_sk_alloc), | 526 | [META_ID(SK_ALLOCS)] = META_FUNC(int_sk_alloc), |
533 | [META_ID(SK_ROUTE_CAPS)] = META_FUNC(int_sk_route_caps), | ||
534 | [META_ID(SK_HASH)] = META_FUNC(int_sk_hash), | 527 | [META_ID(SK_HASH)] = META_FUNC(int_sk_hash), |
535 | [META_ID(SK_LINGERTIME)] = META_FUNC(int_sk_lingertime), | 528 | [META_ID(SK_LINGERTIME)] = META_FUNC(int_sk_lingertime), |
536 | [META_ID(SK_ACK_BACKLOG)] = META_FUNC(int_sk_ack_bl), | 529 | [META_ID(SK_ACK_BACKLOG)] = META_FUNC(int_sk_ack_bl), |
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 6b8627661c9..dca6c1a576f 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
@@ -1644,7 +1644,7 @@ done: | |||
1644 | * to this qdisc, (optionally) tests for protocol and asks | 1644 | * to this qdisc, (optionally) tests for protocol and asks |
1645 | * specific classifiers. | 1645 | * specific classifiers. |
1646 | */ | 1646 | */ |
1647 | int tc_classify_compat(struct sk_buff *skb, struct tcf_proto *tp, | 1647 | int tc_classify_compat(struct sk_buff *skb, const struct tcf_proto *tp, |
1648 | struct tcf_result *res) | 1648 | struct tcf_result *res) |
1649 | { | 1649 | { |
1650 | __be16 protocol = skb->protocol; | 1650 | __be16 protocol = skb->protocol; |
@@ -1668,12 +1668,12 @@ int tc_classify_compat(struct sk_buff *skb, struct tcf_proto *tp, | |||
1668 | } | 1668 | } |
1669 | EXPORT_SYMBOL(tc_classify_compat); | 1669 | EXPORT_SYMBOL(tc_classify_compat); |
1670 | 1670 | ||
1671 | int tc_classify(struct sk_buff *skb, struct tcf_proto *tp, | 1671 | int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp, |
1672 | struct tcf_result *res) | 1672 | struct tcf_result *res) |
1673 | { | 1673 | { |
1674 | int err = 0; | 1674 | int err = 0; |
1675 | #ifdef CONFIG_NET_CLS_ACT | 1675 | #ifdef CONFIG_NET_CLS_ACT |
1676 | struct tcf_proto *otp = tp; | 1676 | const struct tcf_proto *otp = tp; |
1677 | reclassify: | 1677 | reclassify: |
1678 | #endif | 1678 | #endif |
1679 | 1679 | ||
@@ -1792,12 +1792,12 @@ static int __init pktsched_init(void) | |||
1792 | register_qdisc(&pfifo_head_drop_qdisc_ops); | 1792 | register_qdisc(&pfifo_head_drop_qdisc_ops); |
1793 | register_qdisc(&mq_qdisc_ops); | 1793 | register_qdisc(&mq_qdisc_ops); |
1794 | 1794 | ||
1795 | rtnl_register(PF_UNSPEC, RTM_NEWQDISC, tc_modify_qdisc, NULL); | 1795 | rtnl_register(PF_UNSPEC, RTM_NEWQDISC, tc_modify_qdisc, NULL, NULL); |
1796 | rtnl_register(PF_UNSPEC, RTM_DELQDISC, tc_get_qdisc, NULL); | 1796 | rtnl_register(PF_UNSPEC, RTM_DELQDISC, tc_get_qdisc, NULL, NULL); |
1797 | rtnl_register(PF_UNSPEC, RTM_GETQDISC, tc_get_qdisc, tc_dump_qdisc); | 1797 | rtnl_register(PF_UNSPEC, RTM_GETQDISC, tc_get_qdisc, tc_dump_qdisc, NULL); |
1798 | rtnl_register(PF_UNSPEC, RTM_NEWTCLASS, tc_ctl_tclass, NULL); | 1798 | rtnl_register(PF_UNSPEC, RTM_NEWTCLASS, tc_ctl_tclass, NULL, NULL); |
1799 | rtnl_register(PF_UNSPEC, RTM_DELTCLASS, tc_ctl_tclass, NULL); | 1799 | rtnl_register(PF_UNSPEC, RTM_DELTCLASS, tc_ctl_tclass, NULL, NULL); |
1800 | rtnl_register(PF_UNSPEC, RTM_GETTCLASS, tc_ctl_tclass, tc_dump_tclass); | 1800 | rtnl_register(PF_UNSPEC, RTM_GETTCLASS, tc_ctl_tclass, tc_dump_tclass, NULL); |
1801 | 1801 | ||
1802 | return 0; | 1802 | return 0; |
1803 | } | 1803 | } |
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c index 3f08158b868..e25e49061a0 100644 --- a/net/sched/sch_atm.c +++ b/net/sched/sch_atm.c | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/module.h> | 5 | #include <linux/module.h> |
6 | #include <linux/slab.h> | 6 | #include <linux/slab.h> |
7 | #include <linux/init.h> | 7 | #include <linux/init.h> |
8 | #include <linux/interrupt.h> | ||
8 | #include <linux/string.h> | 9 | #include <linux/string.h> |
9 | #include <linux/errno.h> | 10 | #include <linux/errno.h> |
10 | #include <linux/skbuff.h> | 11 | #include <linux/skbuff.h> |
diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c index 06afbaeb4c8..3422b25df9e 100644 --- a/net/sched/sch_choke.c +++ b/net/sched/sch_choke.c | |||
@@ -181,7 +181,7 @@ static bool choke_match_flow(struct sk_buff *skb1, | |||
181 | ip1->saddr != ip2->saddr || ip1->daddr != ip2->daddr) | 181 | ip1->saddr != ip2->saddr || ip1->daddr != ip2->daddr) |
182 | return false; | 182 | return false; |
183 | 183 | ||
184 | if ((ip1->frag_off | ip2->frag_off) & htons(IP_MF | IP_OFFSET)) | 184 | if (ip_is_fragment(ip1) | ip_is_fragment(ip2)) |
185 | ip_proto = 0; | 185 | ip_proto = 0; |
186 | off1 += ip1->ihl * 4; | 186 | off1 += ip1->ihl * 4; |
187 | off2 += ip2->ihl * 4; | 187 | off2 += ip2->ihl * 4; |
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index b4c680900d7..69fca279880 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -189,15 +189,15 @@ static inline int qdisc_restart(struct Qdisc *q) | |||
189 | 189 | ||
190 | void __qdisc_run(struct Qdisc *q) | 190 | void __qdisc_run(struct Qdisc *q) |
191 | { | 191 | { |
192 | unsigned long start_time = jiffies; | 192 | int quota = weight_p; |
193 | 193 | ||
194 | while (qdisc_restart(q)) { | 194 | while (qdisc_restart(q)) { |
195 | /* | 195 | /* |
196 | * Postpone processing if | 196 | * Ordered by possible occurrence: Postpone processing if |
197 | * 1. another process needs the CPU; | 197 | * 1. we've exceeded packet quota |
198 | * 2. we've been doing it for too long. | 198 | * 2. another process needs the CPU; |
199 | */ | 199 | */ |
200 | if (need_resched() || jiffies != start_time) { | 200 | if (--quota <= 0 || need_resched()) { |
201 | __netif_schedule(q); | 201 | __netif_schedule(q); |
202 | break; | 202 | break; |
203 | } | 203 | } |
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c index b9493a09a87..6cd8ddfb512 100644 --- a/net/sched/sch_gred.c +++ b/net/sched/sch_gred.c | |||
@@ -385,7 +385,7 @@ static inline int gred_change_vq(struct Qdisc *sch, int dp, | |||
385 | struct gred_sched_data *q; | 385 | struct gred_sched_data *q; |
386 | 386 | ||
387 | if (table->tab[dp] == NULL) { | 387 | if (table->tab[dp] == NULL) { |
388 | table->tab[dp] = kzalloc(sizeof(*q), GFP_KERNEL); | 388 | table->tab[dp] = kzalloc(sizeof(*q), GFP_ATOMIC); |
389 | if (table->tab[dp] == NULL) | 389 | if (table->tab[dp] == NULL) |
390 | return -ENOMEM; | 390 | return -ENOMEM; |
391 | } | 391 | } |
diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c index ea17cbed29e..59b26b8ff4b 100644 --- a/net/sched/sch_mqprio.c +++ b/net/sched/sch_mqprio.c | |||
@@ -106,7 +106,7 @@ static int mqprio_init(struct Qdisc *sch, struct nlattr *opt) | |||
106 | if (!netif_is_multiqueue(dev)) | 106 | if (!netif_is_multiqueue(dev)) |
107 | return -EOPNOTSUPP; | 107 | return -EOPNOTSUPP; |
108 | 108 | ||
109 | if (nla_len(opt) < sizeof(*qopt)) | 109 | if (!opt || nla_len(opt) < sizeof(*qopt)) |
110 | return -EINVAL; | 110 | return -EINVAL; |
111 | 111 | ||
112 | qopt = nla_data(opt); | 112 | qopt = nla_data(opt); |
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index 69c35f6cd13..eb3b9a86c6e 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
@@ -13,6 +13,7 @@ | |||
13 | * Catalin(ux aka Dino) BOIE <catab at umbrella dot ro> | 13 | * Catalin(ux aka Dino) BOIE <catab at umbrella dot ro> |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/mm.h> | ||
16 | #include <linux/module.h> | 17 | #include <linux/module.h> |
17 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
18 | #include <linux/types.h> | 19 | #include <linux/types.h> |
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index 2a318f2dc3e..b5d56a22b1d 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c | |||
@@ -112,7 +112,7 @@ static struct sk_buff *prio_dequeue(struct Qdisc *sch) | |||
112 | 112 | ||
113 | for (prio = 0; prio < q->bands; prio++) { | 113 | for (prio = 0; prio < q->bands; prio++) { |
114 | struct Qdisc *qdisc = q->queues[prio]; | 114 | struct Qdisc *qdisc = q->queues[prio]; |
115 | struct sk_buff *skb = qdisc->dequeue(qdisc); | 115 | struct sk_buff *skb = qdisc_dequeue_peeked(qdisc); |
116 | if (skb) { | 116 | if (skb) { |
117 | qdisc_bstats_update(sch, skb); | 117 | qdisc_bstats_update(sch, skb); |
118 | sch->q.qlen--; | 118 | sch->q.qlen--; |
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c index 6649463da1b..d617161f8dd 100644 --- a/net/sched/sch_red.c +++ b/net/sched/sch_red.c | |||
@@ -209,8 +209,8 @@ static int red_change(struct Qdisc *sch, struct nlattr *opt) | |||
209 | ctl->Plog, ctl->Scell_log, | 209 | ctl->Plog, ctl->Scell_log, |
210 | nla_data(tb[TCA_RED_STAB])); | 210 | nla_data(tb[TCA_RED_STAB])); |
211 | 211 | ||
212 | if (skb_queue_empty(&sch->q)) | 212 | if (!q->qdisc->q.qlen) |
213 | red_end_of_idle_period(&q->parms); | 213 | red_start_of_idle_period(&q->parms); |
214 | 214 | ||
215 | sch_tree_unlock(sch); | 215 | sch_tree_unlock(sch); |
216 | return 0; | 216 | return 0; |
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index b6ea6afa55b..4f5510e2bd6 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c | |||
@@ -157,7 +157,7 @@ static unsigned int sfq_hash(struct sfq_sched_data *q, struct sk_buff *skb) | |||
157 | iph = ip_hdr(skb); | 157 | iph = ip_hdr(skb); |
158 | h = (__force u32)iph->daddr; | 158 | h = (__force u32)iph->daddr; |
159 | h2 = (__force u32)iph->saddr ^ iph->protocol; | 159 | h2 = (__force u32)iph->saddr ^ iph->protocol; |
160 | if (iph->frag_off & htons(IP_MF | IP_OFFSET)) | 160 | if (ip_is_fragment(iph)) |
161 | break; | 161 | break; |
162 | poff = proto_ports_offset(iph->protocol); | 162 | poff = proto_ports_offset(iph->protocol); |
163 | if (poff >= 0 && | 163 | if (poff >= 0 && |
@@ -410,7 +410,12 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
410 | /* Return Congestion Notification only if we dropped a packet | 410 | /* Return Congestion Notification only if we dropped a packet |
411 | * from this flow. | 411 | * from this flow. |
412 | */ | 412 | */ |
413 | return (qlen != slot->qlen) ? NET_XMIT_CN : NET_XMIT_SUCCESS; | 413 | if (qlen != slot->qlen) |
414 | return NET_XMIT_CN; | ||
415 | |||
416 | /* As we dropped a packet, better let upper stack know this */ | ||
417 | qdisc_tree_decrease_qlen(sch, 1); | ||
418 | return NET_XMIT_SUCCESS; | ||
414 | } | 419 | } |
415 | 420 | ||
416 | static struct sk_buff * | 421 | static struct sk_buff * |
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c index 45cd30098e3..4f4c52c0eeb 100644 --- a/net/sched/sch_teql.c +++ b/net/sched/sch_teql.c | |||
@@ -225,11 +225,11 @@ static int teql_qdisc_init(struct Qdisc *sch, struct nlattr *opt) | |||
225 | 225 | ||
226 | 226 | ||
227 | static int | 227 | static int |
228 | __teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, struct net_device *dev) | 228 | __teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, |
229 | struct net_device *dev, struct netdev_queue *txq, | ||
230 | struct neighbour *mn) | ||
229 | { | 231 | { |
230 | struct netdev_queue *dev_queue = netdev_get_tx_queue(dev, 0); | 232 | struct teql_sched_data *q = qdisc_priv(txq->qdisc); |
231 | struct teql_sched_data *q = qdisc_priv(dev_queue->qdisc); | ||
232 | struct neighbour *mn = skb_dst(skb)->neighbour; | ||
233 | struct neighbour *n = q->ncache; | 233 | struct neighbour *n = q->ncache; |
234 | 234 | ||
235 | if (mn->tbl == NULL) | 235 | if (mn->tbl == NULL) |
@@ -262,17 +262,26 @@ __teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, struct net_device * | |||
262 | } | 262 | } |
263 | 263 | ||
264 | static inline int teql_resolve(struct sk_buff *skb, | 264 | static inline int teql_resolve(struct sk_buff *skb, |
265 | struct sk_buff *skb_res, struct net_device *dev) | 265 | struct sk_buff *skb_res, |
266 | struct net_device *dev, | ||
267 | struct netdev_queue *txq) | ||
266 | { | 268 | { |
267 | struct netdev_queue *txq = netdev_get_tx_queue(dev, 0); | 269 | struct dst_entry *dst = skb_dst(skb); |
270 | struct neighbour *mn; | ||
271 | int res; | ||
272 | |||
268 | if (txq->qdisc == &noop_qdisc) | 273 | if (txq->qdisc == &noop_qdisc) |
269 | return -ENODEV; | 274 | return -ENODEV; |
270 | 275 | ||
271 | if (dev->header_ops == NULL || | 276 | if (!dev->header_ops || !dst) |
272 | skb_dst(skb) == NULL || | ||
273 | skb_dst(skb)->neighbour == NULL) | ||
274 | return 0; | 277 | return 0; |
275 | return __teql_resolve(skb, skb_res, dev); | 278 | |
279 | rcu_read_lock(); | ||
280 | mn = dst_get_neighbour(dst); | ||
281 | res = mn ? __teql_resolve(skb, skb_res, dev, txq, mn) : 0; | ||
282 | rcu_read_unlock(); | ||
283 | |||
284 | return res; | ||
276 | } | 285 | } |
277 | 286 | ||
278 | static netdev_tx_t teql_master_xmit(struct sk_buff *skb, struct net_device *dev) | 287 | static netdev_tx_t teql_master_xmit(struct sk_buff *skb, struct net_device *dev) |
@@ -307,7 +316,7 @@ restart: | |||
307 | continue; | 316 | continue; |
308 | } | 317 | } |
309 | 318 | ||
310 | switch (teql_resolve(skb, skb_res, slave)) { | 319 | switch (teql_resolve(skb, skb_res, slave, slave_txq)) { |
311 | case 0: | 320 | case 0: |
312 | if (__netif_tx_trylock(slave_txq)) { | 321 | if (__netif_tx_trylock(slave_txq)) { |
313 | unsigned int length = qdisc_pkt_len(skb); | 322 | unsigned int length = qdisc_pkt_len(skb); |