Skip to content

Commit

Permalink
sched: remove qdisc_rehape_fail
Browse files Browse the repository at this point in the history
After the removal of TCA_CBQ_POLICE in cbq scheduler qdisc->reshape_fail
is always NULL, i.e. qdisc_rehape_fail is now the same as qdisc_drop.

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 dd47c1f commit c3a173d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 26 deletions.
19 changes: 0 additions & 19 deletions include/net/sch_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ struct Qdisc {
struct list_head list;
u32 handle;
u32 parent;
int (*reshape_fail)(struct sk_buff *skb,
struct Qdisc *q);

void *u32_node;

struct netdev_queue *dev_queue;
Expand Down Expand Up @@ -771,22 +768,6 @@ static inline int qdisc_drop(struct sk_buff *skb, struct Qdisc *sch)
return NET_XMIT_DROP;
}

static inline int qdisc_reshape_fail(struct sk_buff *skb, struct Qdisc *sch)
{
qdisc_qstats_drop(sch);

#ifdef CONFIG_NET_CLS_ACT
if (sch->reshape_fail == NULL || sch->reshape_fail(skb, sch))
goto drop;

return NET_XMIT_SUCCESS;

drop:
#endif
kfree_skb(skb);
return NET_XMIT_DROP;
}

/* Length to Time (L2T) lookup in a qdisc_rate_table, to determine how
long it will take to send a packet given its size.
*/
Expand Down
4 changes: 2 additions & 2 deletions net/sched/sch_fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ static int bfifo_enqueue(struct sk_buff *skb, struct Qdisc *sch)
if (likely(sch->qstats.backlog + qdisc_pkt_len(skb) <= sch->limit))
return qdisc_enqueue_tail(skb, sch);

return qdisc_reshape_fail(skb, sch);
return qdisc_drop(skb, sch);
}

static int pfifo_enqueue(struct sk_buff *skb, struct Qdisc *sch)
{
if (likely(skb_queue_len(&sch->q) < sch->limit))
return qdisc_enqueue_tail(skb, sch);

return qdisc_reshape_fail(skb, sch);
return qdisc_drop(skb, sch);
}

static int pfifo_tail_enqueue(struct sk_buff *skb, struct Qdisc *sch)
Expand Down
4 changes: 2 additions & 2 deletions net/sched/sch_netem.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ static struct sk_buff *netem_segment(struct sk_buff *skb, struct Qdisc *sch)
segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK);

if (IS_ERR_OR_NULL(segs)) {
qdisc_reshape_fail(skb, sch);
qdisc_drop(skb, sch);
return NULL;
}
consume_skb(skb);
Expand Down Expand Up @@ -499,7 +499,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
}

if (unlikely(skb_queue_len(&sch->q) >= sch->limit))
return qdisc_reshape_fail(skb, sch);
return qdisc_drop(skb, sch);

qdisc_qstats_backlog_inc(sch, skb);

Expand Down
2 changes: 1 addition & 1 deletion net/sched/sch_plug.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static int plug_enqueue(struct sk_buff *skb, struct Qdisc *sch)
return qdisc_enqueue_tail(skb, sch);
}

return qdisc_reshape_fail(skb, sch);
return qdisc_drop(skb, sch);
}

static struct sk_buff *plug_dequeue(struct Qdisc *sch)
Expand Down
4 changes: 2 additions & 2 deletions net/sched/sch_tbf.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static int tbf_segment(struct sk_buff *skb, struct Qdisc *sch)
segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK);

if (IS_ERR_OR_NULL(segs))
return qdisc_reshape_fail(skb, sch);
return qdisc_drop(skb, sch);

nb = 0;
while (segs) {
Expand Down Expand Up @@ -198,7 +198,7 @@ static int tbf_enqueue(struct sk_buff *skb, struct Qdisc *sch)
if (qdisc_pkt_len(skb) > q->max_size) {
if (skb_is_gso(skb) && skb_gso_mac_seglen(skb) <= q->max_size)
return tbf_segment(skb, sch);
return qdisc_reshape_fail(skb, sch);
return qdisc_drop(skb, sch);
}
ret = qdisc_enqueue(skb, q->qdisc);
if (ret != NET_XMIT_SUCCESS) {
Expand Down

0 comments on commit c3a173d

Please sign in to comment.