From patchwork Mon Jul 31 21:55:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 128893 Return-Path: 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 + 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 ); 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: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrjeehgddtfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecufghrlhcuvffnffculddvfedmnecujfgurhephffvve fufffkofgggfestdekredtredttdenucfhrhhomhepffgrnhhivghlucgiuhcuoegugihu segugihuuhhurdighiiiqeenucggtffrrghtthgvrhhnpeetueektdeuhfefvefggfevge ffgfekfefhkeekteffheevtddvhedukeehffeltdenucffohhmrghinhepkhgvrhhnvghl rdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 31 Jul 2023 17:55:24 -0400 (EDT) From: Daniel Xu 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 Subject: [PATCH] netfilter: bpf: Only define get_proto_defrag_hook() if necessary Date: Mon, 31 Jul 2023 15:55:00 -0600 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772979596554536387 X-GMAIL-MSGID: 1772979596554536387 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 Closes: https://lore.kernel.org/oe-kbuild-all/202307291213.fZ0zDmoG-lkp@intel.com/ Signed-off-by: Daniel Xu --- 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) {