Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp714507rdf; Tue, 21 Nov 2023 14:38:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHnecHmduTr1UqBiMca1paLi6AVBwGnGkMRPBWrj2q8Z7eQ+lKB90x1kpiqsPGocG8E41/V X-Received: by 2002:a17:903:1207:b0:1ce:5f67:cfd3 with SMTP id l7-20020a170903120700b001ce5f67cfd3mr665095plh.18.1700606287233; Tue, 21 Nov 2023 14:38:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700606287; cv=none; d=google.com; s=arc-20160816; b=bLh7Yyxk6Oj/fbO4ns3DgvUJjsgc7vwDLUeyMJCS674iWCpmK9ZL/FEEhiQJZDDZpE 53CGn9V63u3EWNxl6ThQlbQ5bxomhXoa+WHmRitSyrpWg+/gzpZhy3pMg4Q8Wd1/cauv zhNMHDfUCV2HRCnVUqnYh+3n7ySDFEfEljirchgaS6gZPb7RiiA15peQkEz+Do6qY/mB 1p8s/2SBisNlngzUtDDPmLaTGFWEtzAo/Yg10tXRDbe6PZpKIvKNNV2PYZNhh8MVxuw8 Pbq5/KS2PQ1UVtXGnpKoz02/ERl/z8cepOtxOmyBaJGKfH0v9m321Cord/C6vCfCmEbD sStA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=5PhJ58DzGJEIVblaXAuceHul3/IImKCshOtqF3D3RDY=; fh=v6ryHXi7Ud42BuU8uY8K8GLJJlx+87/uQB+BN/cYG0A=; b=Vsn6W/b4EUVo8rBijmtM1+vTo+F/8Chndu631YVH9TBMRI4QB6BnIFfUZY+K9SHe11 Ed4KIUWyL533STtgyyC4VBiXr/parTQQe2k6cKIbVeo+Joroa/D7/GIguY3DEfV2oxIH vCD4zjdwxuWrvTWHBD1HshWvE/1X/sM7V/CRfFTnq/gu/hRO62zvNmbXj08+87HflCgb jHQnWJRNXg6ZcxO8nii7aAEAIY8s3HuN4gcL/vJD7wGKoqdddgQsMmrNQ4gaV3ZZYMqq zhM0i2lGTc44oC1V2vy/oXsGCWwBtGhbXvyWrMeUfBX6jZ+P60r979nvjwATUMFVicAl VWbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mojatatu-com.20230601.gappssmtp.com header.s=20230601 header.b=G3pUW2bX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id bj12-20020a170902850c00b001c9ad94f614si10792795plb.244.2023.11.21.14.38.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 14:38:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@mojatatu-com.20230601.gappssmtp.com header.s=20230601 header.b=G3pUW2bX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 63996801CB42; Tue, 21 Nov 2023 14:38:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234494AbjKUWh4 (ORCPT + 99 others); Tue, 21 Nov 2023 17:37:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbjKUWhz (ORCPT ); Tue, 21 Nov 2023 17:37:55 -0500 Received: from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com [IPv6:2607:f8b0:4864:20::1131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F21C51AC for ; Tue, 21 Nov 2023 14:37:49 -0800 (PST) Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-5caa401f151so25116427b3.0 for ; Tue, 21 Nov 2023 14:37:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20230601.gappssmtp.com; s=20230601; t=1700606269; x=1701211069; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=5PhJ58DzGJEIVblaXAuceHul3/IImKCshOtqF3D3RDY=; b=G3pUW2bX8byqs35VWE2lNPVsBNcPlbaF5SlaScwyUrgiZSZs00xuRH+KAE+IEGFSEO iaMKubjto92VurzGn40vzoGHqbMnAyi1IEwwVT+TliIjIy9E+xnQhspWx1eYKR/PeMAX TDxIZpd6DUjkgW9Qgw/6ArBgbb7TlH7qK1AJoCjPXtW8BPEC4kXgSdVYK9KNSkJ/pPcQ 4qixQneYFUV3fi5ukpH67Z0q/RN//VSyXW3MEgEz1xm8cgclFNDGHfccsjodCS8N9prM HWggSM4a45AxHT1/SM71jHFD2ku1cx41ruYKSRey7XXkvqxADsYeb7lOtMCs+VK9dQDy AfCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700606269; x=1701211069; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5PhJ58DzGJEIVblaXAuceHul3/IImKCshOtqF3D3RDY=; b=FevycA4US1noCZnI+ri9+/9fM97zsD35YhK3o35L0bl5jwBcMjXB8FlEFDabGP7zjR TP6G4ur2DVyMU9bm8UKsPg0YoH/dsChYidV2piy47axdWcuYaT/HwHaLHPvDWA/9ANa0 Bgo4j1Ay4NxJsY1XtCia4BjsatNdH4SVySa9kWw1VVPg+mBcRlWjCL34iaUFieiFboU5 D/uVgR7i7epomBoCiaOig921S2O8NTPkwFVUoi2hcv4h4yqYavPWcNB4ugVqsRgIDYXz g6U3Y5WYbrIOLM37jvnDrIFQTb5NxlYuFahklQ2MMyRiA3Chcus2AYD2Wnvv1NpZSz01 dC/w== X-Gm-Message-State: AOJu0YwRYWRm8llNgDs3dw34ZbDCuedBnCcTgVRK+sEMEIj+LGUWRwVr frfmgouqEJfLJWkInw4WHQhQttgMGnK6gZOV/dFnHQ== X-Received: by 2002:a81:5b06:0:b0:5bf:f907:e07c with SMTP id p6-20020a815b06000000b005bff907e07cmr437425ywb.33.1700606269085; Tue, 21 Nov 2023 14:37:49 -0800 (PST) MIME-Version: 1.0 References: <20231121175640.9981-1-mkoutny@suse.com> In-Reply-To: <20231121175640.9981-1-mkoutny@suse.com> From: Jamal Hadi Salim Date: Tue, 21 Nov 2023 17:37:37 -0500 Message-ID: Subject: Re: [PATCH] net/sched: cls: Load net classifier modules via alias To: =?UTF-8?Q?Michal_Koutn=C3=BD?= Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Cong Wang , Jiri Pirko , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Petr Pavlu , Michal Kubecek , Martin Wilck Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 21 Nov 2023 14:38:04 -0800 (PST) On Tue, Nov 21, 2023 at 12:56=E2=80=AFPM Michal Koutn=C3=BD wrote: > > The classifier modules may be loaded lazily without user's awareness and > control. Add respective aliases to modules and request them under these > aliases so that modprobe's blacklisting mechanism works also for > classifier modules. (The same pattern exists e.g. for filesystem > modules.) > Hi Michal, Dumb question: What's speacial about the "tcf- '' that makes it work better for filtering than existing "cls_" prefix? What about actions (prefix "act_") etc? cheers, jamal > Original module names remain unchanged. > > Signed-off-by: Michal Koutn=C3=BD > --- > include/net/pkt_cls.h | 1 + > net/sched/cls_api.c | 2 +- > net/sched/cls_basic.c | 1 + > net/sched/cls_bpf.c | 1 + > net/sched/cls_cgroup.c | 1 + > net/sched/cls_flow.c | 1 + > net/sched/cls_flower.c | 1 + > net/sched/cls_fw.c | 1 + > net/sched/cls_matchall.c | 1 + > net/sched/cls_route.c | 1 + > net/sched/cls_u32.c | 1 + > 11 files changed, 11 insertions(+), 1 deletion(-) > > This is primarily for TC subsystem maintainers where the > request_module() resides but Cc list is large because of touches in > various classifier modules. > > diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h > index a76c9171db0e..424b4f889feb 100644 > --- a/include/net/pkt_cls.h > +++ b/include/net/pkt_cls.h > @@ -24,6 +24,7 @@ struct tcf_walker { > > int register_tcf_proto_ops(struct tcf_proto_ops *ops); > void unregister_tcf_proto_ops(struct tcf_proto_ops *ops); > +#define MODULE_ALIAS_TCF(kind) MODULE_ALIAS("tcf-" __stringify(kind)) > > struct tcf_block_ext_info { > enum flow_block_binder_type binder_type; > diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c > index 1976bd163986..02fdcceee083 100644 > --- a/net/sched/cls_api.c > +++ b/net/sched/cls_api.c > @@ -257,7 +257,7 @@ tcf_proto_lookup_ops(const char *kind, bool rtnl_held= , > #ifdef CONFIG_MODULES > if (rtnl_held) > rtnl_unlock(); > - request_module("cls_%s", kind); > + request_module("tcf-%s", kind); > if (rtnl_held) > rtnl_lock(); > ops =3D __tcf_proto_lookup_ops(kind); > diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c > index a1f56931330c..a3500ac7fc1a 100644 > --- a/net/sched/cls_basic.c > +++ b/net/sched/cls_basic.c > @@ -328,6 +328,7 @@ static struct tcf_proto_ops cls_basic_ops __read_most= ly =3D { > .bind_class =3D basic_bind_class, > .owner =3D THIS_MODULE, > }; > +MODULE_ALIAS_TCF("basic"); > > static int __init init_basic(void) > { > diff --git a/net/sched/cls_bpf.c b/net/sched/cls_bpf.c > index 382c7a71f81f..8d57ac155c0c 100644 > --- a/net/sched/cls_bpf.c > +++ b/net/sched/cls_bpf.c > @@ -693,6 +693,7 @@ static struct tcf_proto_ops cls_bpf_ops __read_mostly= =3D { > .dump =3D cls_bpf_dump, > .bind_class =3D cls_bpf_bind_class, > }; > +MODULE_ALIAS_TCF("bpf"); > > static int __init cls_bpf_init_mod(void) > { > diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c > index 7ee8dbf49ed0..0ded7d79894c 100644 > --- a/net/sched/cls_cgroup.c > +++ b/net/sched/cls_cgroup.c > @@ -209,6 +209,7 @@ static struct tcf_proto_ops cls_cgroup_ops __read_mos= tly =3D { > .dump =3D cls_cgroup_dump, > .owner =3D THIS_MODULE, > }; > +MODULE_ALIAS_TCF("cgroup"); > > static int __init init_cgroup_cls(void) > { > diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c > index 6ab317b48d6c..2806aa1254e1 100644 > --- a/net/sched/cls_flow.c > +++ b/net/sched/cls_flow.c > @@ -702,6 +702,7 @@ static struct tcf_proto_ops cls_flow_ops __read_mostl= y =3D { > .walk =3D flow_walk, > .owner =3D THIS_MODULE, > }; > +MODULE_ALIAS_TCF("flow"); > > static int __init cls_flow_init(void) > { > diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c > index e5314a31f75a..739e09e0fa57 100644 > --- a/net/sched/cls_flower.c > +++ b/net/sched/cls_flower.c > @@ -3633,6 +3633,7 @@ static struct tcf_proto_ops cls_fl_ops __read_mostl= y =3D { > .owner =3D THIS_MODULE, > .flags =3D TCF_PROTO_OPS_DOIT_UNLOCKED, > }; > +MODULE_ALIAS_TCF("flower"); > > static int __init cls_fl_init(void) > { > diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c > index afc534ee0a18..86c833885a2d 100644 > --- a/net/sched/cls_fw.c > +++ b/net/sched/cls_fw.c > @@ -433,6 +433,7 @@ static struct tcf_proto_ops cls_fw_ops __read_mostly = =3D { > .bind_class =3D fw_bind_class, > .owner =3D THIS_MODULE, > }; > +MODULE_ALIAS_TCF("fw"); > > static int __init init_fw(void) > { > diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c > index c4ed11df6254..21ba73978c6a 100644 > --- a/net/sched/cls_matchall.c > +++ b/net/sched/cls_matchall.c > @@ -398,6 +398,7 @@ static struct tcf_proto_ops cls_mall_ops __read_mostl= y =3D { > .bind_class =3D mall_bind_class, > .owner =3D THIS_MODULE, > }; > +MODULE_ALIAS_TCF("matchall"); > > static int __init cls_mall_init(void) > { > diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c > index 12a505db4183..a4701c0752df 100644 > --- a/net/sched/cls_route.c > +++ b/net/sched/cls_route.c > @@ -671,6 +671,7 @@ static struct tcf_proto_ops cls_route4_ops __read_mos= tly =3D { > .bind_class =3D route4_bind_class, > .owner =3D THIS_MODULE, > }; > +MODULE_ALIAS_TCF("route"); > > static int __init init_route4(void) > { > diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c > index d5bdfd4a7655..a969adbd7423 100644 > --- a/net/sched/cls_u32.c > +++ b/net/sched/cls_u32.c > @@ -1453,6 +1453,7 @@ static struct tcf_proto_ops cls_u32_ops __read_most= ly =3D { > .bind_class =3D u32_bind_class, > .owner =3D THIS_MODULE, > }; > +MODULE_ALIAS_TCF("u32"); > > static int __init init_u32(void) > { > -- > 2.42.1 >