sch_netem: more precise length of packets
authorYang Yingliang <yangyingliang@huawei.com>
Wed, 25 Dec 2013 09:35:14 +0000 (17:35 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 31 Dec 2013 19:31:43 +0000 (14:31 -0500)
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>
net/sched/sch_netem.c

index f3befd6b4781bde74547f9b60b9b3733dba78bcd..9632a4e753b77e0a8e0039231fcd6b13b87a3586 100644 (file)
@@ -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;