Skip to content

Commit b8d99ba

Browse files
committed
Merge branch 'cbq-kill-drop'
Florian Westphal says: ==================== sched, cbq: remove OVL_STRATEGY/POLICE support iproute2 does not implement any options that result in the TCA_CBQ_OVL_STRATEGY/TCA_CBQ_POLICE attributes being set/used. This series removes these two attributes from cbq and makes kernel reject them via EOPNOTSUPP in case they are present. The two followup changes then remove several features from qdisc infrastructure that are then no longer used/needed. These are: - The 'drop' method provided by most qdiscs - the 'reshape_fail' function used by some qdiscs - the __parent member in struct Qdisc I tested this with allmod and allyesconfig builds and also with a brief cbq script: tc qdisc add dev eth0 root handle 1:0 cbq bandwidth 10Mbit avpkt 1000 cell 8 tc class add dev eth0 parent 1:0 classid 1:1 est 1sec 8sec cbq bandwidth 10Mbit rate 5Mbit prio 1 allot 1514 maxburst 20 cell 8 avpkt 1000 bounded split 1:0 defmap 3f tc class add dev eth0 parent 1:0 classid 1:2 est 1sec 8sec cbq bandwidth 10Mbit rate 5Mbit prio 1 allot 1514 maxburst 20 cell 8 avpkt 1000 bounded split 1:0 defmap 3f tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip tos 0x10 0xff classid 1:1 police rate 2Mbit burst 10K reclassify tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip tos 0x0c 0xff classid 1:2 tc filter add dev eth0 parent 1:0 protocol ip prio 2 u32 match ip tos 0x10 0xff classid 1:2 tc filter add dev eth0 parent 1:0 protocol ip prio 3 u32 match ip tos 0x0 0x0 classid 1:2 No changes since v1 except patch #5 to fix up struct Qdisc layout. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 76e48f9 + c894504 commit b8d99ba

20 files changed

+15
-680
lines changed

include/net/sch_generic.h

Lines changed: 2 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -63,26 +63,19 @@ struct Qdisc {
6363
struct list_head list;
6464
u32 handle;
6565
u32 parent;
66-
int (*reshape_fail)(struct sk_buff *skb,
67-
struct Qdisc *q);
68-
6966
void *u32_node;
7067

71-
/* This field is deprecated, but it is still used by CBQ
72-
* and it will live until better solution will be invented.
73-
*/
74-
struct Qdisc *__parent;
7568
struct netdev_queue *dev_queue;
7669

7770
struct gnet_stats_rate_est64 rate_est;
7871
struct gnet_stats_basic_cpu __percpu *cpu_bstats;
7972
struct gnet_stats_queue __percpu *cpu_qstats;
8073

81-
struct Qdisc *next_sched;
82-
struct sk_buff *gso_skb;
8374
/*
8475
* For performance sake on SMP, we put highly modified fields at the end
8576
*/
77+
struct Qdisc *next_sched ____cacheline_aligned_in_smp;
78+
struct sk_buff *gso_skb;
8679
unsigned long state;
8780
struct sk_buff_head q;
8881
struct gnet_stats_basic_packed bstats;
@@ -181,7 +174,6 @@ struct Qdisc_ops {
181174
int (*enqueue)(struct sk_buff *, struct Qdisc *);
182175
struct sk_buff * (*dequeue)(struct Qdisc *);
183176
struct sk_buff * (*peek)(struct Qdisc *);
184-
unsigned int (*drop)(struct Qdisc *);
185177

186178
int (*init)(struct Qdisc *, struct nlattr *arg);
187179
void (*reset)(struct Qdisc *);
@@ -665,22 +657,6 @@ static inline unsigned int qdisc_queue_drop_head(struct Qdisc *sch)
665657
return __qdisc_queue_drop_head(sch, &sch->q);
666658
}
667659

668-
static inline struct sk_buff *__qdisc_dequeue_tail(struct Qdisc *sch,
669-
struct sk_buff_head *list)
670-
{
671-
struct sk_buff *skb = __skb_dequeue_tail(list);
672-
673-
if (likely(skb != NULL))
674-
qdisc_qstats_backlog_dec(sch, skb);
675-
676-
return skb;
677-
}
678-
679-
static inline struct sk_buff *qdisc_dequeue_tail(struct Qdisc *sch)
680-
{
681-
return __qdisc_dequeue_tail(sch, &sch->q);
682-
}
683-
684660
static inline struct sk_buff *qdisc_peek_head(struct Qdisc *sch)
685661
{
686662
return skb_peek(&sch->q);
@@ -748,25 +724,6 @@ static inline struct Qdisc *qdisc_replace(struct Qdisc *sch, struct Qdisc *new,
748724
return old;
749725
}
750726

751-
static inline unsigned int __qdisc_queue_drop(struct Qdisc *sch,
752-
struct sk_buff_head *list)
753-
{
754-
struct sk_buff *skb = __qdisc_dequeue_tail(sch, list);
755-
756-
if (likely(skb != NULL)) {
757-
unsigned int len = qdisc_pkt_len(skb);
758-
kfree_skb(skb);
759-
return len;
760-
}
761-
762-
return 0;
763-
}
764-
765-
static inline unsigned int qdisc_queue_drop(struct Qdisc *sch)
766-
{
767-
return __qdisc_queue_drop(sch, &sch->q);
768-
}
769-
770727
static inline int qdisc_drop(struct sk_buff *skb, struct Qdisc *sch)
771728
{
772729
kfree_skb(skb);
@@ -775,22 +732,6 @@ static inline int qdisc_drop(struct sk_buff *skb, struct Qdisc *sch)
775732
return NET_XMIT_DROP;
776733
}
777734

778-
static inline int qdisc_reshape_fail(struct sk_buff *skb, struct Qdisc *sch)
779-
{
780-
qdisc_qstats_drop(sch);
781-
782-
#ifdef CONFIG_NET_CLS_ACT
783-
if (sch->reshape_fail == NULL || sch->reshape_fail(skb, sch))
784-
goto drop;
785-
786-
return NET_XMIT_SUCCESS;
787-
788-
drop:
789-
#endif
790-
kfree_skb(skb);
791-
return NET_XMIT_DROP;
792-
}
793-
794735
/* Length to Time (L2T) lookup in a qdisc_rate_table, to determine how
795736
long it will take to send a packet given its size.
796737
*/

net/sched/sch_atm.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -519,20 +519,6 @@ static struct sk_buff *atm_tc_peek(struct Qdisc *sch)
519519
return p->link.q->ops->peek(p->link.q);
520520
}
521521

522-
static unsigned int atm_tc_drop(struct Qdisc *sch)
523-
{
524-
struct atm_qdisc_data *p = qdisc_priv(sch);
525-
struct atm_flow_data *flow;
526-
unsigned int len;
527-
528-
pr_debug("atm_tc_drop(sch %p,[qdisc %p])\n", sch, p);
529-
list_for_each_entry(flow, &p->flows, list) {
530-
if (flow->q->ops->drop && (len = flow->q->ops->drop(flow->q)))
531-
return len;
532-
}
533-
return 0;
534-
}
535-
536522
static int atm_tc_init(struct Qdisc *sch, struct nlattr *opt)
537523
{
538524
struct atm_qdisc_data *p = qdisc_priv(sch);
@@ -672,7 +658,6 @@ static struct Qdisc_ops atm_qdisc_ops __read_mostly = {
672658
.enqueue = atm_tc_enqueue,
673659
.dequeue = atm_tc_dequeue,
674660
.peek = atm_tc_peek,
675-
.drop = atm_tc_drop,
676661
.init = atm_tc_init,
677662
.reset = atm_tc_reset,
678663
.destroy = atm_tc_destroy,

0 commit comments

Comments
 (0)