]> git.baikalelectronics.ru Git - kernel.git/commit
udp: use sk_protocol instead of pcflag to detect udplite sockets
authorPaolo Abeni <pabeni@redhat.com>
Fri, 31 Mar 2017 09:47:39 +0000 (11:47 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 2 Apr 2017 03:11:36 +0000 (20:11 -0700)
commita859dd221750ad2f8a777edda81063f721a0876c
tree8754e51badc325222569b533979bbf5e36479257
parent911c232f8ad9bdbebafb4fdfe751d74fcd65da3b
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>
include/linux/udp.h