From: Simon Horman <horms@kernel.org>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Neal Cardwell <ncardwell@google.com>,
Kuniyuki Iwashima <kuniyu@google.com>,
netdev@vger.kernel.org, eric.dumazet@gmail.com
Subject: Re: [PATCH v2 net-next] tcp: improve inet6_ehashfn() entropy
Date: Sun, 15 Mar 2026 16:44:43 +0000 [thread overview]
Message-ID: <20260315164443.GB1369074@kernel.org> (raw)
In-Reply-To: <20260313120346.3378811-1-edumazet@google.com>
On Fri, Mar 13, 2026 at 12:03:46PM +0000, Eric Dumazet wrote:
> Instead of only using the 32 low order bits of the local address,
> use all of them.
>
> Xor net_hash_mix(net) with the 32 high order bits of the local address
> so that we can use __jhash_mix() three times.
>
> If we were hashing 4 extra bytes, we would need one __jhash_final()
> which is a bit expensive.
>
> Using net_hash_mix() at the beginning allows beter register allocation.
>
> We no longer use a cascade of two jhash and inet6_ehash_secret,
> this was dubious/weak.
>
> Add a comment explaining why @lport is not part of the jhash computation.
>
> $ scripts/bloat-o-meter -t vmlinux.0 vmlinux.1
> add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-24 (-24)
> Function old new delta
> inet6_ehashfn 330 306 -24
> Total: Before=24855958, After=24855934, chg -0.00%
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
> v2: do not include @lport in the jhash computation.
> Add a comment explaining why we need @lport being added.
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2026-03-15 16:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-13 12:03 [PATCH v2 net-next] tcp: improve inet6_ehashfn() entropy Eric Dumazet
2026-03-15 16:44 ` Simon Horman [this message]
2026-03-16 1:18 ` Kuniyuki Iwashima
2026-03-17 2:40 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260315164443.GB1369074@kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox