kernel_optimize_test/include/net
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
..
9p
bluetooth Bluetooth: Increase HCI command tx timeout 2012-11-19 19:54:38 -02:00
caif
irda
iucv
netfilter
netns sctp: Make hmac algorithm selection for cookie generation dynamic 2012-10-26 02:22:18 -04:00
nfc NFC: Export nfc_hci_sak_to_protocol() 2012-11-19 23:56:59 +01:00
phonet
sctp sctp: send abort chunk when max_retrans exceeded 2012-11-20 15:50:37 -05:00
tc_act
act_api.h
addrconf.h
af_ieee802154.h
af_rxrpc.h
af_unix.h unix: Remove unused field from unix_sock 2012-10-21 20:37:06 -04:00
ah.h
arp.h
atmclip.h
ax25.h
ax88796.h
cfg80211-wext.h
cfg80211.h nl80211/cfg80211: add VHT MCS support 2012-11-26 12:42:59 +01:00
checksum.h
cipso_ipv4.h
cls_cgroup.h net: Update args to dummy sock_update_classid(). 2012-10-26 05:07:00 -04:00
codel.h
compat.h
datalink.h
dcbevent.h
dcbnl.h
dn_dev.h
dn_fib.h
dn_neigh.h
dn_nsp.h
dn_route.h
dn.h
dsa.h
dsfield.h
dst_ops.h
dst.h
esp.h
ethoc.h
fib_rules.h
flow_keys.h
flow.h ipv4: Add FLOWI_FLAG_KNOWN_NH 2012-10-08 17:42:36 -04:00
garp.h
gen_stats.h
genetlink.h
gre.h
gro_cells.h
icmp.h
ieee80211_radiotap.h
ieee802154_netdev.h
ieee802154.h
if_inet6.h
inet_common.h
inet_connection_sock.h
inet_ecn.h
inet_frag.h
inet_hashtables.h net: move inet_dport/inet_num in sock_common 2012-11-30 15:02:56 -05:00
inet_sock.h net: move inet_dport/inet_num in sock_common 2012-11-30 15:02:56 -05:00
inet_timewait_sock.h net: move inet_dport/inet_num in sock_common 2012-11-30 15:02:56 -05:00
inet6_connection_sock.h
inet6_hashtables.h
inetpeer.h
ip_fib.h
ip_vs.h ipvs: fix build errors related to config option combinations 2012-10-23 09:23:40 +09:00
ip.h
ip6_checksum.h ipv6: Separate tcp offload functionality 2012-11-15 17:36:18 -05:00
ip6_fib.h ipv6: remove rt6i_peer_genid from rt6_info and its handler 2012-11-08 21:16:08 -05:00
ip6_route.h ipv6: export IP6_RT_PRIO_* to userland 2012-11-16 01:47:40 -05:00
ip6_tunnel.h
ipcomp.h
ipconfig.h
ipip.h net: convert __IPTUNNEL_XMIT() to an inline function 2012-11-14 18:49:50 -05:00
ipv6.h ipv6: improve ipv6_find_hdr() to skip empty routing headers 2012-11-12 12:31:37 -08:00
ipx.h
iw_handler.h
lapb.h
lib80211.h
llc_c_ac.h
llc_c_ev.h
llc_c_st.h
llc_conn.h
llc_if.h
llc_pdu.h
llc_s_ac.h
llc_s_ev.h
llc_s_st.h
llc_sap.h
llc.h
mac80211.h mac80211: support VHT rates in TX info 2012-11-26 12:43:00 +01:00
mac802154.h
mip6.h
mld.h
ndisc.h
neighbour.h
net_namespace.h userns: make each net (net_ns) belong to a user_ns 2012-11-18 20:30:55 -05:00
net_ratelimit.h
netdma.h
netevent.h
netlabel.h
netlink.h
netprio_cgroup.h
netrom.h
nexthop.h
nl802154.h
p8022.h
ping.h
pkt_cls.h
pkt_sched.h
protocol.h net: Remove code duplication between offload structures 2012-11-15 17:39:51 -05:00
psnap.h
raw.h
rawv6.h
red.h
regulatory.h
request_sock.h tcp: better retrans tracking for defer-accept 2012-11-03 14:45:00 -04:00
rose.h
route.h ipv4: avoid a test in ip_rt_put() 2012-11-03 14:59:04 -04:00
rtnetlink.h rtnelink: remove unused parameter from rtnl_create_link(). 2012-11-30 12:24:40 -05:00
sch_generic.h
scm.h
secure_seq.h
slhc_vj.h
snmp.h
sock.h net: move inet_dport/inet_num in sock_common 2012-11-30 15:02:56 -05:00
stp.h
tcp_memcontrol.h
tcp_states.h
tcp.h tcp: remove dead prototype for tcp_v4_get_peer() 2012-11-23 14:10:31 -05:00
timewait_sock.h
transp_v6.h
udp.h
udplite.h
wext.h
wimax.h
wpan-phy.h
x25.h
x25device.h
xfrm.h xfrm: Fix the gc threshold value for ipv4 2012-11-13 09:15:07 +01:00