net_sched: sch_netem: defer skb freeing
authorEric Dumazet <edumazet@google.com>
Tue, 14 Jun 2016 03:21:57 +0000 (20:21 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Jun 2016 21:08:35 +0000 (14:08 -0700)
rtnl_kfree_skbs() can be used in tfifo_reset()

It would be nice if we could iterate through rb tree instead
of removing one skb at a time, and build a single skb chain.
But this is left for a future patch.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_netem.c

index 876df13c745a9cc40a059af5fe7112dca6881972..e271967439bf75d668781f25a36dd3a350ec8e6f 100644 (file)
@@ -368,9 +368,7 @@ static void tfifo_reset(struct Qdisc *sch)
                struct sk_buff *skb = netem_rb_to_skb(p);
 
                rb_erase(p, &q->t_root);
-               skb->next = NULL;
-               skb->prev = NULL;
-               kfree_skb(skb);
+               rtnl_kfree_skbs(skb, skb);
        }
 }