summaryrefslogtreecommitdiffstats
path: root/include/linux/if_tunnel.h
diff options
context:
space:
mode:
authorAmerigo Wang2012-11-11 22:52:34 +0100
committerDavid S. Miller2012-11-15 00:49:50 +0100
commite086cadc08e259150b2ab8f7f4a16dbf9e3c2f22 (patch)
tree38ef29e21c125dcb9f8fd75749416e4839c84469 /include/linux/if_tunnel.h
parentnet: convert __IPTUNNEL_XMIT() to an inline function (diff)
downloadkernel-qcow2-linux-e086cadc08e259150b2ab8f7f4a16dbf9e3c2f22.tar.gz
kernel-qcow2-linux-e086cadc08e259150b2ab8f7f4a16dbf9e3c2f22.tar.xz
kernel-qcow2-linux-e086cadc08e259150b2ab8f7f4a16dbf9e3c2f22.zip
net: unify for_each_ip_tunnel_rcu()
The defitions of for_each_ip_tunnel_rcu() are same, so unify it. Also, don't hide the parameter 't'. Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/if_tunnel.h')
-rw-r--r--include/linux/if_tunnel.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 06d1d5badd36..f4e56ecd0b1a 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -6,6 +6,13 @@
#include <uapi/linux/if_tunnel.h>
#include <linux/u64_stats_sync.h>
+/*
+ * Locking : hash tables are protected by RCU and RTNL
+ */
+
+#define for_each_ip_tunnel_rcu(pos, start) \
+ for (pos = rcu_dereference(start); pos; pos = rcu_dereference(pos->next))
+
/* often modified stats are per cpu, other are shared (netdev->stats) */
struct pcpu_tstats {
u64 rx_packets;