From: Mykyta Yatsenko <mykyta.yatsenko5@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
bpf@vger.kernel.org, andrii@kernel.org, daniel@iogearbox.net,
kernel-team@meta.com, eddyz87@gmail.com, memxor@gmail.com
Cc: Mykyta Yatsenko <yatsenko@meta.com>
Subject: Re: [PATCH bpf-next] bpf: Speed up htab hashing for u32/u64 keys
Date: Mon, 21 Sep 2026 18:10:24 +0100 [thread overview]
Message-ID: <372f09a9-8c1c-4af5-86a6-e286cce8af8b@gmail.com> (raw)
In-Reply-To: <DLL5LJUBBBNP.K6GOQ6AV8OU0@gmail.com>
On 9/21/26 6:00 PM, Alexei Starovoitov wrote:
> On Mon Sep 21, 2026 at 3:43 PM UTC, Alexei Starovoitov wrote:
>>> static inline u32 htab_map_hash(const void *key, u32 key_len, u32 hashrnd)
>>> {
>>> - if (likely(key_len % 4 == 0))
>>> + const u32 *k = key;
>>> + u32 b;
>>> +
>>> + if (key_len == sizeof(u32))
>>> + b = 0;
>>> + else if (key_len == sizeof(u64))
>>> + b = k[1];
>>> + else if (likely(key_len % 4 == 0))
>>> return jhash2(key, key_len / 4, hashrnd);
>
> Nice improvement, but key_size is known at verification time.
> Let's do a step further and specialize htab_map_gen_lookup
> for small key sizes?
>
Sure, let me try that.
prev parent reply other threads:[~2026-09-21 17:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 15:28 [PATCH bpf-next] bpf: Speed up htab hashing for u32/u64 keys Mykyta Yatsenko
2026-09-21 16:45 ` Anton Protopopov
[not found] ` <179000542526.3934731.994864591824564797@gmail.com>
2026-09-21 17:00 ` Alexei Starovoitov
2026-09-21 17:10 ` Mykyta Yatsenko [this message]
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=372f09a9-8c1c-4af5-86a6-e286cce8af8b@gmail.com \
--to=mykyta.yatsenko5@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=kernel-team@meta.com \
--cc=memxor@gmail.com \
--cc=yatsenko@meta.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