net: sched: use skb_list_walk_safe helper for gso segments
This is a straight-forward conversion case for the new function, keeping the flow of the existing code as intact as possible. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2cec4448db
commit
b950d8a5b3
|
@ -1682,8 +1682,7 @@ static s32 cake_enqueue(struct sk_buff *skb, struct Qdisc *sch,
|
||||||
if (IS_ERR_OR_NULL(segs))
|
if (IS_ERR_OR_NULL(segs))
|
||||||
return qdisc_drop(skb, sch, to_free);
|
return qdisc_drop(skb, sch, to_free);
|
||||||
|
|
||||||
while (segs) {
|
skb_list_walk_safe(segs, segs, nskb) {
|
||||||
nskb = segs->next;
|
|
||||||
skb_mark_not_on_list(segs);
|
skb_mark_not_on_list(segs);
|
||||||
qdisc_skb_cb(segs)->pkt_len = segs->len;
|
qdisc_skb_cb(segs)->pkt_len = segs->len;
|
||||||
cobalt_set_enqueue_time(segs, now);
|
cobalt_set_enqueue_time(segs, now);
|
||||||
|
@ -1696,7 +1695,6 @@ static s32 cake_enqueue(struct sk_buff *skb, struct Qdisc *sch,
|
||||||
slen += segs->len;
|
slen += segs->len;
|
||||||
q->buffer_used += segs->truesize;
|
q->buffer_used += segs->truesize;
|
||||||
b->packets++;
|
b->packets++;
|
||||||
segs = nskb;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* stats */
|
/* stats */
|
||||||
|
|
|
@ -155,8 +155,7 @@ static int tbf_segment(struct sk_buff *skb, struct Qdisc *sch,
|
||||||
return qdisc_drop(skb, sch, to_free);
|
return qdisc_drop(skb, sch, to_free);
|
||||||
|
|
||||||
nb = 0;
|
nb = 0;
|
||||||
while (segs) {
|
skb_list_walk_safe(segs, segs, nskb) {
|
||||||
nskb = segs->next;
|
|
||||||
skb_mark_not_on_list(segs);
|
skb_mark_not_on_list(segs);
|
||||||
qdisc_skb_cb(segs)->pkt_len = segs->len;
|
qdisc_skb_cb(segs)->pkt_len = segs->len;
|
||||||
len += segs->len;
|
len += segs->len;
|
||||||
|
@ -167,7 +166,6 @@ static int tbf_segment(struct sk_buff *skb, struct Qdisc *sch,
|
||||||
} else {
|
} else {
|
||||||
nb++;
|
nb++;
|
||||||
}
|
}
|
||||||
segs = nskb;
|
|
||||||
}
|
}
|
||||||
sch->q.qlen += nb;
|
sch->q.qlen += nb;
|
||||||
if (nb > 1)
|
if (nb > 1)
|
||||||
|
|
Loading…
Reference in New Issue