Skip to content

Commit c3a173d

Browse files
Florian Westphaldavem330
authored andcommitted
sched: remove qdisc_rehape_fail
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent dd47c1f commit c3a173d

File tree

5 files changed

+7
-26
lines changed

5 files changed

+7
-26
lines changed

include/net/sch_generic.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ 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

7168
struct netdev_queue *dev_queue;
@@ -771,22 +768,6 @@ static inline int qdisc_drop(struct sk_buff *skb, struct Qdisc *sch)
771768
return NET_XMIT_DROP;
772769
}
773770

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

net/sched/sch_fifo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ static int bfifo_enqueue(struct sk_buff *skb, struct Qdisc *sch)
2424
if (likely(sch->qstats.backlog + qdisc_pkt_len(skb) <= sch->limit))
2525
return qdisc_enqueue_tail(skb, sch);
2626

27-
return qdisc_reshape_fail(skb, sch);
27+
return qdisc_drop(skb, sch);
2828
}
2929

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

35-
return qdisc_reshape_fail(skb, sch);
35+
return qdisc_drop(skb, sch);
3636
}
3737

3838
static int pfifo_tail_enqueue(struct sk_buff *skb, struct Qdisc *sch)

net/sched/sch_netem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ static struct sk_buff *netem_segment(struct sk_buff *skb, struct Qdisc *sch)
407407
segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK);
408408

409409
if (IS_ERR_OR_NULL(segs)) {
410-
qdisc_reshape_fail(skb, sch);
410+
qdisc_drop(skb, sch);
411411
return NULL;
412412
}
413413
consume_skb(skb);
@@ -499,7 +499,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
499499
}
500500

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

504504
qdisc_qstats_backlog_inc(sch, skb);
505505

net/sched/sch_plug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static int plug_enqueue(struct sk_buff *skb, struct Qdisc *sch)
9696
return qdisc_enqueue_tail(skb, sch);
9797
}
9898

99-
return qdisc_reshape_fail(skb, sch);
99+
return qdisc_drop(skb, sch);
100100
}
101101

102102
static struct sk_buff *plug_dequeue(struct Qdisc *sch)

net/sched/sch_tbf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static int tbf_segment(struct sk_buff *skb, struct Qdisc *sch)
166166
segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK);
167167

168168
if (IS_ERR_OR_NULL(segs))
169-
return qdisc_reshape_fail(skb, sch);
169+
return qdisc_drop(skb, sch);
170170

171171
nb = 0;
172172
while (segs) {
@@ -198,7 +198,7 @@ static int tbf_enqueue(struct sk_buff *skb, struct Qdisc *sch)
198198
if (qdisc_pkt_len(skb) > q->max_size) {
199199
if (skb_is_gso(skb) && skb_gso_mac_seglen(skb) <= q->max_size)
200200
return tbf_segment(skb, sch);
201-
return qdisc_reshape_fail(skb, sch);
201+
return qdisc_drop(skb, sch);
202202
}
203203
ret = qdisc_enqueue(skb, q->qdisc);
204204
if (ret != NET_XMIT_SUCCESS) {

0 commit comments

Comments
 (0)