ipv6: struct xfrm6_tunnel in read_mostly section
authorEric Dumazet <eric.dumazet@gmail.com>
Mon, 30 Aug 2010 10:27:10 +0000 (10:27 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 30 Aug 2010 20:50:46 +0000 (13:50 -0700)
tunnel6_handlers chain being scanned for each incoming packet,
make sure it doesnt share an often dirtied cache line.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_tunnel.c
net/ipv6/tunnel6.c
net/ipv6/xfrm6_tunnel.c

index 0fd027f3f47e170608d75ea735a74f535838b80a..29f99dd75bc6307d35499ed4ca70a46bb855d1d8 100644 (file)
@@ -1372,13 +1372,13 @@ static void __net_init ip6_fb_tnl_dev_init(struct net_device *dev)
        ip6n->tnls_wc[0] = t;
 }
 
-static struct xfrm6_tunnel ip4ip6_handler = {
+static struct xfrm6_tunnel ip4ip6_handler __read_mostly = {
        .handler        = ip4ip6_rcv,
        .err_handler    = ip4ip6_err,
        .priority       =       1,
 };
 
-static struct xfrm6_tunnel ip6ip6_handler = {
+static struct xfrm6_tunnel ip6ip6_handler __read_mostly = {
        .handler        = ip6ip6_rcv,
        .err_handler    = ip6ip6_err,
        .priority       =       1,
index fc3c86a474526ee1c3b9c3f644fbe1d14c458f0e..d203e6df1f8b3eeaa1b3e3caa0832c92174784c9 100644 (file)
@@ -30,8 +30,8 @@
 #include <net/protocol.h>
 #include <net/xfrm.h>
 
-static struct xfrm6_tunnel *tunnel6_handlers;
-static struct xfrm6_tunnel *tunnel46_handlers;
+static struct xfrm6_tunnel *tunnel6_handlers __read_mostly;
+static struct xfrm6_tunnel *tunnel46_handlers __read_mostly;
 static DEFINE_MUTEX(tunnel6_mutex);
 
 int xfrm6_tunnel_register(struct xfrm6_tunnel *handler, unsigned short family)
index 2ce3a8278f26576668ffafd178891451e2b5fc87..ac7584b946a5c38692b626f2c939701e1e5b1cb8 100644 (file)
@@ -317,13 +317,13 @@ static const struct xfrm_type xfrm6_tunnel_type = {
        .output         = xfrm6_tunnel_output,
 };
 
-static struct xfrm6_tunnel xfrm6_tunnel_handler = {
+static struct xfrm6_tunnel xfrm6_tunnel_handler __read_mostly = {
        .handler        = xfrm6_tunnel_rcv,
        .err_handler    = xfrm6_tunnel_err,
        .priority       = 2,
 };
 
-static struct xfrm6_tunnel xfrm46_tunnel_handler = {
+static struct xfrm6_tunnel xfrm46_tunnel_handler __read_mostly = {
        .handler        = xfrm6_tunnel_rcv,
        .err_handler    = xfrm6_tunnel_err,
        .priority       = 2,