From: Eric Dumazet <[email protected]>

Only left enqueue_root() user is netem, and it looks not necessary :

qdisc_skb_cb(skb)->pkt_len is preserved after one skb_clone()

Signed-off-by: Eric Dumazet <[email protected]>
---
 include/net/sch_generic.h |    6 ------
 net/sched/sch_netem.c     |    4 ++--
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 
994b5a092f33f00812cb74e61e02bd96b52bad93..1b0a2e88ed2b47eeae0e01b6b9cda2893e15fcff
 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -501,12 +501,6 @@ static inline int qdisc_enqueue(struct sk_buff *skb, 
struct Qdisc *sch)
        return sch->enqueue(skb, sch);
 }
 
-static inline int qdisc_enqueue_root(struct sk_buff *skb, struct Qdisc *sch)
-{
-       qdisc_skb_cb(skb)->pkt_len = skb->len;
-       return qdisc_enqueue(skb, sch) & NET_XMIT_MASK;
-}
-
 static inline bool qdisc_is_percpu_stats(const struct Qdisc *q)
 {
        return q->flags & TCQ_F_CPUSTATS;
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 
956ead2cab9ad89f36835039a9b728d24a58ca41..5abd1d9de989e6c9777a225c03e42f8194ebda33
 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -440,9 +440,9 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc 
*sch)
        if (count > 1 && (skb2 = skb_clone(skb, GFP_ATOMIC)) != NULL) {
                struct Qdisc *rootq = qdisc_root(sch);
                u32 dupsave = q->duplicate; /* prevent duplicating a dup... */
-               q->duplicate = 0;
 
-               qdisc_enqueue_root(skb2, rootq);
+               q->duplicate = 0;
+               rootq->enqueue(skb2, rootq);
                q->duplicate = dupsave;
        }
 


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to