Skip to content

Commit

Permalink
sched: remove qdisc->drop
Browse files Browse the repository at this point in the history
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 <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Westphal authored and David S. Miller committed Jun 9, 2016
1 parent c3a173d commit a09ceb0
Show file tree
Hide file tree
Showing 19 changed files with 0 additions and 395 deletions.
36 changes: 0 additions & 36 deletions include/net/sch_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ struct Qdisc_ops {
int (*enqueue)(struct sk_buff *, struct Qdisc *);
struct sk_buff * (*dequeue)(struct Qdisc *);
struct sk_buff * (*peek)(struct Qdisc *);
unsigned int (*drop)(struct Qdisc *);

int (*init)(struct Qdisc *, struct nlattr *arg);
void (*reset)(struct Qdisc *);
Expand Down Expand Up @@ -658,22 +657,6 @@ static inline unsigned int qdisc_queue_drop_head(struct Qdisc *sch)
return __qdisc_queue_drop_head(sch, &sch->q);
}

static inline struct sk_buff *__qdisc_dequeue_tail(struct Qdisc *sch,
struct sk_buff_head *list)
{
struct sk_buff *skb = __skb_dequeue_tail(list);

if (likely(skb != NULL))
qdisc_qstats_backlog_dec(sch, skb);

return skb;
}

static inline struct sk_buff *qdisc_dequeue_tail(struct Qdisc *sch)
{
return __qdisc_dequeue_tail(sch, &sch->q);
}

static inline struct sk_buff *qdisc_peek_head(struct Qdisc *sch)
{
return skb_peek(&sch->q);
Expand Down Expand Up @@ -741,25 +724,6 @@ static inline struct Qdisc *qdisc_replace(struct Qdisc *sch, struct Qdisc *new,
return old;
}

static inline unsigned int __qdisc_queue_drop(struct Qdisc *sch,
struct sk_buff_head *list)
{
struct sk_buff *skb = __qdisc_dequeue_tail(sch, list);

if (likely(skb != NULL)) {
unsigned int len = qdisc_pkt_len(skb);
kfree_skb(skb);
return len;
}

return 0;
}

static inline unsigned int qdisc_queue_drop(struct Qdisc *sch)
{
return __qdisc_queue_drop(sch, &sch->q);
}

static inline int qdisc_drop(struct sk_buff *skb, struct Qdisc *sch)
{
kfree_skb(skb);
Expand Down
15 changes: 0 additions & 15 deletions net/sched/sch_atm.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,20 +519,6 @@ static struct sk_buff *atm_tc_peek(struct Qdisc *sch)
return p->link.q->ops->peek(p->link.q);
}

static unsigned int atm_tc_drop(struct Qdisc *sch)
{
struct atm_qdisc_data *p = qdisc_priv(sch);
struct atm_flow_data *flow;
unsigned int len;

pr_debug("atm_tc_drop(sch %p,[qdisc %p])\n", sch, p);
list_for_each_entry(flow, &p->flows, list) {
if (flow->q->ops->drop && (len = flow->q->ops->drop(flow->q)))
return len;
}
return 0;
}

static int atm_tc_init(struct Qdisc *sch, struct nlattr *opt)
{
struct atm_qdisc_data *p = qdisc_priv(sch);
Expand Down Expand Up @@ -672,7 +658,6 @@ static struct Qdisc_ops atm_qdisc_ops __read_mostly = {
.enqueue = atm_tc_enqueue,
.dequeue = atm_tc_dequeue,
.peek = atm_tc_peek,
.drop = atm_tc_drop,
.init = atm_tc_init,
.reset = atm_tc_reset,
.destroy = atm_tc_destroy,
Expand Down
26 changes: 0 additions & 26 deletions net/sched/sch_cbq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1025,31 +1025,6 @@ static void cbq_link_class(struct cbq_class *this)
}
}

static unsigned int cbq_drop(struct Qdisc *sch)
{
struct cbq_sched_data *q = qdisc_priv(sch);
struct cbq_class *cl, *cl_head;
int prio;
unsigned int len;

for (prio = TC_CBQ_MAXPRIO; prio >= 0; prio--) {
cl_head = q->active[prio];
if (!cl_head)
continue;

cl = cl_head;
do {
if (cl->q->ops->drop && (len = cl->q->ops->drop(cl->q))) {
sch->q.qlen--;
if (!cl->q->q.qlen)
cbq_deactivate_class(cl);
return len;
}
} while ((cl = cl->next_alive) != cl_head);
}
return 0;
}

static void
cbq_reset(struct Qdisc *sch)
{
Expand Down Expand Up @@ -1791,7 +1766,6 @@ static struct Qdisc_ops cbq_qdisc_ops __read_mostly = {
.enqueue = cbq_enqueue,
.dequeue = cbq_dequeue,
.peek = qdisc_peek_dequeued,
.drop = cbq_drop,
.init = cbq_init,
.reset = cbq_reset,
.destroy = cbq_destroy,
Expand Down
17 changes: 0 additions & 17 deletions net/sched/sch_choke.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,22 +365,6 @@ static struct sk_buff *choke_dequeue(struct Qdisc *sch)
return skb;
}

static unsigned int choke_drop(struct Qdisc *sch)
{
struct choke_sched_data *q = qdisc_priv(sch);
unsigned int len;

len = qdisc_queue_drop(sch);
if (len > 0)
q->stats.other++;
else {
if (!red_is_idling(&q->vars))
red_start_of_idle_period(&q->vars);
}

return len;
}

static void choke_reset(struct Qdisc *sch)
{
struct choke_sched_data *q = qdisc_priv(sch);
Expand Down Expand Up @@ -569,7 +553,6 @@ static struct Qdisc_ops choke_qdisc_ops __read_mostly = {
.enqueue = choke_enqueue,
.dequeue = choke_dequeue,
.peek = choke_peek_head,
.drop = choke_drop,
.init = choke_init,
.destroy = choke_destroy,
.reset = choke_reset,
Expand Down
21 changes: 0 additions & 21 deletions net/sched/sch_drr.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,26 +421,6 @@ static struct sk_buff *drr_dequeue(struct Qdisc *sch)
return NULL;
}

static unsigned int drr_drop(struct Qdisc *sch)
{
struct drr_sched *q = qdisc_priv(sch);
struct drr_class *cl;
unsigned int len;

list_for_each_entry(cl, &q->active, alist) {
if (cl->qdisc->ops->drop) {
len = cl->qdisc->ops->drop(cl->qdisc);
if (len > 0) {
sch->q.qlen--;
if (cl->qdisc->q.qlen == 0)
list_del(&cl->alist);
return len;
}
}
}
return 0;
}

static int drr_init_qdisc(struct Qdisc *sch, struct nlattr *opt)
{
struct drr_sched *q = qdisc_priv(sch);
Expand Down Expand Up @@ -509,7 +489,6 @@ static struct Qdisc_ops drr_qdisc_ops __read_mostly = {
.enqueue = drr_enqueue,
.dequeue = drr_dequeue,
.peek = qdisc_peek_dequeued,
.drop = drr_drop,
.init = drr_init_qdisc,
.reset = drr_reset_qdisc,
.destroy = drr_destroy_qdisc,
Expand Down
18 changes: 0 additions & 18 deletions net/sched/sch_dsmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,23 +320,6 @@ static struct sk_buff *dsmark_peek(struct Qdisc *sch)
return p->q->ops->peek(p->q);
}

static unsigned int dsmark_drop(struct Qdisc *sch)
{
struct dsmark_qdisc_data *p = qdisc_priv(sch);
unsigned int len;

pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);

if (p->q->ops->drop == NULL)
return 0;

len = p->q->ops->drop(p->q);
if (len)
sch->q.qlen--;

return len;
}

static int dsmark_init(struct Qdisc *sch, struct nlattr *opt)
{
struct dsmark_qdisc_data *p = qdisc_priv(sch);
Expand Down Expand Up @@ -489,7 +472,6 @@ static struct Qdisc_ops dsmark_qdisc_ops __read_mostly = {
.enqueue = dsmark_enqueue,
.dequeue = dsmark_dequeue,
.peek = dsmark_peek,
.drop = dsmark_drop,
.init = dsmark_init,
.reset = dsmark_reset,
.destroy = dsmark_destroy,
Expand Down
3 changes: 0 additions & 3 deletions net/sched/sch_fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ struct Qdisc_ops pfifo_qdisc_ops __read_mostly = {
.enqueue = pfifo_enqueue,
.dequeue = qdisc_dequeue_head,
.peek = qdisc_peek_head,
.drop = qdisc_queue_drop,
.init = fifo_init,
.reset = qdisc_reset_queue,
.change = fifo_init,
Expand All @@ -114,7 +113,6 @@ struct Qdisc_ops bfifo_qdisc_ops __read_mostly = {
.enqueue = bfifo_enqueue,
.dequeue = qdisc_dequeue_head,
.peek = qdisc_peek_head,
.drop = qdisc_queue_drop,
.init = fifo_init,
.reset = qdisc_reset_queue,
.change = fifo_init,
Expand All @@ -129,7 +127,6 @@ struct Qdisc_ops pfifo_head_drop_qdisc_ops __read_mostly = {
.enqueue = pfifo_tail_enqueue,
.dequeue = qdisc_dequeue_head,
.peek = qdisc_peek_head,
.drop = qdisc_queue_drop_head,
.init = fifo_init,
.reset = qdisc_reset_queue,
.change = fifo_init,
Expand Down
10 changes: 0 additions & 10 deletions net/sched/sch_fq_codel.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,6 @@ static unsigned int fq_codel_drop(struct Qdisc *sch, unsigned int max_packets)
return idx;
}

static unsigned int fq_codel_qdisc_drop(struct Qdisc *sch)
{
unsigned int prev_backlog;

prev_backlog = sch->qstats.backlog;
fq_codel_drop(sch, 1U);
return prev_backlog - sch->qstats.backlog;
}

static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch)
{
struct fq_codel_sched_data *q = qdisc_priv(sch);
Expand Down Expand Up @@ -704,7 +695,6 @@ static struct Qdisc_ops fq_codel_qdisc_ops __read_mostly = {
.enqueue = fq_codel_enqueue,
.dequeue = fq_codel_dequeue,
.peek = qdisc_peek_dequeued,
.drop = fq_codel_qdisc_drop,
.init = fq_codel_init,
.reset = fq_codel_reset,
.destroy = fq_codel_destroy,
Expand Down
35 changes: 0 additions & 35 deletions net/sched/sch_gred.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,40 +276,6 @@ static struct sk_buff *gred_dequeue(struct Qdisc *sch)
return NULL;
}

static unsigned int gred_drop(struct Qdisc *sch)
{
struct sk_buff *skb;
struct gred_sched *t = qdisc_priv(sch);

skb = qdisc_dequeue_tail(sch);
if (skb) {
unsigned int len = qdisc_pkt_len(skb);
struct gred_sched_data *q;
u16 dp = tc_index_to_dp(skb);

if (dp >= t->DPs || (q = t->tab[dp]) == NULL) {
net_warn_ratelimited("GRED: Unable to relocate VQ 0x%x while dropping, screwing up backlog\n",
tc_index_to_dp(skb));
} else {
q->backlog -= len;
q->stats.other++;

if (gred_wred_mode(t)) {
if (!sch->qstats.backlog)
red_start_of_idle_period(&t->wred_set);
} else {
if (!q->backlog)
red_start_of_idle_period(&q->vars);
}
}

qdisc_drop(skb, sch);
return len;
}

return 0;
}

static void gred_reset(struct Qdisc *sch)
{
int i;
Expand Down Expand Up @@ -623,7 +589,6 @@ static struct Qdisc_ops gred_qdisc_ops __read_mostly = {
.enqueue = gred_enqueue,
.dequeue = gred_dequeue,
.peek = qdisc_peek_head,
.drop = gred_drop,
.init = gred_init,
.reset = gred_reset,
.destroy = gred_destroy,
Expand Down
26 changes: 0 additions & 26 deletions net/sched/sch_hfsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1677,31 +1677,6 @@ hfsc_dequeue(struct Qdisc *sch)
return skb;
}

static unsigned int
hfsc_drop(struct Qdisc *sch)
{
struct hfsc_sched *q = qdisc_priv(sch);
struct hfsc_class *cl;
unsigned int len;

list_for_each_entry(cl, &q->droplist, dlist) {
if (cl->qdisc->ops->drop != NULL &&
(len = cl->qdisc->ops->drop(cl->qdisc)) > 0) {
if (cl->qdisc->q.qlen == 0) {
update_vf(cl, 0, 0);
set_passive(cl);
} else {
list_move_tail(&cl->dlist, &q->droplist);
}
cl->qstats.drops++;
qdisc_qstats_drop(sch);
sch->q.qlen--;
return len;
}
}
return 0;
}

static const struct Qdisc_class_ops hfsc_class_ops = {
.change = hfsc_change_class,
.delete = hfsc_delete_class,
Expand All @@ -1728,7 +1703,6 @@ static struct Qdisc_ops hfsc_qdisc_ops __read_mostly = {
.enqueue = hfsc_enqueue,
.dequeue = hfsc_dequeue,
.peek = qdisc_peek_dequeued,
.drop = hfsc_drop,
.cl_ops = &hfsc_class_ops,
.priv_size = sizeof(struct hfsc_sched),
.owner = THIS_MODULE
Expand Down
10 changes: 0 additions & 10 deletions net/sched/sch_hhf.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,15 +368,6 @@ static unsigned int hhf_drop(struct Qdisc *sch)
return bucket - q->buckets;
}

static unsigned int hhf_qdisc_drop(struct Qdisc *sch)
{
unsigned int prev_backlog;

prev_backlog = sch->qstats.backlog;
hhf_drop(sch);
return prev_backlog - sch->qstats.backlog;
}

static int hhf_enqueue(struct sk_buff *skb, struct Qdisc *sch)
{
struct hhf_sched_data *q = qdisc_priv(sch);
Expand Down Expand Up @@ -709,7 +700,6 @@ static struct Qdisc_ops hhf_qdisc_ops __read_mostly = {
.enqueue = hhf_enqueue,
.dequeue = hhf_dequeue,
.peek = qdisc_peek_dequeued,
.drop = hhf_qdisc_drop,
.init = hhf_init,
.reset = hhf_reset,
.destroy = hhf_destroy,
Expand Down
Loading

0 comments on commit a09ceb0

Please sign in to comment.