Skip to contentSkip to conversation

netfilter: nf_flow_table_bpf: add prototype for bpf_xdp_flow_lookup()

PATCH In review Sun Jian 2 participants 2 messages Jan 19

Subsystems (4)
lore
Share & tools
lore

Sun Jian

author
#0 lore raw

PATCH 1/1 netfilter: nf_flow_table_bpf: add prototype for bpf_xdp_flow_lookup()

Sparse reports:

netfilter/nf_flow_table_bpf.c:58:45:
symbol 'bpf_xdp_flow_lookup' was not declared. Should it be static?

bpf_xdp_flow_lookup() is exported as a __bpf_kfunc and must remain non-static. Add a forward declaration to provide an explicit prototype , only to silence the sparse warning.

No functional change intended.

---
 net/netfilter/nf_flow_table_bpf.c | 3 +++
 1 file changed, 3 insertions(+)
net/netfilter/nf_flow_table_bpf.c +3 -0
index 4a5f5195f2d2..a129e0ee5e81 100644
@@ -31,6 +31,9 @@ __diag_ignore_all("-Wmissing-prototypes",
 		  "Global functions as their definitions will be in nf_flow_table BTF");
 
 __bpf_kfunc_start_defs();
+__bpf_kfunc struct flow_offload_tuple_rhash *
+bpf_xdp_flow_lookup(struct xdp_md *ctx, struct bpf_fib_lookup *fib_tuple,
+		    struct bpf_flowtable_opts *opts, u32 opts_len);
 
 static struct flow_offload_tuple_rhash *
 bpf_xdp_flow_tuple_lookup(struct net_device *dev,
Signature · 1 line
2.43.0
#1 lore raw
Quoted 9 lines · Sun Jian

Sparse reports:

netfilter/nf_flow_table_bpf.c:58:45:
symbol 'bpf_xdp_flow_lookup' was not declared. Should it be static?

bpf_xdp_flow_lookup() is exported as a __bpf_kfunc and must remain non-static. Add a forward declaration to provide an explicit prototype , only to silence the sparse warning.

No. Ignore the warning. Sparse is incorrect.
We have hundreds of such bogus warnings. Do NOT attempt to send more patches to "fix" them.

pw-bot: cr