* [PATCH] netfilter: bpf: Only define get_proto_defrag_hook() if necessary
@ 2023-07-31 21:55 Daniel Xu
2023-08-01 0:53 ` Alexei Starovoitov
2023-08-01 1:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Daniel Xu @ 2023-07-31 21:55 UTC (permalink / raw)
To: kadlec, davem, pabeni, dxu, ast, edumazet, pablo, kuba, fw
Cc: netfilter-devel, coreteam, netdev, linux-kernel, bpf, kernel test robot
Before, we were getting this warning:
net/netfilter/nf_bpf_link.c:32:1: warning: 'get_proto_defrag_hook' defined but not used [-Wunused-function]
Guard the definition with CONFIG_NF_DEFRAG_IPV[4|6].
Fixes: 91721c2d02d3 ("netfilter: bpf: Support BPF_F_NETFILTER_IP_DEFRAG in netfilter link")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202307291213.fZ0zDmoG-lkp@intel.com/
Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
---
net/netfilter/nf_bpf_link.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/netfilter/nf_bpf_link.c b/net/netfilter/nf_bpf_link.c
index 8fe594bbc7e2..e502ec00b2fe 100644
--- a/net/netfilter/nf_bpf_link.c
+++ b/net/netfilter/nf_bpf_link.c
@@ -28,6 +28,7 @@ struct bpf_nf_link {
const struct nf_defrag_hook *defrag_hook;
};
+#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV4) || IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
static const struct nf_defrag_hook *
get_proto_defrag_hook(struct bpf_nf_link *link,
const struct nf_defrag_hook __rcu *global_hook,
@@ -68,6 +69,7 @@ get_proto_defrag_hook(struct bpf_nf_link *link,
return hook;
}
+#endif
static int bpf_nf_enable_defrag(struct bpf_nf_link *link)
{
--
2.41.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] netfilter: bpf: Only define get_proto_defrag_hook() if necessary
2023-07-31 21:55 [PATCH] netfilter: bpf: Only define get_proto_defrag_hook() if necessary Daniel Xu
@ 2023-08-01 0:53 ` Alexei Starovoitov
2023-08-01 1:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Alexei Starovoitov @ 2023-08-01 0:53 UTC (permalink / raw)
To: Daniel Xu
Cc: Jozsef Kadlecsik, David S. Miller, Paolo Abeni,
Alexei Starovoitov, Eric Dumazet, Pablo Neira Ayuso,
Jakub Kicinski, Florian Westphal, netfilter-devel, coreteam,
Network Development, LKML, bpf, kernel test robot
On Mon, Jul 31, 2023 at 2:55 PM Daniel Xu <dxu@dxuuu.xyz> wrote:
>
> Before, we were getting this warning:
>
> net/netfilter/nf_bpf_link.c:32:1: warning: 'get_proto_defrag_hook' defined but not used [-Wunused-function]
>
> Guard the definition with CONFIG_NF_DEFRAG_IPV[4|6].
>
> Fixes: 91721c2d02d3 ("netfilter: bpf: Support BPF_F_NETFILTER_IP_DEFRAG in netfilter link")
since that commit is in bpf-next only
please use [PATCH bpf-next] in the future to make sure BPF CI can test it.
I've applied it after manual testing, but very much prefer
the automation to do it for me.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] netfilter: bpf: Only define get_proto_defrag_hook() if necessary
2023-07-31 21:55 [PATCH] netfilter: bpf: Only define get_proto_defrag_hook() if necessary Daniel Xu
2023-08-01 0:53 ` Alexei Starovoitov
@ 2023-08-01 1:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-08-01 1:00 UTC (permalink / raw)
To: Daniel Xu
Cc: kadlec, davem, pabeni, ast, edumazet, pablo, kuba, fw,
netfilter-devel, coreteam, netdev, linux-kernel, bpf, lkp
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:
On Mon, 31 Jul 2023 15:55:00 -0600 you wrote:
> Before, we were getting this warning:
>
> net/netfilter/nf_bpf_link.c:32:1: warning: 'get_proto_defrag_hook' defined but not used [-Wunused-function]
>
> Guard the definition with CONFIG_NF_DEFRAG_IPV[4|6].
>
> Fixes: 91721c2d02d3 ("netfilter: bpf: Support BPF_F_NETFILTER_IP_DEFRAG in netfilter link")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202307291213.fZ0zDmoG-lkp@intel.com/
> Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
>
> [...]
Here is the summary with links:
- netfilter: bpf: Only define get_proto_defrag_hook() if necessary
https://git.kernel.org/bpf/bpf-next/c/81584c23f249
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-01 1:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-31 21:55 [PATCH] netfilter: bpf: Only define get_proto_defrag_hook() if necessary Daniel Xu
2023-08-01 0:53 ` Alexei Starovoitov
2023-08-01 1:00 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.