Skip to content

Commit a09ceb0

Browse files
Florian Westphaldavem330
authored andcommitted
sched: remove qdisc->drop
after removal of TCA_CBQ_OVL_STRATEGY from cbq scheduler, there are no more callers of ->drop() outside of other ->drop functions, i.e. nothing calls them. Signed-off-by: Florian Westphal <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c3a173d commit a09ceb0

19 files changed

+0
-395
lines changed

include/net/sch_generic.h

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ struct Qdisc_ops {
174174
int (*enqueue)(struct sk_buff *, struct Qdisc *);
175175
struct sk_buff * (*dequeue)(struct Qdisc *);
176176
struct sk_buff * (*peek)(struct Qdisc *);
177-
unsigned int (*drop)(struct Qdisc *);
178177

179178
int (*init)(struct Qdisc *, struct nlattr *arg);
180179
void (*reset)(struct Qdisc *);
@@ -658,22 +657,6 @@ static inline unsigned int qdisc_queue_drop_head(struct Qdisc *sch)
658657
return __qdisc_queue_drop_head(sch, &sch->q);
659658
}
660659

661-
static inline struct sk_buff *__qdisc_dequeue_tail(struct Qdisc *sch,
662-
struct sk_buff_head *list)
663-
{
664-
struct sk_buff *skb = __skb_dequeue_tail(list);
665-
666-
if (likely(skb != NULL))
667-
qdisc_qstats_backlog_dec(sch, skb);
668-
669-
return skb;
670-
}
671-
672-
static inline struct sk_buff *qdisc_dequeue_tail(struct Qdisc *sch)
673-
{
674-
return __qdisc_dequeue_tail(sch, &sch->q);
675-
}
676-
677660
static inline struct sk_buff *qdisc_peek_head(struct Qdisc *sch)
678661
{
679662
return skb_peek(&sch->q);
@@ -741,25 +724,6 @@ static inline struct Qdisc *qdisc_replace(struct Qdisc *sch, struct Qdisc *new,
741724
return old;
742725
}
743726

744-
static inline unsigned int __qdisc_queue_drop(struct Qdisc *sch,
745-
struct sk_buff_head *list)
746-
{
747-
struct sk_buff *skb = __qdisc_dequeue_tail(sch, list);
748-
749-
if (likely(skb != NULL)) {
750-
unsigned int len = qdisc_pkt_len(skb);
751-
kfree_skb(skb);
752-
return len;
753-
}
754-
755-
return 0;
756-
}
757-
758-
static inline unsigned int qdisc_queue_drop(struct Qdisc *sch)
759-
{
760-
return __qdisc_queue_drop(sch, &sch->q);
761-
}
762-
763727
static inline int qdisc_drop(struct sk_buff *skb, struct Qdisc *sch)
764728
{
765729
kfree_skb(skb);

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,

net/sched/sch_cbq.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,31 +1025,6 @@ static void cbq_link_class(struct cbq_class *this)
10251025
}
10261026
}
10271027

1028-
static unsigned int cbq_drop(struct Qdisc *sch)
1029-
{
1030-
struct cbq_sched_data *q = qdisc_priv(sch);
1031-
struct cbq_class *cl, *cl_head;
1032-
int prio;
1033-
unsigned int len;
1034-
1035-
for (prio = TC_CBQ_MAXPRIO; prio >= 0; prio--) {
1036-
cl_head = q->active[prio];
1037-
if (!cl_head)
1038-
continue;
1039-
1040-
cl = cl_head;
1041-
do {
1042-
if (cl->q->ops->drop && (len = cl->q->ops->drop(cl->q))) {
1043-
sch->q.qlen--;
1044-
if (!cl->q->q.qlen)
1045-
cbq_deactivate_class(cl);
1046-
return len;
1047-
}
1048-
} while ((cl = cl->next_alive) != cl_head);
1049-
}
1050-
return 0;
1051-
}
1052-
10531028
static void
10541029
cbq_reset(struct Qdisc *sch)
10551030
{
@@ -1791,7 +1766,6 @@ static struct Qdisc_ops cbq_qdisc_ops __read_mostly = {
17911766
.enqueue = cbq_enqueue,
17921767
.dequeue = cbq_dequeue,
17931768
.peek = qdisc_peek_dequeued,
1794-
.drop = cbq_drop,
17951769
.init = cbq_init,
17961770
.reset = cbq_reset,
17971771
.destroy = cbq_destroy,

net/sched/sch_choke.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -365,22 +365,6 @@ static struct sk_buff *choke_dequeue(struct Qdisc *sch)
365365
return skb;
366366
}
367367

368-
static unsigned int choke_drop(struct Qdisc *sch)
369-
{
370-
struct choke_sched_data *q = qdisc_priv(sch);
371-
unsigned int len;
372-
373-
len = qdisc_queue_drop(sch);
374-
if (len > 0)
375-
q->stats.other++;
376-
else {
377-
if (!red_is_idling(&q->vars))
378-
red_start_of_idle_period(&q->vars);
379-
}
380-
381-
return len;
382-
}
383-
384368
static void choke_reset(struct Qdisc *sch)
385369
{
386370
struct choke_sched_data *q = qdisc_priv(sch);
@@ -569,7 +553,6 @@ static struct Qdisc_ops choke_qdisc_ops __read_mostly = {
569553
.enqueue = choke_enqueue,
570554
.dequeue = choke_dequeue,
571555
.peek = choke_peek_head,
572-
.drop = choke_drop,
573556
.init = choke_init,
574557
.destroy = choke_destroy,
575558
.reset = choke_reset,

net/sched/sch_drr.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -421,26 +421,6 @@ static struct sk_buff *drr_dequeue(struct Qdisc *sch)
421421
return NULL;
422422
}
423423

424-
static unsigned int drr_drop(struct Qdisc *sch)
425-
{
426-
struct drr_sched *q = qdisc_priv(sch);
427-
struct drr_class *cl;
428-
unsigned int len;
429-
430-
list_for_each_entry(cl, &q->active, alist) {
431-
if (cl->qdisc->ops->drop) {
432-
len = cl->qdisc->ops->drop(cl->qdisc);
433-
if (len > 0) {
434-
sch->q.qlen--;
435-
if (cl->qdisc->q.qlen == 0)
436-
list_del(&cl->alist);
437-
return len;
438-
}
439-
}
440-
}
441-
return 0;
442-
}
443-
444424
static int drr_init_qdisc(struct Qdisc *sch, struct nlattr *opt)
445425
{
446426
struct drr_sched *q = qdisc_priv(sch);
@@ -509,7 +489,6 @@ static struct Qdisc_ops drr_qdisc_ops __read_mostly = {
509489
.enqueue = drr_enqueue,
510490
.dequeue = drr_dequeue,
511491
.peek = qdisc_peek_dequeued,
512-
.drop = drr_drop,
513492
.init = drr_init_qdisc,
514493
.reset = drr_reset_qdisc,
515494
.destroy = drr_destroy_qdisc,

net/sched/sch_dsmark.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -320,23 +320,6 @@ static struct sk_buff *dsmark_peek(struct Qdisc *sch)
320320
return p->q->ops->peek(p->q);
321321
}
322322

323-
static unsigned int dsmark_drop(struct Qdisc *sch)
324-
{
325-
struct dsmark_qdisc_data *p = qdisc_priv(sch);
326-
unsigned int len;
327-
328-
pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);
329-
330-
if (p->q->ops->drop == NULL)
331-
return 0;
332-
333-
len = p->q->ops->drop(p->q);
334-
if (len)
335-
sch->q.qlen--;
336-
337-
return len;
338-
}
339-
340323
static int dsmark_init(struct Qdisc *sch, struct nlattr *opt)
341324
{
342325
struct dsmark_qdisc_data *p = qdisc_priv(sch);
@@ -489,7 +472,6 @@ static struct Qdisc_ops dsmark_qdisc_ops __read_mostly = {
489472
.enqueue = dsmark_enqueue,
490473
.dequeue = dsmark_dequeue,
491474
.peek = dsmark_peek,
492-
.drop = dsmark_drop,
493475
.init = dsmark_init,
494476
.reset = dsmark_reset,
495477
.destroy = dsmark_destroy,

net/sched/sch_fifo.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ struct Qdisc_ops pfifo_qdisc_ops __read_mostly = {
9999
.enqueue = pfifo_enqueue,
100100
.dequeue = qdisc_dequeue_head,
101101
.peek = qdisc_peek_head,
102-
.drop = qdisc_queue_drop,
103102
.init = fifo_init,
104103
.reset = qdisc_reset_queue,
105104
.change = fifo_init,
@@ -114,7 +113,6 @@ struct Qdisc_ops bfifo_qdisc_ops __read_mostly = {
114113
.enqueue = bfifo_enqueue,
115114
.dequeue = qdisc_dequeue_head,
116115
.peek = qdisc_peek_head,
117-
.drop = qdisc_queue_drop,
118116
.init = fifo_init,
119117
.reset = qdisc_reset_queue,
120118
.change = fifo_init,
@@ -129,7 +127,6 @@ struct Qdisc_ops pfifo_head_drop_qdisc_ops __read_mostly = {
129127
.enqueue = pfifo_tail_enqueue,
130128
.dequeue = qdisc_dequeue_head,
131129
.peek = qdisc_peek_head,
132-
.drop = qdisc_queue_drop_head,
133130
.init = fifo_init,
134131
.reset = qdisc_reset_queue,
135132
.change = fifo_init,

net/sched/sch_fq_codel.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,6 @@ static unsigned int fq_codel_drop(struct Qdisc *sch, unsigned int max_packets)
184184
return idx;
185185
}
186186

187-
static unsigned int fq_codel_qdisc_drop(struct Qdisc *sch)
188-
{
189-
unsigned int prev_backlog;
190-
191-
prev_backlog = sch->qstats.backlog;
192-
fq_codel_drop(sch, 1U);
193-
return prev_backlog - sch->qstats.backlog;
194-
}
195-
196187
static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch)
197188
{
198189
struct fq_codel_sched_data *q = qdisc_priv(sch);
@@ -704,7 +695,6 @@ static struct Qdisc_ops fq_codel_qdisc_ops __read_mostly = {
704695
.enqueue = fq_codel_enqueue,
705696
.dequeue = fq_codel_dequeue,
706697
.peek = qdisc_peek_dequeued,
707-
.drop = fq_codel_qdisc_drop,
708698
.init = fq_codel_init,
709699
.reset = fq_codel_reset,
710700
.destroy = fq_codel_destroy,

net/sched/sch_gred.c

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -276,40 +276,6 @@ static struct sk_buff *gred_dequeue(struct Qdisc *sch)
276276
return NULL;
277277
}
278278

279-
static unsigned int gred_drop(struct Qdisc *sch)
280-
{
281-
struct sk_buff *skb;
282-
struct gred_sched *t = qdisc_priv(sch);
283-
284-
skb = qdisc_dequeue_tail(sch);
285-
if (skb) {
286-
unsigned int len = qdisc_pkt_len(skb);
287-
struct gred_sched_data *q;
288-
u16 dp = tc_index_to_dp(skb);
289-
290-
if (dp >= t->DPs || (q = t->tab[dp]) == NULL) {
291-
net_warn_ratelimited("GRED: Unable to relocate VQ 0x%x while dropping, screwing up backlog\n",
292-
tc_index_to_dp(skb));
293-
} else {
294-
q->backlog -= len;
295-
q->stats.other++;
296-
297-
if (gred_wred_mode(t)) {
298-
if (!sch->qstats.backlog)
299-
red_start_of_idle_period(&t->wred_set);
300-
} else {
301-
if (!q->backlog)
302-
red_start_of_idle_period(&q->vars);
303-
}
304-
}
305-
306-
qdisc_drop(skb, sch);
307-
return len;
308-
}
309-
310-
return 0;
311-
}
312-
313279
static void gred_reset(struct Qdisc *sch)
314280
{
315281
int i;
@@ -623,7 +589,6 @@ static struct Qdisc_ops gred_qdisc_ops __read_mostly = {
623589
.enqueue = gred_enqueue,
624590
.dequeue = gred_dequeue,
625591
.peek = qdisc_peek_head,
626-
.drop = gred_drop,
627592
.init = gred_init,
628593
.reset = gred_reset,
629594
.destroy = gred_destroy,

net/sched/sch_hfsc.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,31 +1677,6 @@ hfsc_dequeue(struct Qdisc *sch)
16771677
return skb;
16781678
}
16791679

1680-
static unsigned int
1681-
hfsc_drop(struct Qdisc *sch)
1682-
{
1683-
struct hfsc_sched *q = qdisc_priv(sch);
1684-
struct hfsc_class *cl;
1685-
unsigned int len;
1686-
1687-
list_for_each_entry(cl, &q->droplist, dlist) {
1688-
if (cl->qdisc->ops->drop != NULL &&
1689-
(len = cl->qdisc->ops->drop(cl->qdisc)) > 0) {
1690-
if (cl->qdisc->q.qlen == 0) {
1691-
update_vf(cl, 0, 0);
1692-
set_passive(cl);
1693-
} else {
1694-
list_move_tail(&cl->dlist, &q->droplist);
1695-
}
1696-
cl->qstats.drops++;
1697-
qdisc_qstats_drop(sch);
1698-
sch->q.qlen--;
1699-
return len;
1700-
}
1701-
}
1702-
return 0;
1703-
}
1704-
17051680
static const struct Qdisc_class_ops hfsc_class_ops = {
17061681
.change = hfsc_change_class,
17071682
.delete = hfsc_delete_class,
@@ -1728,7 +1703,6 @@ static struct Qdisc_ops hfsc_qdisc_ops __read_mostly = {
17281703
.enqueue = hfsc_enqueue,
17291704
.dequeue = hfsc_dequeue,
17301705
.peek = qdisc_peek_dequeued,
1731-
.drop = hfsc_drop,
17321706
.cl_ops = &hfsc_class_ops,
17331707
.priv_size = sizeof(struct hfsc_sched),
17341708
.owner = THIS_MODULE

net/sched/sch_hhf.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -368,15 +368,6 @@ static unsigned int hhf_drop(struct Qdisc *sch)
368368
return bucket - q->buckets;
369369
}
370370

371-
static unsigned int hhf_qdisc_drop(struct Qdisc *sch)
372-
{
373-
unsigned int prev_backlog;
374-
375-
prev_backlog = sch->qstats.backlog;
376-
hhf_drop(sch);
377-
return prev_backlog - sch->qstats.backlog;
378-
}
379-
380371
static int hhf_enqueue(struct sk_buff *skb, struct Qdisc *sch)
381372
{
382373
struct hhf_sched_data *q = qdisc_priv(sch);
@@ -709,7 +700,6 @@ static struct Qdisc_ops hhf_qdisc_ops __read_mostly = {
709700
.enqueue = hhf_enqueue,
710701
.dequeue = hhf_dequeue,
711702
.peek = qdisc_peek_dequeued,
712-
.drop = hhf_qdisc_drop,
713703
.init = hhf_init,
714704
.reset = hhf_reset,
715705
.destroy = hhf_destroy,

0 commit comments

Comments
 (0)