aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2007-11-14 04:44:41 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:53:58 -0500
commit20fea08b5fb639c4c175b5c74a2bb346c5c5bc2e (patch)
tree3ffa7e1e82051c6772fc2a01d561e4a5a29bb138
parent2a8cc6c89039e0530a3335954253b76ed0f9339a (diff)
[NET]: Move Qdisc_class_ops and Qdisc_ops in appropriate sections.
Qdisc_class_ops are const, and Qdisc_ops are mostly read. Using "const" and "__read_mostly" qualifiers helps to reduce false sharing. Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/sch_generic.h2
-rw-r--r--net/mac80211/wme.c4
-rw-r--r--net/sched/cls_api.c4
-rw-r--r--net/sched/sch_api.c12
-rw-r--r--net/sched/sch_atm.c4
-rw-r--r--net/sched/sch_blackhole.c2
-rw-r--r--net/sched/sch_cbq.c4
-rw-r--r--net/sched/sch_dsmark.c4
-rw-r--r--net/sched/sch_fifo.c4
-rw-r--r--net/sched/sch_generic.c10
-rw-r--r--net/sched/sch_gred.c2
-rw-r--r--net/sched/sch_hfsc.c4
-rw-r--r--net/sched/sch_htb.c4
-rw-r--r--net/sched/sch_ingress.c4
-rw-r--r--net/sched/sch_netem.c6
-rw-r--r--net/sched/sch_prio.c6
-rw-r--r--net/sched/sch_red.c4
-rw-r--r--net/sched/sch_sfq.c2
-rw-r--r--net/sched/sch_tbf.c4
19 files changed, 43 insertions, 43 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 4c3b35153c37..9418ac26c986 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -86,7 +86,7 @@ struct Qdisc_class_ops
86struct Qdisc_ops 86struct Qdisc_ops
87{ 87{
88 struct Qdisc_ops *next; 88 struct Qdisc_ops *next;
89 struct Qdisc_class_ops *cl_ops; 89 const struct Qdisc_class_ops *cl_ops;
90 char id[IFNAMSIZ]; 90 char id[IFNAMSIZ];
91 int priv_size; 91 int priv_size;
92 92
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index 5b8a157975a3..8dbdededdec2 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -527,7 +527,7 @@ static struct tcf_proto ** wme_classop_find_tcf(struct Qdisc *qd,
527 527
528/* this qdisc is classful (i.e. has classes, some of which may have leaf qdiscs attached) 528/* this qdisc is classful (i.e. has classes, some of which may have leaf qdiscs attached)
529 * - these are the operations on the classes */ 529 * - these are the operations on the classes */
530static struct Qdisc_class_ops class_ops = 530static const struct Qdisc_class_ops class_ops =
531{ 531{
532 .graft = wme_classop_graft, 532 .graft = wme_classop_graft,
533 .leaf = wme_classop_leaf, 533 .leaf = wme_classop_leaf,
@@ -547,7 +547,7 @@ static struct Qdisc_class_ops class_ops =
547 547
548 548
549/* queueing discipline operations */ 549/* queueing discipline operations */
550static struct Qdisc_ops wme_qdisc_ops = 550static struct Qdisc_ops wme_qdisc_ops __read_mostly =
551{ 551{
552 .next = NULL, 552 .next = NULL,
553 .cl_ops = &class_ops, 553 .cl_ops = &class_ops,
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 03657976fd50..bb98045d5508 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -130,7 +130,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
130 struct tcf_proto **back, **chain; 130 struct tcf_proto **back, **chain;
131 struct tcf_proto *tp; 131 struct tcf_proto *tp;
132 struct tcf_proto_ops *tp_ops; 132 struct tcf_proto_ops *tp_ops;
133 struct Qdisc_class_ops *cops; 133 const struct Qdisc_class_ops *cops;
134 unsigned long cl; 134 unsigned long cl;
135 unsigned long fh; 135 unsigned long fh;
136 int err; 136 int err;
@@ -382,7 +382,7 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb)
382 struct tcf_proto *tp, **chain; 382 struct tcf_proto *tp, **chain;
383 struct tcmsg *tcm = (struct tcmsg*)NLMSG_DATA(cb->nlh); 383 struct tcmsg *tcm = (struct tcmsg*)NLMSG_DATA(cb->nlh);
384 unsigned long cl = 0; 384 unsigned long cl = 0;
385 struct Qdisc_class_ops *cops; 385 const struct Qdisc_class_ops *cops;
386 struct tcf_dump_args arg; 386 struct tcf_dump_args arg;
387 387
388 if (cb->nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*tcm))) 388 if (cb->nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*tcm)))
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 8ae137e3522b..259321be1ad8 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -195,7 +195,7 @@ static struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid)
195{ 195{
196 unsigned long cl; 196 unsigned long cl;
197 struct Qdisc *leaf; 197 struct Qdisc *leaf;
198 struct Qdisc_class_ops *cops = p->ops->cl_ops; 198 const struct Qdisc_class_ops *cops = p->ops->cl_ops;
199 199
200 if (cops == NULL) 200 if (cops == NULL)
201 return NULL; 201 return NULL;
@@ -373,7 +373,7 @@ dev_graft_qdisc(struct net_device *dev, struct Qdisc *qdisc)
373 373
374void qdisc_tree_decrease_qlen(struct Qdisc *sch, unsigned int n) 374void qdisc_tree_decrease_qlen(struct Qdisc *sch, unsigned int n)
375{ 375{
376 struct Qdisc_class_ops *cops; 376 const struct Qdisc_class_ops *cops;
377 unsigned long cl; 377 unsigned long cl;
378 u32 parentid; 378 u32 parentid;
379 379
@@ -417,7 +417,7 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
417 *old = dev_graft_qdisc(dev, new); 417 *old = dev_graft_qdisc(dev, new);
418 } 418 }
419 } else { 419 } else {
420 struct Qdisc_class_ops *cops = parent->ops->cl_ops; 420 const struct Qdisc_class_ops *cops = parent->ops->cl_ops;
421 421
422 err = -EINVAL; 422 err = -EINVAL;
423 423
@@ -581,7 +581,7 @@ static int
581check_loop_fn(struct Qdisc *q, unsigned long cl, struct qdisc_walker *w) 581check_loop_fn(struct Qdisc *q, unsigned long cl, struct qdisc_walker *w)
582{ 582{
583 struct Qdisc *leaf; 583 struct Qdisc *leaf;
584 struct Qdisc_class_ops *cops = q->ops->cl_ops; 584 const struct Qdisc_class_ops *cops = q->ops->cl_ops;
585 struct check_loop_arg *arg = (struct check_loop_arg *)w; 585 struct check_loop_arg *arg = (struct check_loop_arg *)w;
586 586
587 leaf = cops->leaf(q, cl); 587 leaf = cops->leaf(q, cl);
@@ -924,7 +924,7 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
924 struct rtattr **tca = arg; 924 struct rtattr **tca = arg;
925 struct net_device *dev; 925 struct net_device *dev;
926 struct Qdisc *q = NULL; 926 struct Qdisc *q = NULL;
927 struct Qdisc_class_ops *cops; 927 const struct Qdisc_class_ops *cops;
928 unsigned long cl = 0; 928 unsigned long cl = 0;
929 unsigned long new_cl; 929 unsigned long new_cl;
930 u32 pid = tcm->tcm_parent; 930 u32 pid = tcm->tcm_parent;
@@ -1039,7 +1039,7 @@ static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q,
1039 struct nlmsghdr *nlh; 1039 struct nlmsghdr *nlh;
1040 unsigned char *b = skb_tail_pointer(skb); 1040 unsigned char *b = skb_tail_pointer(skb);
1041 struct gnet_dump d; 1041 struct gnet_dump d;
1042 struct Qdisc_class_ops *cl_ops = q->ops->cl_ops; 1042 const struct Qdisc_class_ops *cl_ops = q->ops->cl_ops;
1043 1043
1044 nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*tcm), flags); 1044 nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*tcm), flags);
1045 tcm = NLMSG_DATA(nlh); 1045 tcm = NLMSG_DATA(nlh);
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c
index ddc4f2c54379..d870a4115d9a 100644
--- a/net/sched/sch_atm.c
+++ b/net/sched/sch_atm.c
@@ -668,7 +668,7 @@ static int atm_tc_dump(struct Qdisc *sch, struct sk_buff *skb)
668 return 0; 668 return 0;
669} 669}
670 670
671static struct Qdisc_class_ops atm_class_ops = { 671static const struct Qdisc_class_ops atm_class_ops = {
672 .graft = atm_tc_graft, 672 .graft = atm_tc_graft,
673 .leaf = atm_tc_leaf, 673 .leaf = atm_tc_leaf,
674 .get = atm_tc_get, 674 .get = atm_tc_get,
@@ -683,7 +683,7 @@ static struct Qdisc_class_ops atm_class_ops = {
683 .dump_stats = atm_tc_dump_class_stats, 683 .dump_stats = atm_tc_dump_class_stats,
684}; 684};
685 685
686static struct Qdisc_ops atm_qdisc_ops = { 686static struct Qdisc_ops atm_qdisc_ops __read_mostly = {
687 .cl_ops = &atm_class_ops, 687 .cl_ops = &atm_class_ops,
688 .id = "atm", 688 .id = "atm",
689 .priv_size = sizeof(struct atm_qdisc_data), 689 .priv_size = sizeof(struct atm_qdisc_data),
diff --git a/net/sched/sch_blackhole.c b/net/sched/sch_blackhole.c
index f914fc43a124..507fb488bc98 100644
--- a/net/sched/sch_blackhole.c
+++ b/net/sched/sch_blackhole.c
@@ -28,7 +28,7 @@ static struct sk_buff *blackhole_dequeue(struct Qdisc *sch)
28 return NULL; 28 return NULL;
29} 29}
30 30
31static struct Qdisc_ops blackhole_qdisc_ops = { 31static struct Qdisc_ops blackhole_qdisc_ops __read_mostly = {
32 .id = "blackhole", 32 .id = "blackhole",
33 .priv_size = 0, 33 .priv_size = 0,
34 .enqueue = blackhole_enqueue, 34 .enqueue = blackhole_enqueue,
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index 4de3744e65c3..bea123fc24a4 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -2045,7 +2045,7 @@ static void cbq_walk(struct Qdisc *sch, struct qdisc_walker *arg)
2045 } 2045 }
2046} 2046}
2047 2047
2048static struct Qdisc_class_ops cbq_class_ops = { 2048static const struct Qdisc_class_ops cbq_class_ops = {
2049 .graft = cbq_graft, 2049 .graft = cbq_graft,
2050 .leaf = cbq_leaf, 2050 .leaf = cbq_leaf,
2051 .qlen_notify = cbq_qlen_notify, 2051 .qlen_notify = cbq_qlen_notify,
@@ -2061,7 +2061,7 @@ static struct Qdisc_class_ops cbq_class_ops = {
2061 .dump_stats = cbq_dump_class_stats, 2061 .dump_stats = cbq_dump_class_stats,
2062}; 2062};
2063 2063
2064static struct Qdisc_ops cbq_qdisc_ops = { 2064static struct Qdisc_ops cbq_qdisc_ops __read_mostly = {
2065 .next = NULL, 2065 .next = NULL,
2066 .cl_ops = &cbq_class_ops, 2066 .cl_ops = &cbq_class_ops,
2067 .id = "cbq", 2067 .id = "cbq",
diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c
index 60f89199e3da..b9fe6975fbec 100644
--- a/net/sched/sch_dsmark.c
+++ b/net/sched/sch_dsmark.c
@@ -461,7 +461,7 @@ rtattr_failure:
461 return RTA_NEST_CANCEL(skb, opts); 461 return RTA_NEST_CANCEL(skb, opts);
462} 462}
463 463
464static struct Qdisc_class_ops dsmark_class_ops = { 464static const struct Qdisc_class_ops dsmark_class_ops = {
465 .graft = dsmark_graft, 465 .graft = dsmark_graft,
466 .leaf = dsmark_leaf, 466 .leaf = dsmark_leaf,
467 .get = dsmark_get, 467 .get = dsmark_get,
@@ -475,7 +475,7 @@ static struct Qdisc_class_ops dsmark_class_ops = {
475 .dump = dsmark_dump_class, 475 .dump = dsmark_dump_class,
476}; 476};
477 477
478static struct Qdisc_ops dsmark_qdisc_ops = { 478static struct Qdisc_ops dsmark_qdisc_ops __read_mostly = {
479 .next = NULL, 479 .next = NULL,
480 .cl_ops = &dsmark_class_ops, 480 .cl_ops = &dsmark_class_ops,
481 .id = "dsmark", 481 .id = "dsmark",
diff --git a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c
index c264308f17c1..d71dbfc790c0 100644
--- a/net/sched/sch_fifo.c
+++ b/net/sched/sch_fifo.c
@@ -78,7 +78,7 @@ rtattr_failure:
78 return -1; 78 return -1;
79} 79}
80 80
81struct Qdisc_ops pfifo_qdisc_ops = { 81struct Qdisc_ops pfifo_qdisc_ops __read_mostly = {
82 .id = "pfifo", 82 .id = "pfifo",
83 .priv_size = sizeof(struct fifo_sched_data), 83 .priv_size = sizeof(struct fifo_sched_data),
84 .enqueue = pfifo_enqueue, 84 .enqueue = pfifo_enqueue,
@@ -92,7 +92,7 @@ struct Qdisc_ops pfifo_qdisc_ops = {
92 .owner = THIS_MODULE, 92 .owner = THIS_MODULE,
93}; 93};
94 94
95struct Qdisc_ops bfifo_qdisc_ops = { 95struct Qdisc_ops bfifo_qdisc_ops __read_mostly = {
96 .id = "bfifo", 96 .id = "bfifo",
97 .priv_size = sizeof(struct fifo_sched_data), 97 .priv_size = sizeof(struct fifo_sched_data),
98 .enqueue = bfifo_enqueue, 98 .enqueue = bfifo_enqueue,
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 84c048a54799..9be2f152455a 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -287,7 +287,7 @@ static int noop_requeue(struct sk_buff *skb, struct Qdisc* qdisc)
287 return NET_XMIT_CN; 287 return NET_XMIT_CN;
288} 288}
289 289
290struct Qdisc_ops noop_qdisc_ops = { 290struct Qdisc_ops noop_qdisc_ops __read_mostly = {
291 .id = "noop", 291 .id = "noop",
292 .priv_size = 0, 292 .priv_size = 0,
293 .enqueue = noop_enqueue, 293 .enqueue = noop_enqueue,
@@ -304,7 +304,7 @@ struct Qdisc noop_qdisc = {
304 .list = LIST_HEAD_INIT(noop_qdisc.list), 304 .list = LIST_HEAD_INIT(noop_qdisc.list),
305}; 305};
306 306
307static struct Qdisc_ops noqueue_qdisc_ops = { 307static struct Qdisc_ops noqueue_qdisc_ops __read_mostly = {
308 .id = "noqueue", 308 .id = "noqueue",
309 .priv_size = 0, 309 .priv_size = 0,
310 .enqueue = noop_enqueue, 310 .enqueue = noop_enqueue,
@@ -406,7 +406,7 @@ static int pfifo_fast_init(struct Qdisc *qdisc, struct rtattr *opt)
406 return 0; 406 return 0;
407} 407}
408 408
409static struct Qdisc_ops pfifo_fast_ops = { 409static struct Qdisc_ops pfifo_fast_ops __read_mostly = {
410 .id = "pfifo_fast", 410 .id = "pfifo_fast",
411 .priv_size = PFIFO_FAST_BANDS * sizeof(struct sk_buff_head), 411 .priv_size = PFIFO_FAST_BANDS * sizeof(struct sk_buff_head),
412 .enqueue = pfifo_fast_enqueue, 412 .enqueue = pfifo_fast_enqueue,
@@ -472,7 +472,7 @@ errout:
472 472
473void qdisc_reset(struct Qdisc *qdisc) 473void qdisc_reset(struct Qdisc *qdisc)
474{ 474{
475 struct Qdisc_ops *ops = qdisc->ops; 475 const struct Qdisc_ops *ops = qdisc->ops;
476 476
477 if (ops->reset) 477 if (ops->reset)
478 ops->reset(qdisc); 478 ops->reset(qdisc);
@@ -491,7 +491,7 @@ static void __qdisc_destroy(struct rcu_head *head)
491 491
492void qdisc_destroy(struct Qdisc *qdisc) 492void qdisc_destroy(struct Qdisc *qdisc)
493{ 493{
494 struct Qdisc_ops *ops = qdisc->ops; 494 const struct Qdisc_ops *ops = qdisc->ops;
495 495
496 if (qdisc->flags & TCQ_F_BUILTIN || 496 if (qdisc->flags & TCQ_F_BUILTIN ||
497 !atomic_dec_and_test(&qdisc->refcnt)) 497 !atomic_dec_and_test(&qdisc->refcnt))
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
index 3cc6dda02e2e..e2bcd6682c70 100644
--- a/net/sched/sch_gred.c
+++ b/net/sched/sch_gred.c
@@ -577,7 +577,7 @@ static void gred_destroy(struct Qdisc *sch)
577 } 577 }
578} 578}
579 579
580static struct Qdisc_ops gred_qdisc_ops = { 580static struct Qdisc_ops gred_qdisc_ops __read_mostly = {
581 .id = "gred", 581 .id = "gred",
582 .priv_size = sizeof(struct gred_sched), 582 .priv_size = sizeof(struct gred_sched),
583 .enqueue = gred_enqueue, 583 .enqueue = gred_enqueue,
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index a6ad491e434b..69dc3bccf024 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -1698,7 +1698,7 @@ hfsc_drop(struct Qdisc *sch)
1698 return 0; 1698 return 0;
1699} 1699}
1700 1700
1701static struct Qdisc_class_ops hfsc_class_ops = { 1701static const struct Qdisc_class_ops hfsc_class_ops = {
1702 .change = hfsc_change_class, 1702 .change = hfsc_change_class,
1703 .delete = hfsc_delete_class, 1703 .delete = hfsc_delete_class,
1704 .graft = hfsc_graft_class, 1704 .graft = hfsc_graft_class,
@@ -1714,7 +1714,7 @@ static struct Qdisc_class_ops hfsc_class_ops = {
1714 .walk = hfsc_walk 1714 .walk = hfsc_walk
1715}; 1715};
1716 1716
1717static struct Qdisc_ops hfsc_qdisc_ops = { 1717static struct Qdisc_ops hfsc_qdisc_ops __read_mostly = {
1718 .id = "hfsc", 1718 .id = "hfsc",
1719 .init = hfsc_init_qdisc, 1719 .init = hfsc_init_qdisc,
1720 .change = hfsc_change_qdisc, 1720 .change = hfsc_change_qdisc,
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 5e608a64935a..72beb66cec9c 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -1529,7 +1529,7 @@ static void htb_walk(struct Qdisc *sch, struct qdisc_walker *arg)
1529 } 1529 }
1530} 1530}
1531 1531
1532static struct Qdisc_class_ops htb_class_ops = { 1532static const struct Qdisc_class_ops htb_class_ops = {
1533 .graft = htb_graft, 1533 .graft = htb_graft,
1534 .leaf = htb_leaf, 1534 .leaf = htb_leaf,
1535 .qlen_notify = htb_qlen_notify, 1535 .qlen_notify = htb_qlen_notify,
@@ -1545,7 +1545,7 @@ static struct Qdisc_class_ops htb_class_ops = {
1545 .dump_stats = htb_dump_class_stats, 1545 .dump_stats = htb_dump_class_stats,
1546}; 1546};
1547 1547
1548static struct Qdisc_ops htb_qdisc_ops = { 1548static struct Qdisc_ops htb_qdisc_ops __read_mostly = {
1549 .next = NULL, 1549 .next = NULL,
1550 .cl_ops = &htb_class_ops, 1550 .cl_ops = &htb_class_ops,
1551 .id = "htb", 1551 .id = "htb",
diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c
index d377deca4f20..902d82ea764b 100644
--- a/net/sched/sch_ingress.c
+++ b/net/sched/sch_ingress.c
@@ -338,7 +338,7 @@ rtattr_failure:
338 return -1; 338 return -1;
339} 339}
340 340
341static struct Qdisc_class_ops ingress_class_ops = { 341static const struct Qdisc_class_ops ingress_class_ops = {
342 .graft = ingress_graft, 342 .graft = ingress_graft,
343 .leaf = ingress_leaf, 343 .leaf = ingress_leaf,
344 .get = ingress_get, 344 .get = ingress_get,
@@ -352,7 +352,7 @@ static struct Qdisc_class_ops ingress_class_ops = {
352 .dump = NULL, 352 .dump = NULL,
353}; 353};
354 354
355static struct Qdisc_ops ingress_qdisc_ops = { 355static struct Qdisc_ops ingress_qdisc_ops __read_mostly = {
356 .next = NULL, 356 .next = NULL,
357 .cl_ops = &ingress_class_ops, 357 .cl_ops = &ingress_class_ops,
358 .id = "ingress", 358 .id = "ingress",
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 9e5e87e81f00..6c344ade33c2 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -544,7 +544,7 @@ rtattr_failure:
544 return -1; 544 return -1;
545} 545}
546 546
547static struct Qdisc_ops tfifo_qdisc_ops = { 547static struct Qdisc_ops tfifo_qdisc_ops __read_mostly = {
548 .id = "tfifo", 548 .id = "tfifo",
549 .priv_size = sizeof(struct fifo_sched_data), 549 .priv_size = sizeof(struct fifo_sched_data),
550 .enqueue = tfifo_enqueue, 550 .enqueue = tfifo_enqueue,
@@ -705,7 +705,7 @@ static struct tcf_proto **netem_find_tcf(struct Qdisc *sch, unsigned long cl)
705 return NULL; 705 return NULL;
706} 706}
707 707
708static struct Qdisc_class_ops netem_class_ops = { 708static const struct Qdisc_class_ops netem_class_ops = {
709 .graft = netem_graft, 709 .graft = netem_graft,
710 .leaf = netem_leaf, 710 .leaf = netem_leaf,
711 .get = netem_get, 711 .get = netem_get,
@@ -717,7 +717,7 @@ static struct Qdisc_class_ops netem_class_ops = {
717 .dump = netem_dump_class, 717 .dump = netem_dump_class,
718}; 718};
719 719
720static struct Qdisc_ops netem_qdisc_ops = { 720static struct Qdisc_ops netem_qdisc_ops __read_mostly = {
721 .id = "netem", 721 .id = "netem",
722 .cl_ops = &netem_class_ops, 722 .cl_ops = &netem_class_ops,
723 .priv_size = sizeof(struct netem_sched_data), 723 .priv_size = sizeof(struct netem_sched_data),
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c
index de894096e442..2243aaa8d851 100644
--- a/net/sched/sch_prio.c
+++ b/net/sched/sch_prio.c
@@ -468,7 +468,7 @@ static struct tcf_proto ** prio_find_tcf(struct Qdisc *sch, unsigned long cl)
468 return &q->filter_list; 468 return &q->filter_list;
469} 469}
470 470
471static struct Qdisc_class_ops prio_class_ops = { 471static const struct Qdisc_class_ops prio_class_ops = {
472 .graft = prio_graft, 472 .graft = prio_graft,
473 .leaf = prio_leaf, 473 .leaf = prio_leaf,
474 .get = prio_get, 474 .get = prio_get,
@@ -483,7 +483,7 @@ static struct Qdisc_class_ops prio_class_ops = {
483 .dump_stats = prio_dump_class_stats, 483 .dump_stats = prio_dump_class_stats,
484}; 484};
485 485
486static struct Qdisc_ops prio_qdisc_ops = { 486static struct Qdisc_ops prio_qdisc_ops __read_mostly = {
487 .next = NULL, 487 .next = NULL,
488 .cl_ops = &prio_class_ops, 488 .cl_ops = &prio_class_ops,
489 .id = "prio", 489 .id = "prio",
@@ -500,7 +500,7 @@ static struct Qdisc_ops prio_qdisc_ops = {
500 .owner = THIS_MODULE, 500 .owner = THIS_MODULE,
501}; 501};
502 502
503static struct Qdisc_ops rr_qdisc_ops = { 503static struct Qdisc_ops rr_qdisc_ops __read_mostly = {
504 .next = NULL, 504 .next = NULL,
505 .cl_ops = &prio_class_ops, 505 .cl_ops = &prio_class_ops,
506 .id = "rr", 506 .id = "rr",
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c
index 9b95fefb70f4..f1e9647f7db7 100644
--- a/net/sched/sch_red.c
+++ b/net/sched/sch_red.c
@@ -359,7 +359,7 @@ static struct tcf_proto **red_find_tcf(struct Qdisc *sch, unsigned long cl)
359 return NULL; 359 return NULL;
360} 360}
361 361
362static struct Qdisc_class_ops red_class_ops = { 362static const struct Qdisc_class_ops red_class_ops = {
363 .graft = red_graft, 363 .graft = red_graft,
364 .leaf = red_leaf, 364 .leaf = red_leaf,
365 .get = red_get, 365 .get = red_get,
@@ -371,7 +371,7 @@ static struct Qdisc_class_ops red_class_ops = {
371 .dump = red_dump_class, 371 .dump = red_dump_class,
372}; 372};
373 373
374static struct Qdisc_ops red_qdisc_ops = { 374static struct Qdisc_ops red_qdisc_ops __read_mostly = {
375 .id = "red", 375 .id = "red",
376 .priv_size = sizeof(struct red_sched_data), 376 .priv_size = sizeof(struct red_sched_data),
377 .cl_ops = &red_class_ops, 377 .cl_ops = &red_class_ops,
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
index 65293876cd66..c58fa6efc7a2 100644
--- a/net/sched/sch_sfq.c
+++ b/net/sched/sch_sfq.c
@@ -480,7 +480,7 @@ rtattr_failure:
480 return -1; 480 return -1;
481} 481}
482 482
483static struct Qdisc_ops sfq_qdisc_ops = { 483static struct Qdisc_ops sfq_qdisc_ops __read_mostly = {
484 .next = NULL, 484 .next = NULL,
485 .cl_ops = NULL, 485 .cl_ops = NULL,
486 .id = "sfq", 486 .id = "sfq",
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
index b0d81098b0ee..d88fea9d6b61 100644
--- a/net/sched/sch_tbf.c
+++ b/net/sched/sch_tbf.c
@@ -469,7 +469,7 @@ static struct tcf_proto **tbf_find_tcf(struct Qdisc *sch, unsigned long cl)
469 return NULL; 469 return NULL;
470} 470}
471 471
472static struct Qdisc_class_ops tbf_class_ops = 472static const struct Qdisc_class_ops tbf_class_ops =
473{ 473{
474 .graft = tbf_graft, 474 .graft = tbf_graft,
475 .leaf = tbf_leaf, 475 .leaf = tbf_leaf,
@@ -482,7 +482,7 @@ static struct Qdisc_class_ops tbf_class_ops =
482 .dump = tbf_dump_class, 482 .dump = tbf_dump_class,
483}; 483};
484 484
485static struct Qdisc_ops tbf_qdisc_ops = { 485static struct Qdisc_ops tbf_qdisc_ops __read_mostly = {
486 .next = NULL, 486 .next = NULL,
487 .cl_ops = &tbf_class_ops, 487 .cl_ops = &tbf_class_ops,
488 .id = "tbf", 488 .id = "tbf",