Skip to content

Commit

Permalink
sch_netem: more precise length of packets
Browse files Browse the repository at this point in the history
With TSO/GSO/GRO packets, skb->len doesn't represent
a precise amount of bytes on wire.
This patch replace skb->len with qdisc_pkt_len(skb)
which is more precise.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yang Yingliang authored and David S. Miller committed Dec 31, 2013
1 parent 837052d commit 8cfd88d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sched/sch_netem.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
now = netem_skb_cb(last)->time_to_send;
}

delay += packet_len_2_sched_time(skb->len, q);
delay += packet_len_2_sched_time(qdisc_pkt_len(skb), q);
}

cb->time_to_send = now + delay;
Expand Down

0 comments on commit 8cfd88d

Please sign in to comment.