Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp483395rdb; Tue, 23 Jan 2024 05:53:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHrsZDF6D349RuZXCc6L081VZZLAeom2E/nGGPRAiAP7et8YfSuuvM3Pc/G70/7lcq7q1CM X-Received: by 2002:a05:6808:3012:b0:3bd:9f53:1b5c with SMTP id ay18-20020a056808301200b003bd9f531b5cmr6083478oib.29.1706017991652; Tue, 23 Jan 2024 05:53:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706017991; cv=pass; d=google.com; s=arc-20160816; b=QCggLpEvxMVW2XmrFoHSbqFDKVeArSSZTaj9A27rTIGL/jyRuvAxHhoIyxPwnl7gIX F6x9JKxqHEjoXTCsKPX0vNP2Sk4txWa0z+ILbUJaHaq2fYUpr/Fj5HxLxPG16FIUUOOr +CjuRr4OJDxl/R4jKJ0KDY0M7D587JJtqFNDu8eWJPzCp6ytaOu5/yPIM/4HXurYXG+H KnDap1aFjAP39D59vFpaYFq+2um4aBO0tMG/1DINHPWztpcJ6BSr5GC9KwZ1J1kaOBdf mCTImqa6Ae1veKlk/KF/5RR6VijmNsnnxc6iJ0INjUrpH2y6J671AykQaJI68ZlnkRtP Nbwg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=CarnWeIkkACTfle2HvzZUnaWqpriWpFFYHwb0I69pLU=; fh=U0kG/4P1z/+o4XREZ634SKE2+mjOW2OxRPixvb/xlBI=; b=XKxSbJh61uL0caw/rj/CKd96gjCF/ONSMqjjbLUOIalEVS6A67BBafakEork/Pl8+r inH+ZqfbrldCvF5Yk06Xhee3hrIazobMX14bFyjBjzurKftjKw3XGqgz4YMjrNCa/NyH kJbqXMEmf7td6VNvzgjC9RqXyrpGamDlL/c06hb7FfB34PN5gWoJy8mQ+g0Tzreo2Rzg Cn+IhWh7ZO6YlhLsr+Bcux5106LAwCRf6xL8hdWkbB6FN6c1OhJ6XLbCeDBzSV6wT4Kj pQ6Gb3KJqeQPQZAqDPkkWY+/wYSLBYrIaFPIHbUniydUBPoUFy4kylCl9bAnV1Hio2bk gbNw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=j5yWyNDX; dkim=pass header.i=@suse.com header.s=susede1 header.b=j5yWyNDX; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-35404-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35404-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bj2-20020a05620a190200b0078336b01f50si8700076qkb.285.2024.01.23.05.53.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 05:53:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35404-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=j5yWyNDX; dkim=pass header.i=@suse.com header.s=susede1 header.b=j5yWyNDX; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-35404-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35404-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com 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 04F181C20F5A for ; Tue, 23 Jan 2024 13:53:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ADCB45F858; Tue, 23 Jan 2024 13:52:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="j5yWyNDX"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="j5yWyNDX" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 961585EE87; Tue, 23 Jan 2024 13:52:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706017970; cv=none; b=LsAmvdPIKvNmOMQhwzocEuoIsvAswex+VtyvVJSWZfl7yLwFXgrofufbOOOLHiZktETUfllEKnCpmX2maoAZyMZrGJ8+B5PsXv5bKj9XRgKvYvA5NPA3TK4nB49msHS/ODl1Dls1xgy85udFC9eKSaVuhgSAcLKqrTBGji8eFcE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706017970; c=relaxed/simple; bh=JQy/dr7uzQI0KyqlOvGb+umF6PLdRTxKI0y9SDbr8XM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=s1quPeAVYEm7PB3Ivwd1/QH+6gterVMQedAlMGx6HRKmLpbcn7apZcuySyWae2cbSGyWeV4BDsKvvjY3kHzSV8mVaqymd4wtTDK+g411yphZOjQ7zIWdRuMQRnvuBUi9891DON4yEhFS7BAddNxlXLg2y9g3Y98dH/Ci1nQXm0U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=j5yWyNDX; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=j5yWyNDX; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id AE9971F791; Tue, 23 Jan 2024 13:52:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1706017966; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CarnWeIkkACTfle2HvzZUnaWqpriWpFFYHwb0I69pLU=; b=j5yWyNDXGLWkCNyNnl7D6qNhCxUWFJpFiezdwaiko0Oa5EBUYsMwePeAf/YZUpxgwf9rxe wuHOKp3c7bnYAhX9/Li5GIlMKE7+m1xYM8eHBWnI7EXJFefbiQ6AzON9JjRC76VLScj2LC msRIH+dzyKd/qnoDj6SDYHRsB7B77tI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1706017966; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CarnWeIkkACTfle2HvzZUnaWqpriWpFFYHwb0I69pLU=; b=j5yWyNDXGLWkCNyNnl7D6qNhCxUWFJpFiezdwaiko0Oa5EBUYsMwePeAf/YZUpxgwf9rxe wuHOKp3c7bnYAhX9/Li5GIlMKE7+m1xYM8eHBWnI7EXJFefbiQ6AzON9JjRC76VLScj2LC msRIH+dzyKd/qnoDj6SDYHRsB7B77tI= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 86802136A4; Tue, 23 Jan 2024 13:52:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id 46s9IK7Er2UMVwAAD6G6ig (envelope-from ); Tue, 23 Jan 2024 13:52:46 +0000 From: =?UTF-8?q?Michal=20Koutn=C3=BD?= To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, cake@lists.bufferbloat.net Cc: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jamal Hadi Salim , 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?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= , Vinicius Costa Gomes , Stephen Hemminger , Petr Pavlu , Michal Kubecek , Martin Wilck , Pedro Tammela Subject: [PATCH v4 0/4] net/sched: Load modules via alias Date: Tue, 23 Jan 2024 14:52:38 +0100 Message-ID: <20240123135242.11430-1-mkoutny@suse.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [7.50 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; BAYES_SPAM(5.10)[100.00%]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_RATELIMIT(0.00)[to_ip_from(RL63s8thh5w8zyxj4waeg9pq8e)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; RCPT_COUNT_TWELVE(0.00)[29]; MID_CONTAINS_FROM(1.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_CC(0.00)[davemloft.net,google.com,kernel.org,redhat.com,mojatatu.com,gmail.com,resnulli.us,iogearbox.net,linux.dev,toke.dk,intel.com,networkplumber.org,suse.cz,suse.com]; RCVD_TLS_ALL(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-Spam-Level: ******* X-Spam-Score: 7.50 X-Spam-Flag: NO 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 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ý (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