From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, sbrivio@redhat.com
Subject: Re: [PATCH nf-next 1/3] netfilter: nf_set_pipapo_avx2: fix initial map fill
Date: Fri, 30 May 2025 12:26:02 +0200 [thread overview]
Message-ID: <aDmHujriOCTXAVgb@strlen.de> (raw)
In-Reply-To: <aDlM5DVjAc02aIwd@calendula>
Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > + /* Starting map doesn't need to be set to all-ones for this implementation,
> > + * but we do need to zero the remaining bits, if any.
> > + */
> > + for (i = f->bsize; i < m->bsize_max; i++)
> > + res_map[i] = 0ul;
> > +}
> > +
> > /**
> > * nft_pipapo_avx2_lookup() - Lookup function for AVX2 implementation
> > * @net: Network namespace
> > @@ -1171,7 +1190,7 @@ bool nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set,
> > res = scratch->map + (map_index ? m->bsize_max : 0);
> > fill = scratch->map + (map_index ? 0 : m->bsize_max);
> >
> > - /* Starting map doesn't need to be set for this implementation */
> > + pipapo_resmap_init_avx2(m, res);
>
> nitpick:
>
> nft_pipapo_avx2_lookup_slow() calls pipapo_resmap_init() for
> non-optimized fields, eg. 8 bytes, which is unlikely to be seen.
> IIUC this resets it again.
Yes. We have no test case for this function.
Can you come up with an example that would exercise this function?
It would be good to cover it in selftests.
> Maybe revisit this in nf-next? Would be worth to cover this avx2 path
> with 8 bytes in tests?
Not sure its worth it. pipapo_resmap_init_avx2(), in most cases, is
a no-op as usually m->bsize_max is the same as f->bsize.
But yes, we could add yet another version of pipapo_resmap_init()
that only has the one-fill part.
next prev parent reply other threads:[~2025-05-30 10:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-23 12:20 [PATCH nf-next 0/3] netfilter: nf_set_pipapo_avx2: fix initial map fill Florian Westphal
2025-05-23 12:20 ` [PATCH nf-next 1/3] " Florian Westphal
2025-05-30 6:15 ` Pablo Neira Ayuso
2025-05-30 10:26 ` Florian Westphal [this message]
2025-05-23 12:20 ` [PATCH nf-next 2/3] selftests: netfilter: nft_concat_range.sh: prefer per element counters for testing Florian Westphal
2025-05-23 12:20 ` [PATCH nf-next 3/3] selftests: netfilter: nft_concat_range.sh: add datapath check for map fill bug Florian Westphal
2025-05-26 12:14 ` [PATCH nf-next 0/3] netfilter: nf_set_pipapo_avx2: fix initial map fill Stefano Brivio
2025-05-26 14:14 ` Florian Westphal
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=aDmHujriOCTXAVgb@strlen.de \
--to=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=sbrivio@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.