]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
net: sched: cls_basic use RCU
authorJohn Fastabend <john.fastabend@gmail.com>
Sat, 13 Sep 2014 03:05:59 +0000 (20:05 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 13 Sep 2014 16:30:25 +0000 (12:30 -0400)
commit9888faefe1327909f3acf34d1feda87a368bb858
treea65bd7a2dc103bf93d50a1234f0db37a749f608b
parent25d8c0d55f241ce2d360df1bea48e23a55836ee6
net: sched: cls_basic use RCU

Enable basic classifier for RCU.

Dereferencing tp->root may look a bit strange here but it is needed
by my accounting because it is allocated at init time and needs to
be kfree'd at destroy time. However because it may be referenced in
the classify() path we must wait an RCU grace period before free'ing
it. We use kfree_rcu() and rcu_ APIs to enforce this. This pattern
is used in all the classifiers.

Also the hgenerator can be incremented without concern because it
is always incremented under RTNL.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_basic.c