D. Wythe <alibuda@xxxxxxxxxxxxxxxxx> wrote:Accessing nf_link->link.prog directly is a bit strange because it is not marked as __rcu, which will generate a compilation warning,
const struct nf_defrag_hook *defrag_hook;Hmm, why do we need this pointer?
+ const struct bpf_prog __rcu *nf_prog;
Can't you just re-use bpf_nf_link->link.prog?
+ rcu_assign_pointer(nf_link->nf_prog, new_prog);This looks redundant, I think you can remove the nf_prog
+ old_prog = xchg(&link->prog, new_prog);
pointer again.
Rest LGTM.