Thread (1 message) 1 message, 1 author, 2009-02-09

Re: [RFT 3/3] iptables: lock free counters

From: Patrick McHardy <hidden>
Date: 2009-02-09 15:58:19
Also in: netfilter-devel

Stephen Hemminger wrote:
quoted hunk
--- a/net/ipv4/netfilter/ip_tables.c	2009-01-29 11:09:20.720069979 -0800
+++ b/net/ipv4/netfilter/ip_tables.c	2009-01-29 11:10:49.827070289 -0800
@@ -347,9 +347,9 @@ ipt_do_table(struct sk_buff *skb,
 	mtpar.family  = tgpar.family = NFPROTO_IPV4;
 	tgpar.hooknum = hook;
 
-	read_lock_bh(&table->lock);
+	rcu_read_lock_bh();
 	IP_NF_ASSERT(table->valid_hooks & (1 << hook));
-	private = table->private;
+	private = rcu_dereference(table->private);
 	table_base = (void *)private->entries[smp_processor_id()];
 	e = get_entry(table_base, private->hook_entry[hook]);
I think this doesn't actually need the _bh rcu_read_lock() variant
since updates are never done in softirq context.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help