Commit 6dcd814b authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

net: struct xfrm_tunnel in read_mostly section

tunnel4_handlers chain being scanned for each incoming packet,
make sure it doesnt share an often dirtied cache line.
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c274f291
...@@ -744,7 +744,7 @@ static void __net_init ipip_fb_tunnel_init(struct net_device *dev) ...@@ -744,7 +744,7 @@ static void __net_init ipip_fb_tunnel_init(struct net_device *dev)
ipn->tunnels_wc[0] = tunnel; ipn->tunnels_wc[0] = tunnel;
} }
static struct xfrm_tunnel ipip_handler = { static struct xfrm_tunnel ipip_handler __read_mostly = {
.handler = ipip_rcv, .handler = ipip_rcv,
.err_handler = ipip_err, .err_handler = ipip_err,
.priority = 1, .priority = 1,
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#include <net/protocol.h> #include <net/protocol.h>
#include <net/xfrm.h> #include <net/xfrm.h>
static struct xfrm_tunnel *tunnel4_handlers; static struct xfrm_tunnel *tunnel4_handlers __read_mostly;
static struct xfrm_tunnel *tunnel64_handlers; static struct xfrm_tunnel *tunnel64_handlers __read_mostly;
static DEFINE_MUTEX(tunnel4_mutex); static DEFINE_MUTEX(tunnel4_mutex);
static inline struct xfrm_tunnel **fam_handlers(unsigned short family) static inline struct xfrm_tunnel **fam_handlers(unsigned short family)
......
...@@ -58,14 +58,14 @@ static int xfrm_tunnel_err(struct sk_buff *skb, u32 info) ...@@ -58,14 +58,14 @@ static int xfrm_tunnel_err(struct sk_buff *skb, u32 info)
return -ENOENT; return -ENOENT;
} }
static struct xfrm_tunnel xfrm_tunnel_handler = { static struct xfrm_tunnel xfrm_tunnel_handler __read_mostly = {
.handler = xfrm_tunnel_rcv, .handler = xfrm_tunnel_rcv,
.err_handler = xfrm_tunnel_err, .err_handler = xfrm_tunnel_err,
.priority = 2, .priority = 2,
}; };
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) #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, .handler = xfrm_tunnel_rcv,
.err_handler = xfrm_tunnel_err, .err_handler = xfrm_tunnel_err,
.priority = 2, .priority = 2,
......
...@@ -1132,7 +1132,7 @@ static void __net_init ipip6_fb_tunnel_init(struct net_device *dev) ...@@ -1132,7 +1132,7 @@ static void __net_init ipip6_fb_tunnel_init(struct net_device *dev)
sitn->tunnels_wc[0] = tunnel; sitn->tunnels_wc[0] = tunnel;
} }
static struct xfrm_tunnel sit_handler = { static struct xfrm_tunnel sit_handler __read_mostly = {
.handler = ipip6_rcv, .handler = ipip6_rcv,
.err_handler = ipip6_err, .err_handler = ipip6_err,
.priority = 1, .priority = 1,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment