Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp17529771rwd; Tue, 27 Jun 2023 04:28:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6g4ByTGk8p7VuFDFvY9UzNQgfUqMcohJtYxJFi4M+VLKhQKbLBqj59sow619krou4YGE1d X-Received: by 2002:a19:ca4a:0:b0:4f8:7897:55d9 with SMTP id h10-20020a19ca4a000000b004f8789755d9mr12815744lfj.53.1687865323948; Tue, 27 Jun 2023 04:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687865323; cv=none; d=google.com; s=arc-20160816; b=xHalxBfw2hs8JnWIlXMStU3MXB1aLlu9aPMCN1r9rUGJrMuwJ/Ly7JLaIgJgrUyZH/ s7jS9wasy49HkHj3r29++jsi/UzOlk1ESWGJUdLee0wvt/r8U8epe3s4+q2imUQmDjn6 VnEZxhYxMfEF4jSNfGFp7uH3MHvW0iionvPNIIxhq9I3mKBrcOqrxltMHavFkX7EVFUg 9T8Q91FLvRrAFivTJlnrl5DC1roIpJ6gcHGb/0rsA5g124SYfk3KVpREx2zEEO2FA87E O4/rgOa7aRaDjUB02nhzxrZRoGZsmj7992VTrLdU9DWaB2FE6EXSPX0DEQeGDaRajF3B +PDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=9PsLyFV476eu5lZ2OFhykxUQUTJosZM05Yq2B2kQVXA=; fh=Wcf5xrtOiZEJnqJemvgz8xYziw2kVt6gDDJj/Ub8/N4=; b=gLbboXtLUDdQy+1TUkF+rpfB0FvZMiVXzhq6Z/nyqCYMef30yYq/zgXonZjPI/EOhH HSkAKP5esr7r9QB6ZdKH+SkPWYgO2MlSNzcaGRL6VvXWVZYL+nOYgBi4vyy8alLyJwTl 9+8z1TImDXsc8hcN9On95kC/63FG0rzDfdjam+wOesQ5NVS4tihJSrtfLJD855ypVvAZ r4C6KBGt3iON2/jEXtNauD1GdTnRdfgt3HeQm4RRr5c1+Qr0CJ0aDgk+8rIO4kxxmaaF ABEiO2HmjtxI8cmN75nmHB5yG45wJMdFWSlL7EdWIpFM3vvROB4DPuJViDG0zedofgyo FWFw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c20-20020aa7c754000000b0051a2db13ddbsi3901739eds.192.2023.06.27.04.28.19; Tue, 27 Jun 2023 04:28:43 -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; 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 S231523AbjF0LEO (ORCPT + 99 others); Tue, 27 Jun 2023 07:04:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbjF0LEN (ORCPT ); Tue, 27 Jun 2023 07:04:13 -0400 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:237:300::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06EF91BE8; Tue, 27 Jun 2023 04:04:12 -0700 (PDT) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1qE6UK-0003PI-Kq; Tue, 27 Jun 2023 13:04:00 +0200 Date: Tue, 27 Jun 2023 13:04:00 +0200 From: Florian Westphal To: Daniel Xu Cc: edumazet@google.com, dsahern@kernel.org, kuba@kernel.org, fw@strlen.de, pabeni@redhat.com, pablo@netfilter.org, davem@davemloft.net, kadlec@netfilter.org, daniel@iogearbox.net, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH bpf-next 3/7] netfilter: defrag: Add glue hooks for enabling/disabling defrag Message-ID: <20230627110400.GG3207@breakpoint.cc> References: <66d1eaeb17721b1274eb4c1991a3725e47c912c5.1687819413.git.dxu@dxuuu.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <66d1eaeb17721b1274eb4c1991a3725e47c912c5.1687819413.git.dxu@dxuuu.xyz> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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 Daniel Xu wrote: > diff --git a/net/ipv4/netfilter/nf_defrag_ipv4.c b/net/ipv4/netfilter/nf_defrag_ipv4.c > index e61ea428ea18..436e629b0969 100644 > --- a/net/ipv4/netfilter/nf_defrag_ipv4.c > +++ b/net/ipv4/netfilter/nf_defrag_ipv4.c > @@ -7,6 +7,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -113,17 +114,24 @@ static void __net_exit defrag4_net_exit(struct net *net) > } > } > > +static struct nf_defrag_v4_hook defrag_hook = { > + .enable = nf_defrag_ipv4_enable, > + .disable = nf_defrag_ipv4_disable, > +}; Nit: static const, same for v6. > static struct pernet_operations defrag4_net_ops = { > .exit = defrag4_net_exit, > }; > > static int __init nf_defrag_init(void) > { > + rcu_assign_pointer(nf_defrag_v4_hook, &defrag_hook); > return register_pernet_subsys(&defrag4_net_ops); register_pernet failure results in nf_defrag_v4_hook pointing to garbage.