]> www.infradead.org Git - users/dwmw2/linux.git/commit
net/udp: Add a new struct for hash2 slot
authorPhilo Lu <lulie@linux.alibaba.com>
Thu, 14 Nov 2024 10:52:04 +0000 (18:52 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Nov 2024 11:56:21 +0000 (11:56 +0000)
commitaccdd51dc74ff65b7b7be1961b11723d228fbbbd
treeec6b59ab902c8b0f91979c2896d38ce85a7e329b
parent296a681def3e105f8535c8b3cb0f37f22f710e62
net/udp: Add a new struct for hash2 slot

Preparing for udp 4-tuple hash (uhash4 for short).

To implement uhash4 without cache line missing when lookup, hslot2 is
used to record the number of hashed sockets in hslot4. Thus adding a new
struct udp_hslot_main with field hash4_cnt, which is used by hash2. The
new struct is used to avoid doubling the size of udp_hslot.

Before uhash4 lookup, firstly checking hash4_cnt to see if there are
hashed sks in hslot4. Because hslot2 is always used in lookup, there is
no cache line miss.

Related helpers are updated, and use the helpers as possible.

uhash4 is implemented in following patches.

Signed-off-by: Philo Lu <lulie@linux.alibaba.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/udp.h
net/ipv4/udp.c
net/ipv6/udp.c