From 447167bf565a474ff0cfb0f41d54936937479e97 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Wed, 11 Apr 2012 23:05:28 +0000 Subject: udp: intoduce udp_encap_needed static_key Most machines dont use UDP encapsulation (L2TP) Adds a static_key so that udp_queue_rcv_skb() doesnt have to perform a test if L2TP never setup the encap_rcv on a socket. Idea of this patch came after Simon Horman proposal to add a hook on TCP as well. If static_key is not yet enabled, the fast path does a single JMP . When static_key is enabled, JMP destination is patched to reach the real encap_type/encap_rcv logic, possibly adding cache misses. Signed-off-by: Eric Dumazet Cc: Simon Horman Cc: dev@openvswitch.org Signed-off-by: David S. Miller --- include/net/udp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/net/udp.h') diff --git a/include/net/udp.h b/include/net/udp.h index 5d606d9da9e5..9671f5f1df9c 100644 --- a/include/net/udp.h +++ b/include/net/udp.h @@ -267,4 +267,5 @@ extern void udp_init(void); extern int udp4_ufo_send_check(struct sk_buff *skb); extern struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, netdev_features_t features); +extern void udp_encap_enable(void); #endif /* _UDP_H */ -- cgit v1.2.3