aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_cbq.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2007-07-15 03:03:05 -0400
committerDavid S. Miller <davem@davemloft.net>2007-07-15 03:03:05 -0400
commitc3bc7cff8fddb6ff9715be8bfc3d911378c4d69d (patch)
treee23946fb3583ee17e95c07f6e04b5dcc498fa581 /net/sched/sch_cbq.c
parent73ca4918fbb98311421259d82ef4ab44feeace43 (diff)
[NET_SCHED]: Kill CONFIG_NET_CLS_POLICE
The NET_CLS_ACT option is now a full replacement for NET_CLS_POLICE, remove the old code. The config option will be kept around to select the equivalent NET_CLS_ACT options for a short time to allow easier upgrades. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_cbq.c')
-rw-r--r--net/sched/sch_cbq.c45
1 files changed, 17 insertions, 28 deletions
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index 77381f1c6541..e38c2839b25c 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -82,7 +82,7 @@ struct cbq_class
82 unsigned char priority2; /* priority to be used after overlimit */ 82 unsigned char priority2; /* priority to be used after overlimit */
83 unsigned char ewma_log; /* time constant for idle time calculation */ 83 unsigned char ewma_log; /* time constant for idle time calculation */
84 unsigned char ovl_strategy; 84 unsigned char ovl_strategy;
85#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE) 85#ifdef CONFIG_NET_CLS_ACT
86 unsigned char police; 86 unsigned char police;
87#endif 87#endif
88 88
@@ -154,7 +154,7 @@ struct cbq_sched_data
154 struct cbq_class *active[TC_CBQ_MAXPRIO+1]; /* List of all classes 154 struct cbq_class *active[TC_CBQ_MAXPRIO+1]; /* List of all classes
155 with backlog */ 155 with backlog */
156 156
157#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE) 157#ifdef CONFIG_NET_CLS_ACT
158 struct cbq_class *rx_class; 158 struct cbq_class *rx_class;
159#endif 159#endif
160 struct cbq_class *tx_class; 160 struct cbq_class *tx_class;
@@ -196,7 +196,7 @@ cbq_class_lookup(struct cbq_sched_data *q, u32 classid)
196 return NULL; 196 return NULL;
197} 197}
198 198
199#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE) 199#ifdef CONFIG_NET_CLS_ACT
200 200
201static struct cbq_class * 201static struct cbq_class *
202cbq_reclassify(struct sk_buff *skb, struct cbq_class *this) 202cbq_reclassify(struct sk_buff *skb, struct cbq_class *this)
@@ -271,15 +271,6 @@ cbq_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr)
271 case TC_ACT_RECLASSIFY: 271 case TC_ACT_RECLASSIFY:
272 return cbq_reclassify(skb, cl); 272 return cbq_reclassify(skb, cl);
273 } 273 }
274#elif defined(CONFIG_NET_CLS_POLICE)
275 switch (result) {
276 case TC_POLICE_RECLASSIFY:
277 return cbq_reclassify(skb, cl);
278 case TC_POLICE_SHOT:
279 return NULL;
280 default:
281 break;
282 }
283#endif 274#endif
284 if (cl->level == 0) 275 if (cl->level == 0)
285 return cl; 276 return cl;
@@ -392,7 +383,7 @@ cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
392 int ret; 383 int ret;
393 struct cbq_class *cl = cbq_classify(skb, sch, &ret); 384 struct cbq_class *cl = cbq_classify(skb, sch, &ret);
394 385
395#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE) 386#ifdef CONFIG_NET_CLS_ACT
396 q->rx_class = cl; 387 q->rx_class = cl;
397#endif 388#endif
398 if (cl == NULL) { 389 if (cl == NULL) {
@@ -402,7 +393,7 @@ cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
402 return ret; 393 return ret;
403 } 394 }
404 395
405#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE) 396#ifdef CONFIG_NET_CLS_ACT
406 cl->q->__parent = sch; 397 cl->q->__parent = sch;
407#endif 398#endif
408 if ((ret = cl->q->enqueue(skb, cl->q)) == NET_XMIT_SUCCESS) { 399 if ((ret = cl->q->enqueue(skb, cl->q)) == NET_XMIT_SUCCESS) {
@@ -437,7 +428,7 @@ cbq_requeue(struct sk_buff *skb, struct Qdisc *sch)
437 428
438 cbq_mark_toplevel(q, cl); 429 cbq_mark_toplevel(q, cl);
439 430
440#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE) 431#ifdef CONFIG_NET_CLS_ACT
441 q->rx_class = cl; 432 q->rx_class = cl;
442 cl->q->__parent = sch; 433 cl->q->__parent = sch;
443#endif 434#endif
@@ -672,9 +663,7 @@ static enum hrtimer_restart cbq_undelay(struct hrtimer *timer)
672 return HRTIMER_NORESTART; 663 return HRTIMER_NORESTART;
673} 664}
674 665
675 666#ifdef CONFIG_NET_CLS_ACT
676#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE)
677
678static int cbq_reshape_fail(struct sk_buff *skb, struct Qdisc *child) 667static int cbq_reshape_fail(struct sk_buff *skb, struct Qdisc *child)
679{ 668{
680 int len = skb->len; 669 int len = skb->len;
@@ -1367,7 +1356,7 @@ static int cbq_set_overlimit(struct cbq_class *cl, struct tc_cbq_ovl *ovl)
1367 return 0; 1356 return 0;
1368} 1357}
1369 1358
1370#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE) 1359#ifdef CONFIG_NET_CLS_ACT
1371static int cbq_set_police(struct cbq_class *cl, struct tc_cbq_police *p) 1360static int cbq_set_police(struct cbq_class *cl, struct tc_cbq_police *p)
1372{ 1361{
1373 cl->police = p->police; 1362 cl->police = p->police;
@@ -1535,7 +1524,7 @@ rtattr_failure:
1535 return -1; 1524 return -1;
1536} 1525}
1537 1526
1538#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE) 1527#ifdef CONFIG_NET_CLS_ACT
1539static __inline__ int cbq_dump_police(struct sk_buff *skb, struct cbq_class *cl) 1528static __inline__ int cbq_dump_police(struct sk_buff *skb, struct cbq_class *cl)
1540{ 1529{
1541 unsigned char *b = skb_tail_pointer(skb); 1530 unsigned char *b = skb_tail_pointer(skb);
@@ -1561,7 +1550,7 @@ static int cbq_dump_attr(struct sk_buff *skb, struct cbq_class *cl)
1561 cbq_dump_rate(skb, cl) < 0 || 1550 cbq_dump_rate(skb, cl) < 0 ||
1562 cbq_dump_wrr(skb, cl) < 0 || 1551 cbq_dump_wrr(skb, cl) < 0 ||
1563 cbq_dump_ovl(skb, cl) < 0 || 1552 cbq_dump_ovl(skb, cl) < 0 ||
1564#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE) 1553#ifdef CONFIG_NET_CLS_ACT
1565 cbq_dump_police(skb, cl) < 0 || 1554 cbq_dump_police(skb, cl) < 0 ||
1566#endif 1555#endif
1567 cbq_dump_fopt(skb, cl) < 0) 1556 cbq_dump_fopt(skb, cl) < 0)
@@ -1656,7 +1645,7 @@ static int cbq_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
1656 cl->classid)) == NULL) 1645 cl->classid)) == NULL)
1657 return -ENOBUFS; 1646 return -ENOBUFS;
1658 } else { 1647 } else {
1659#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE) 1648#ifdef CONFIG_NET_CLS_ACT
1660 if (cl->police == TC_POLICE_RECLASSIFY) 1649 if (cl->police == TC_POLICE_RECLASSIFY)
1661 new->reshape_fail = cbq_reshape_fail; 1650 new->reshape_fail = cbq_reshape_fail;
1662#endif 1651#endif
@@ -1721,7 +1710,7 @@ cbq_destroy(struct Qdisc* sch)
1721 struct cbq_class *cl; 1710 struct cbq_class *cl;
1722 unsigned h; 1711 unsigned h;
1723 1712
1724#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE) 1713#ifdef CONFIG_NET_CLS_ACT
1725 q->rx_class = NULL; 1714 q->rx_class = NULL;
1726#endif 1715#endif
1727 /* 1716 /*
@@ -1750,7 +1739,7 @@ static void cbq_put(struct Qdisc *sch, unsigned long arg)
1750 struct cbq_class *cl = (struct cbq_class*)arg; 1739 struct cbq_class *cl = (struct cbq_class*)arg;
1751 1740
1752 if (--cl->refcnt == 0) { 1741 if (--cl->refcnt == 0) {
1753#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE) 1742#ifdef CONFIG_NET_CLS_ACT
1754 struct cbq_sched_data *q = qdisc_priv(sch); 1743 struct cbq_sched_data *q = qdisc_priv(sch);
1755 1744
1756 spin_lock_bh(&sch->dev->queue_lock); 1745 spin_lock_bh(&sch->dev->queue_lock);
@@ -1798,7 +1787,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct rtattr **t
1798 RTA_PAYLOAD(tb[TCA_CBQ_WRROPT-1]) < sizeof(struct tc_cbq_wrropt)) 1787 RTA_PAYLOAD(tb[TCA_CBQ_WRROPT-1]) < sizeof(struct tc_cbq_wrropt))
1799 return -EINVAL; 1788 return -EINVAL;
1800 1789
1801#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE) 1790#ifdef CONFIG_NET_CLS_ACT
1802 if (tb[TCA_CBQ_POLICE-1] && 1791 if (tb[TCA_CBQ_POLICE-1] &&
1803 RTA_PAYLOAD(tb[TCA_CBQ_POLICE-1]) < sizeof(struct tc_cbq_police)) 1792 RTA_PAYLOAD(tb[TCA_CBQ_POLICE-1]) < sizeof(struct tc_cbq_police))
1804 return -EINVAL; 1793 return -EINVAL;
@@ -1841,7 +1830,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct rtattr **t
1841 if (tb[TCA_CBQ_OVL_STRATEGY-1]) 1830 if (tb[TCA_CBQ_OVL_STRATEGY-1])
1842 cbq_set_overlimit(cl, RTA_DATA(tb[TCA_CBQ_OVL_STRATEGY-1])); 1831 cbq_set_overlimit(cl, RTA_DATA(tb[TCA_CBQ_OVL_STRATEGY-1]));
1843 1832
1844#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE) 1833#ifdef CONFIG_NET_CLS_ACT
1845 if (tb[TCA_CBQ_POLICE-1]) 1834 if (tb[TCA_CBQ_POLICE-1])
1846 cbq_set_police(cl, RTA_DATA(tb[TCA_CBQ_POLICE-1])); 1835 cbq_set_police(cl, RTA_DATA(tb[TCA_CBQ_POLICE-1]));
1847#endif 1836#endif
@@ -1934,7 +1923,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct rtattr **t
1934 cl->overlimit = cbq_ovl_classic; 1923 cl->overlimit = cbq_ovl_classic;
1935 if (tb[TCA_CBQ_OVL_STRATEGY-1]) 1924 if (tb[TCA_CBQ_OVL_STRATEGY-1])
1936 cbq_set_overlimit(cl, RTA_DATA(tb[TCA_CBQ_OVL_STRATEGY-1])); 1925 cbq_set_overlimit(cl, RTA_DATA(tb[TCA_CBQ_OVL_STRATEGY-1]));
1937#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE) 1926#ifdef CONFIG_NET_CLS_ACT
1938 if (tb[TCA_CBQ_POLICE-1]) 1927 if (tb[TCA_CBQ_POLICE-1])
1939 cbq_set_police(cl, RTA_DATA(tb[TCA_CBQ_POLICE-1])); 1928 cbq_set_police(cl, RTA_DATA(tb[TCA_CBQ_POLICE-1]));
1940#endif 1929#endif
@@ -1978,7 +1967,7 @@ static int cbq_delete(struct Qdisc *sch, unsigned long arg)
1978 q->tx_class = NULL; 1967 q->tx_class = NULL;
1979 q->tx_borrowed = NULL; 1968 q->tx_borrowed = NULL;
1980 } 1969 }
1981#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE) 1970#ifdef CONFIG_NET_CLS_ACT
1982 if (q->rx_class == cl) 1971 if (q->rx_class == cl)
1983 q->rx_class = NULL; 1972 q->rx_class = NULL;
1984#endif 1973#endif