net: struct xfrm_tunnel in read_mostly section
authorEric Dumazet <eric.dumazet@gmail.com>
Mon, 30 Aug 2010 07:04:14 +0000 (07:04 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 30 Aug 2010 20:50:45 +0000 (13:50 -0700)
tunnel4_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/ipv4/ipip.c
net/ipv4/tunnel4.c
net/ipv4/xfrm4_tunnel.c
net/ipv6/sit.c

index ec036731a70ba0774164de8574c30d0f0e1baa64..3c6f8f3968a6fcc2a7b41e1290ca87cf55640198 100644 (file)
@@ -744,7 +744,7 @@ static void __net_init ipip_fb_tunnel_init(struct net_device *dev)
        ipn->tunnels_wc[0]      = tunnel;
 }
 
-static struct xfrm_tunnel ipip_handler = {
+static struct xfrm_tunnel ipip_handler __read_mostly = {
        .handler        =       ipip_rcv,
        .err_handler    =       ipip_err,
        .priority       =       1,
index 59186ca7808a20fcf6eda607491bcaba60cf2263..942f02da07d80557b65d56dbc7aafe5bcc456066 100644 (file)
@@ -14,8 +14,8 @@
 #include <net/protocol.h>
 #include <net/xfrm.h>
 
-static struct xfrm_tunnel *tunnel4_handlers;
-static struct xfrm_tunnel *tunnel64_handlers;
+static struct xfrm_tunnel *tunnel4_handlers __read_mostly;
+static struct xfrm_tunnel *tunnel64_handlers __read_mostly;
 static DEFINE_MUTEX(tunnel4_mutex);
 
 static inline struct xfrm_tunnel **fam_handlers(unsigned short family)
index 41f5982d20876ecb7ab1df92f5533d451b932ee2..82806455e8598862d1e925ff24a05403e8cd6519 100644 (file)
@@ -58,14 +58,14 @@ static int xfrm_tunnel_err(struct sk_buff *skb, u32 info)
        return -ENOENT;
 }
 
-static struct xfrm_tunnel xfrm_tunnel_handler = {
+static struct xfrm_tunnel xfrm_tunnel_handler __read_mostly = {
        .handler        =       xfrm_tunnel_rcv,
        .err_handler    =       xfrm_tunnel_err,
        .priority       =       2,
 };
 
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
-static struct xfrm_tunnel xfrm64_tunnel_handler = {
+static struct xfrm_tunnel xfrm64_tunnel_handler __read_mostly = {
        .handler        =       xfrm_tunnel_rcv,
        .err_handler    =       xfrm_tunnel_err,
        .priority       =       2,
index 4699cd3c3118ffefb90d4f1e587683aedddcc866..86618eb3033505df3915533f46359269699ecf7c 100644 (file)
@@ -1132,7 +1132,7 @@ static void __net_init ipip6_fb_tunnel_init(struct net_device *dev)
        sitn->tunnels_wc[0]     = tunnel;
 }
 
-static struct xfrm_tunnel sit_handler = {
+static struct xfrm_tunnel sit_handler __read_mostly = {
        .handler        =       ipip6_rcv,
        .err_handler    =       ipip6_err,
        .priority       =       1,