linux/include
Eric Dumazet ce43b03e88 net: move inet_dport/inet_num in sock_common
commit 68835aba4d (net: optimize INET input path further)
moved some fields used for tcp/udp sockets lookup in the first cache
line of struct sock_common.

This patch moves inet_dport/inet_num as well, filling a 32bit hole
on 64 bit arches and reducing number of cache line misses in lookups.

Also change INET_MATCH()/INET_TW_MATCH() to perform the ports match
before addresses match, as this check is more discriminant.

Remove the hash check from MATCH() macros because we dont need to
re validate the hash value after taking a refcount on socket, and
use likely/unlikely compiler hints, as the sk_hash/hash check
makes the following conditional tests 100% predicted by cpu.

Introduce skc_addrpair/skc_portpair pair values to better
document the alignment requirements of the port/addr pairs
used in the various MATCH() macros, and remove some casts.

The namespace check can also be done at last.

This slightly improves TCP/UDP lookup times.

IP/TCP early demux needs inet->rx_dst_ifindex and
TCP needs inet->min_ttl, lets group them together in same cache line.

With help from Ben Hutchings & Joe Perches.

Idea of this patch came after Ling Ma proposal to move skc_hash
to the beginning of struct sock_common, and should allow him
to submit a final version of his patch. My tests show an improvement
doing so.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Ben Hutchings <bhutchings@solarflare.com>
Cc: Joe Perches <joe@perches.com>
Cc: Ling Ma <ling.ma.program@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-30 15:02:56 -05:00
..
acpi
asm-generic UAPI: Remove empty non-UAPI Kbuild files 2012-10-17 12:31:15 +01:00
clocksource
crypto Merge branch 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux 2012-10-14 13:39:34 -07:00
drm drm/radeon: add new SI pci id 2012-11-21 18:37:38 -05:00
keys
linux net: move inet_dport/inet_num in sock_common 2012-11-30 15:02:56 -05:00
math-emu
media [media] adv7604: Replace prim_mode by mode 2012-11-21 17:43:49 -02:00
memory
misc
net net: move inet_dport/inet_num in sock_common 2012-11-30 15:02:56 -05:00
pcmcia
ras
rdma
rxrpc
scsi [SCSI] sd: Implement support for WRITE SAME 2012-11-13 22:45:42 -08:00
sound ALSA: Add a reference counter to card instance 2012-10-30 11:07:10 +01:00
target
trace Revert "mm: remove __GFP_NO_KSWAPD" 2012-11-26 17:41:24 -08:00
uapi Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem 2012-11-28 10:56:03 -05:00
video fbdev updates for 3.7 2012-10-12 10:21:02 +09:00
xen Bug-fixes: 2012-11-10 06:56:21 +01:00
Kbuild UAPI: Remove empty non-UAPI Kbuild files 2012-10-17 12:31:15 +01:00