diff options
author | Paolo Abeni <pabeni@redhat.com> | 2017-03-31 05:47:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-01 23:11:36 -0400 |
commit | 3d8417d79e0da6a47ff29932ef80486be78af56e (patch) | |
tree | 8754e51badc325222569b533979bbf5e36479257 | |
parent | 768bfa2a061f0a3aeb1080015deffd57f294c55d (diff) |
udp: use sk_protocol instead of pcflag to detect udplite sockets
In the udp_sock struct, the 'forward_deficit' and 'pcflag' fields
share the same cacheline. While the first is dirtied by
udp_recvmsg, the latter is read, possibly several times, by the
bottom half processing to discriminate between udp and udplite
sockets.
With this patch, sk->sk_protocol is used to check is the socket is
really an udplite one, avoiding some cache misses per
packet and improving the performance under udp_flood with
small packet up to 10%.
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/udp.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/udp.h b/include/linux/udp.h index c0f530809d1f..6cb4061a720d 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
@@ -115,6 +115,6 @@ static inline bool udp_get_no_check6_rx(struct sock *sk) | |||
115 | #define udp_portaddr_for_each_entry_rcu(__sk, list) \ | 115 | #define udp_portaddr_for_each_entry_rcu(__sk, list) \ |
116 | hlist_for_each_entry_rcu(__sk, list, __sk_common.skc_portaddr_node) | 116 | hlist_for_each_entry_rcu(__sk, list, __sk_common.skc_portaddr_node) |
117 | 117 | ||
118 | #define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag) | 118 | #define IS_UDPLITE(__sk) (__sk->sk_protocol == IPPROTO_UDPLITE) |
119 | 119 | ||
120 | #endif /* _LINUX_UDP_H */ | 120 | #endif /* _LINUX_UDP_H */ |