]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: drop qdisc_reset from dev_graft_qdisc
authorJohn Fastabend <john.fastabend@gmail.com>
Thu, 7 Dec 2017 17:56:04 +0000 (09:56 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Dec 2017 18:32:25 +0000 (13:32 -0500)
commit79377b88dbba96f479c19ffd67384fa9d7e734f9
tree7561b35b1ac9ddcc6c3280ea74dc591656d72f10
parent323970d93e4ffab4fda9e448a41ed503bc1028de
net: sched: drop qdisc_reset from dev_graft_qdisc

In qdisc_graft_qdisc a "new" qdisc is attached and the 'qdisc_destroy'
operation is called on the old qdisc. The destroy operation will wait
a rcu grace period and call qdisc_rcu_free(). At which point
gso_cpu_skb is free'd along with all stats so no need to zero stats
and gso_cpu_skb from the graft operation itself.

Further after dropping the qdisc locks we can not continue to call
qdisc_reset before waiting an rcu grace period so that the qdisc is
detached from all cpus. By removing the qdisc_reset() here we get
the correct property of waiting an rcu grace period and letting the
qdisc_destroy operation clean up the qdisc correctly.

Note, a refcnt greater than 1 would cause the destroy operation to
be aborted however if this ever happened the reference to the qdisc
would be lost and we would have a memory leak.

Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_generic.c