Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1074932rdb; Wed, 24 Jan 2024 04:17:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IHjAuvWDYKKCLlxk7rt1HDKkN1C9lKXb8RNmiUcjDKtussi+thHGRjdf1IejxrrvzNLFGHI X-Received: by 2002:a05:620a:4609:b0:783:a92f:49ed with SMTP id br9-20020a05620a460900b00783a92f49edmr3345884qkb.138.1706098675939; Wed, 24 Jan 2024 04:17:55 -0800 (PST) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id p7-20020a05620a22a700b007837e9e6f93si9819366qkh.612.2024.01.24.04.17.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 04:17:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36954-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@mojatatu-com.20230601.gappssmtp.com header.s=20230601 header.b=EeyuUl53; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-36954-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36954-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A2CC51C2184A for ; Wed, 24 Jan 2024 12:17:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2845463121; Wed, 24 Jan 2024 12:17:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=mojatatu-com.20230601.gappssmtp.com header.i=@mojatatu-com.20230601.gappssmtp.com header.b="EeyuUl53" Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com [209.85.219.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91FCB60DD1 for ; Wed, 24 Jan 2024 12:17:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706098661; cv=none; b=sLgvr26WmCBW6KnXevRY92V4WsYZojHy1k7ygBiCK4FsYZeNeWABvPlSojnepj4XvIBVUlui0kIDx5a+CTmdLhSrviayBwb2qmfAWWZjKP+c+Jv3Ai3XEnKTFAyO5v6K9xvHNzdYtwsebNDZvd9hasbXxWv9S87rm+uA9DdJi5I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706098661; c=relaxed/simple; bh=4wAsqiXtqLWKVqj2fG/asHpB71yeF4SIWaebwZLRE/0=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=NKeTF5HwWKuiWL0b3tdhnp3dju/BcYGm6+6rKpk32cVnVGKklI/+OIIka6ypLGfyRex3nqwwkXAHN6tzoQF1m0GscwLzv7gvchP/rK8zwNXGorBtpu76QgkqcKpPztNCVVBC30fAwA1WQ2amgIH/HCrHhclZ1WQvLtxtPQAAle0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mojatatu.com; spf=none smtp.mailfrom=mojatatu.com; dkim=pass (2048-bit key) header.d=mojatatu-com.20230601.gappssmtp.com header.i=@mojatatu-com.20230601.gappssmtp.com header.b=EeyuUl53; arc=none smtp.client-ip=209.85.219.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mojatatu.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=mojatatu.com Received: by mail-yb1-f173.google.com with SMTP id 3f1490d57ef6-dc236729a2bso4626153276.0 for ; Wed, 24 Jan 2024 04:17:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20230601.gappssmtp.com; s=20230601; t=1706098658; x=1706703458; 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=N40ZEELDdKAG+PltYHXUqIJnRZg2htUPF9zZfWdekds=; b=EeyuUl531izO/zR9hh1JZTFuEh+b7ysIzkXISnSp9/9oRhAF+ZafJOz9793fqgbXMN IiulBQ64otHMwQhkfmDvZd6oJgBt3K09MAFj69vt6AxOdqKobEDllPkjNfUKt9YRKOuW 68vBKK1XQnAH5foPJL+dP0c0DpMIZOWT7Gi5p6QDa6+0ooa94oXT3XhxFTRYbFfim5vT esTsBYXYOzaMmhoa0aqcknJtYtIvc47ufL1C9uAt8GNFYyuIYuP2YqRaDOBsk5iMPltY ciR0v9TLJzleIFQttlrJf8qn/lVII7i4Zg5WmYK0MZG2RV0jCLqRn5bq17sqcMnsmv0z jbng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706098658; x=1706703458; 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=N40ZEELDdKAG+PltYHXUqIJnRZg2htUPF9zZfWdekds=; b=eDvmwLgY8+Rg4NEE11/h7tKILQDcVEOaCHBQKM+ElURrvp4w0+YYL8hEk1VAnGUfWI 0yl4NQ0KfD6KocDMHpyWQgXbMHoEY4EPE+asuDR4RpsP//csAIJTeg3pfA5JtbpVEQIJ 2ILIVICgNxmN4yg4KkymkHaRvCVPnB2iCrob5TMVJkFGhg5eJZRsE6vUJDQL8VH3q/ar bYq4ddcOS/ajVi5axtiaNK2WeLvSGBsUbBMaPGGOMvAVqP1X0GbF105oxcyUHUggoxRS wYWbEk/72SIDUfN/E1og8Bpcu2HuQkyWF4LTrWyYaQY9hK8JlxhVmVMstBzre8aD6KOq AMlg== X-Gm-Message-State: AOJu0Yyzt0djqu1kmTLOKOuoA/mH839M+oKwmvqyCxr5ApsOdG749FcG bn6Sh81XPfGCRzy8yO7r1Uoqk/nBMfGsJDTIaXltAybzCaBWOTD8HH/n2iQQ2ftKe7jQFz+IJwi t7XjmNcemsInQW7avahA27HmVc9TUpp2uHXt5U+fdFHksJGc= X-Received: by 2002:a25:81d0:0:b0:dc2:8282:a590 with SMTP id n16-20020a2581d0000000b00dc28282a590mr448139ybm.125.1706098658502; Wed, 24 Jan 2024 04:17:38 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240123135242.11430-1-mkoutny@suse.com> In-Reply-To: <20240123135242.11430-1-mkoutny@suse.com> From: Jamal Hadi Salim Date: Wed, 24 Jan 2024 07:17:27 -0500 Message-ID: Subject: Re: [PATCH v4 0/4] net/sched: Load 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, cake@lists.bufferbloat.net, "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Cong Wang , Jiri Pirko , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= , Vinicius Costa Gomes , Stephen Hemminger , Petr Pavlu , Michal Kubecek , Martin Wilck , Pedro Tammela Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Michal, On Tue, Jan 23, 2024 at 8:52=E2=80=AFAM Michal Koutn=C3=BD wrote: > > These 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 (through aliases) > works for them. (The same pattern exists e.g. for filesystem > modules.) > > For example (before the change): > $ tc filter add dev lo parent 1: protocol ip prio 1 handle 10 tcindex .= . > # cls_tcindex module is loaded despite a `blacklist cls_tcindex` entry > # in /etc/modprobe.d/*.conf > > After the change: > $ tc filter add dev lo parent 1: protocol ip prio 1 handle 10 tcindex .= . > Unknown filter "tcindex", hence option "..." is unparsable > # explicit/acknowledged (privileged) action is needed > $ modprobe cls_tcindex > # blacklist entry won't apply to this direct modprobe, module is > # loaded with awareness > A small nit seeing Simon's comment which will have you respin. cls_tcindex is no longer in the kernel. Can you use another example? Also Stephen had some comments last time, not sure if you addressed those (nothing on the logs says you did and i didnt see him say anything). cheers, jamal > A considered alternative was invoking `modprobe -b` always from > request_module(), however, dismissed as too intrusive and slightly > confusing in favor of the precedented aliases (the commit 7f78e0351394 > ("fs: Limit sys_mount to only request filesystem modules."). > > User experience suffers in both alternatives. It's improvement is > orthogonal to blacklist honoring. > > Changes from v1 (https://lore.kernel.org/r/20231121175640.9981-1-mkoutny@= suse.com) > - Treat sch_ and act_ modules analogously to cls_ > > Changes from v2 (https://lore.kernel.org/r/20231206192752.18989-1-mkoutny= @suse.com) > - reorganized commits (one generated commit + manual pre-/post- work) > - used alias names more fitting the existing net- aliases > - more info in commit messages and cover letter > - rebased on current master > > Changes from v3 (https://lore.kernel.org/r/20240112180646.13232-1-mkoutny= @suse.com) > - rebase on netdev/net-next/main > - correct aliases in cls_* modules (wrong sed) > - replace repeated prefix strings with a macro > - patch also request_module call in qdisc_set_default() > > Michal Koutn=C3=BD (4): > net/sched: Add helper macros with module names > net/sched: Add module aliases for cls_,sch_,act_ modules > net/sched: Load modules via their alias > net/sched: Remove alias of sch_clsact > > include/net/act_api.h | 2 ++ > include/net/pkt_cls.h | 2 ++ > include/net/pkt_sched.h | 2 ++ > net/sched/act_api.c | 2 +- > net/sched/act_bpf.c | 1 + > net/sched/act_connmark.c | 1 + > net/sched/act_csum.c | 1 + > net/sched/act_ct.c | 1 + > net/sched/act_ctinfo.c | 1 + > net/sched/act_gact.c | 1 + > net/sched/act_gate.c | 1 + > net/sched/act_ife.c | 1 + > net/sched/act_mirred.c | 1 + > net/sched/act_mpls.c | 1 + > net/sched/act_nat.c | 1 + > net/sched/act_pedit.c | 1 + > net/sched/act_police.c | 1 + > net/sched/act_sample.c | 1 + > net/sched/act_simple.c | 1 + > net/sched/act_skbedit.c | 1 + > net/sched/act_skbmod.c | 1 + > net/sched/act_tunnel_key.c | 1 + > net/sched/act_vlan.c | 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 + > net/sched/sch_api.c | 4 ++-- > net/sched/sch_cake.c | 1 + > net/sched/sch_cbs.c | 1 + > net/sched/sch_choke.c | 1 + > net/sched/sch_codel.c | 1 + > net/sched/sch_drr.c | 1 + > net/sched/sch_etf.c | 1 + > net/sched/sch_ets.c | 1 + > net/sched/sch_fq.c | 1 + > net/sched/sch_fq_codel.c | 1 + > net/sched/sch_gred.c | 1 + > net/sched/sch_hfsc.c | 1 + > net/sched/sch_hhf.c | 1 + > net/sched/sch_htb.c | 1 + > net/sched/sch_ingress.c | 3 ++- > net/sched/sch_mqprio.c | 1 + > net/sched/sch_multiq.c | 1 + > net/sched/sch_netem.c | 1 + > net/sched/sch_pie.c | 1 + > net/sched/sch_plug.c | 1 + > net/sched/sch_prio.c | 1 + > net/sched/sch_qfq.c | 1 + > net/sched/sch_red.c | 1 + > net/sched/sch_sfb.c | 1 + > net/sched/sch_sfq.c | 1 + > net/sched/sch_skbprio.c | 1 + > net/sched/sch_taprio.c | 1 + > net/sched/sch_tbf.c | 1 + > 61 files changed, 66 insertions(+), 5 deletions(-) > > > base-commit: 736b5545d39ca59d4332a60e56cc8a1a5e264a8e > -- > 2.43.0 >