[prev in list] [next in list] [prev in thread] [next in thread] 

List:       netfilter-devel
Subject:    Re: [PATCH nf-next v2 4/8] netfilter: nft_set_pipapo: prepare walk function for on-demand clone
From:       Stefano Brivio <sbrivio () redhat ! com>
Date:       2024-04-26 5:44:24
Message-ID: 20240426074424.670803cf () elisabeth
[Download RAW message or body]

On Thu, 25 Apr 2024 14:06:43 +0200
Florian Westphal <fw@strlen.de> wrote:

> The existing code uses iter->type to figure out what data is needed, the
> live copy (READ) or clone (UPDATE).
> 
> Without pending updates, priv->clone and priv->match will point to
> different memory locations, but they have identical content.
> 
> Future patch will make priv->clone == NULL if there are no pending changes,
> in this case we must copy the live data for the UPDATE case.
> 
> Currently this would require GFP_ATOMIC allocation.  Split the walk
> function in two parts: one that does the walk and one that decides which
> data is needed.
> 
> In the UPDATE case, callers hold the transaction mutex so we do not need
> the rcu read lock.  This allows to use GFP_KERNEL allocation while
> cloning.
> 
> Signed-off-by: Florian Westphal <fw@strlen.de>

Reviewed-by: Stefano Brivio <sbrivio@redhat.com>

-- 
Stefano


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic