]> git.baikalelectronics.ru Git - kernel.git/commit
udp: intoduce udp_encap_needed static_key
authorEric Dumazet <eric.dumazet@gmail.com>
Wed, 11 Apr 2012 23:05:28 +0000 (23:05 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 13 Apr 2012 17:39:37 +0000 (13:39 -0400)
commitc41d92b43b81e3d7153eed5d5bbcb1954426e543
tree38b03cb4e23bec19939545575e36f7395c5b156e
parent9ae9998753d034201931219e5102889bfa011f4a
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 <eric.dumazet@gmail.com>
Cc: Simon Horman <horms@verge.net.au>
Cc: dev@openvswitch.org
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/udp.h
net/ipv4/udp.c
net/l2tp/l2tp_core.c