Thread (16 messages) 16 messages, 4 authors, 2025-08-22

Re: [PATCH net-next 5/6] netfilter: nft_set_pipapo: Store real pointer, adjust later.

From: Stefano Brivio <hidden>
Date: 2025-08-20 15:44:07
Also in: netfilter-devel

On Wed, 20 Aug 2025 16:47:37 +0200
Florian Westphal [off-list ref] wrote:
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

The struct nft_pipapo_scratch is allocated, then aligned to the required
alignment and difference (in bytes) is then saved in align_off. The
aligned pointer is used later.
While this works, it gets complicated with all the extra checks if
all member before map are larger than the required alignment.

Instead of saving the aligned pointer, just save the returned pointer
and align the map pointer in nft_pipapo_lookup() before using it. The
alignment later on shouldn't be that expensive.
The cost of doing the alignment later was the very reason why I added
this whole dance in the first place though. Did you check packet
matching rates before and after this?

-- 
Stefano
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help