[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <82c74693-db42-2491-868e-b6cb1cead4ec@linux.alibaba.com>
Date: Mon, 18 Dec 2023 11:06:56 +0800
From: "D. Wythe" <alibuda@...ux.alibaba.com>
To: Florian Westphal <fw@...len.de>
Cc: pablo@...filter.org, kadlec@...filter.org, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
coreteam@...filter.org, netfilter-devel@...r.kernel.org,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, ast@...nel.org
Subject: Re: [RFC nf-next v1 1/2] netfilter: bpf: support prog update
On 12/15/23 10:17 PM, Florian Westphal wrote:
> D. Wythe <alibuda@...ux.alibaba.com> wrote:
>> const struct nf_defrag_hook *defrag_hook;
>> + const struct bpf_prog __rcu *nf_prog;
> Hmm, why do we need this pointer?
> Can't you just re-use bpf_nf_link->link.prog?
Accessing nf_link->link.prog directly is a bit strange because it is not
marked as __rcu, which will generate a compilation warning,
thus we need to perform a type conversion.
But I do not intend to insist on it. I will remove it in the next version.
Best wishes,
D. Wythe
>
>> + rcu_assign_pointer(nf_link->nf_prog, new_prog);
>> + old_prog = xchg(&link->prog, new_prog);
> This looks redundant, I think you can remove the nf_prog
> pointer again.
>
> Rest LGTM.
Powered by blists - more mailing lists