Message ID | b128b6489f0066db32c4772ae4aaee1480495929.1690840454.git.dxu@dxuuu.xyz |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp2319220vqg; Mon, 31 Jul 2023 16:11:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlEj76rD2/Gzpx/oOeyEwY5bp4SYGTi9klfnK+VJX5MAeC81y9NKzfG1DUx3IH9p6ttPNAhU X-Received: by 2002:a17:90b:1c89:b0:263:f590:f231 with SMTP id oo9-20020a17090b1c8900b00263f590f231mr9862399pjb.26.1690845105021; Mon, 31 Jul 2023 16:11:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690845105; cv=none; d=google.com; s=arc-20160816; b=M9B2lq5VOt+WuwbfIdSxOOdvh5+k7rpeeCohSOyROdByyBpSMnEAiP8lAqJ6wL3tC3 VVh5MwHaVjTOae2c6rRU/db+DOwkwG1mNsfGgRxHgibGZSabr0Y5HtF1VW2WB6BfTs/k pdrO3Vt7w3deoUApXo3pGw9/2hCJGa5cbgzsTHRArNz9MUI4tgGPQddUQ/dB+PrrzjLw 4r4J9P1e68j4Yr0ci1byjaf1ZvYuQClDQPpua9FtKvpMX7vNh6z+svDQJPusuk+T7a4H SqhEydpxoPwdAjM1lIVTrVYp+pztsMZA3Z4Q85NK+ClNMaVgX21r3vpVJ97KS7vUduL5 eL2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:feedback-id:dkim-signature :dkim-signature; bh=r3NTgG4qLC9ZQhYXCs1UXPjCX4mwEQOdjG4bzdifxkI=; fh=mlUlAg4LX8l3BlPnu2Tt9s+AiVRMQWybU6F1WHy9RcM=; b=psenk9BRuoxe8gl+7zoAijatV4JkEJac5TJdkO2j19UO8k0UVxOSp92jYhI971D46U VeznrroGyh4UBGin/bFLGvxojxu/PLVgBSGT+XX5czZXaasg1mM3DaJgVpdWlf3SYhVV 0wT8mHopJjOgh08dGaK0JRrfHVNyXCOnGHe8ZR35YiOVRZNHuj3CA5OTgQbpPJ4iXYRR +SWrmxAc6NN/q+UK22DELN8BLilXRID7fLmCs0H3W5R4RTqF9A3OH0/vc6LOPF7VXXIL u4QEcqSwh8XCW2E9rnEVRMjqwSUYgCiEfe5Pm0l/tQe/rryUUBIpp+gIs+wQ7IAqBx/U HiEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm2 header.b=vZylnhrk; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=dNQcqzLX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i8-20020a17090a4b8800b0025e7ff46234si9619892pjh.57.2023.07.31.16.11.31; Mon, 31 Jul 2023 16:11:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm2 header.b=vZylnhrk; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=dNQcqzLX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231638AbjGaVzp (ORCPT <rfc822;dengxinlin2429@gmail.com> + 99 others); Mon, 31 Jul 2023 17:55:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231745AbjGaVzh (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 31 Jul 2023 17:55:37 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6FFD1FF0; Mon, 31 Jul 2023 14:55:28 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id D9D515C019E; Mon, 31 Jul 2023 17:55:25 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 31 Jul 2023 17:55:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm2; t=1690840525; x=1690926925; bh=r3NTgG4qLC 9ZQhYXCs1UXPjCX4mwEQOdjG4bzdifxkI=; b=vZylnhrkSW7MBNL5YAgTv8djUG eySXV57dXy3KGxs0C8lSaKf0v5rs+upnskhR4UugPFDd/W+bbDyTeQShUAtOSHdE FljVCmrDRsw0+IOasPj44TCglOZ9puA8wEa7tTGeEhYnhuEZvhZhO7s5y3YNmbui f/4OcLGnD/7UX0+qb/RTsQR72lLyOhwcHRUfsHuUREu0Cl9u/xmxfSfVe7oTH0tV vfi4ZpIKRpLY8o/Oz4Bmuy761Haq+bE9/y1wXy/jJz6L1HrPnHDATfWUtY+HzKx4 GrrKI7QlGp3Dv5YyKqO8C4Mv4o/FVsCAULc+OAuCvFgbI3wesULxHyBs/dpg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1690840525; x=1690926925; bh=r3NTgG4qLC9ZQ hYXCs1UXPjCX4mwEQOdjG4bzdifxkI=; b=dNQcqzLXz1LBlJZBUinplkmVHEYaC ssgVLtML0avz4wnTdONP2fhO/yK9kgveKbr4UW7zU9NVsFOjRGTWpj29lWMdgZpC 2SSWPNoL3n44oIZG2duAeUpbRnDArEllrLsmZQXZ98AzaCv0hAOqeuAXL6GJsSZS MN3uubIVLporrz3mz4jIClUzXo/PSatE8OVgtxEYx38j0zCT7IRTzE+UeLyf/XJQ zLcWq6S8sVjQNxyfgVW/OWb4ubpKKCIZxYEKOS+4hjvb65SBxOvAPn2hc90n2xDC qvZABoJcR8vmyRhbs+ySwLx9pzxTtUKkD6EXBt6t6kVh2D2ZaKVZZv52w== X-ME-Sender: <xms:zS3IZLWjb92NwR5GZ8puc815lBR224UFEow8unK-5X6X5EhqFdV9Vw> <xme:zS3IZDlub75xmfd-BONhJojF66BrHlPRXiZKAyNU7Ef7advln21kDEejf1Kx8b03X sO-7OyXtIG4ldByOQ> X-ME-Received: <xmr:zS3IZHZ8ZTQdabAjdXdWHV6x7Z8zLiSwFezT1fkrDyu_-oL0zpOX5Yp5-FRHcZUdXdSxh6KIqTPZYba2Z30mHZ2j9dCKkrEBXqrdFxi59W4gGg> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrjeehgddtfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecufghrlhcuvffnffculddvfedmnecujfgurhephffvve fufffkofgggfestdekredtredttdenucfhrhhomhepffgrnhhivghlucgiuhcuoegugihu segugihuuhhurdighiiiqeenucggtffrrghtthgvrhhnpeetueektdeuhfefvefggfevge ffgfekfefhkeekteffheevtddvhedukeehffeltdenucffohhmrghinhepkhgvrhhnvghl rdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epugiguhesugiguhhuuhdrgiihii X-ME-Proxy: <xmx:zS3IZGVus9IQwwMDzSpZik9RMZ5Cy8R-7SKBaFWNaXNj_zjlBjBpGA> <xmx:zS3IZFmD9IIr6YS-Otm5u3Is1JCUlsVYIBQgwr050KyB-lfPJ4CFCw> <xmx:zS3IZDd_EDViJFvd6Xp3HvLs0-ySSXL_5WwHBi_sWvPaoBcpWg0H1g> <xmx:zS3IZHlmPvQR-H5ide7b-Z0EHJ18dXzLCM5hvZQg12QUKeDBogIEwQ> Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 31 Jul 2023 17:55:24 -0400 (EDT) From: Daniel Xu <dxu@dxuuu.xyz> To: kadlec@netfilter.org, davem@davemloft.net, pabeni@redhat.com, dxu@dxuuu.xyz, ast@kernel.org, edumazet@google.com, pablo@netfilter.org, kuba@kernel.org, fw@strlen.de Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, kernel test robot <lkp@intel.com> Subject: [PATCH] netfilter: bpf: Only define get_proto_defrag_hook() if necessary Date: Mon, 31 Jul 2023 15:55:00 -0600 Message-ID: <b128b6489f0066db32c4772ae4aaee1480495929.1690840454.git.dxu@dxuuu.xyz> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772979596554536387 X-GMAIL-MSGID: 1772979596554536387 |
Series |
netfilter: bpf: Only define get_proto_defrag_hook() if necessary
|
|
Commit Message
Daniel Xu
July 31, 2023, 9:55 p.m. UTC
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(+)
Comments
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.
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!
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) {