From patchwork Thu Feb 1 13:09:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Michal_Koutn=C3=BD?= X-Patchwork-Id: 195334 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2719:b0:106:209c:c626 with SMTP id hl25csp149696dyb; Thu, 1 Feb 2024 05:29:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IEBzALuuXSPEqi03Iqyn63WRKRktRcicnDP5Rh1rivuo0xJrGZT2Ai8WFC7/4jG3P5t8Dp/ X-Received: by 2002:a05:6a00:9387:b0:6df:eb95:2c78 with SMTP id ka7-20020a056a00938700b006dfeb952c78mr1379847pfb.10.1706794180230; Thu, 01 Feb 2024 05:29:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706794180; cv=pass; d=google.com; s=arc-20160816; b=BKbU2IN9K1TzriPqepEAW7kbkaNZxBEerfyTVcIJsh/tvf3/NTUgcokPqjDLAtg9Ox Ps5EvpuAi4Bp9g/iUMMfY5FRitYJA3JvDrkXoWgze2rNaX2MqpH/cANwTurl+2/iFzLP o6UWq5IOz9Ctdqnuky/2Jxt2o00dyvMHGyWv8TaEU7R9LAzuOKqiJ4sM63lTiVfkE6TT J2E2CiseLT5sLOg0TX/RaCkuC1cyW5nnPSQPhVl4q2pOc6SRqS6N4O0UrmJJTgcjAgT+ kJnqVCaN3YLUejTesBbBrpNMOCXuAcLft7cHLTLDW0eyUJNPBTi/YBL0cDHaQn0Pzt3v IuuA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-signature; bh=Tm++baup3koyn3Nz/n1HWTFZIXb00d390m5J46YHdYE=; fh=509IvLEwmY3cYYNB2nimoQZg8hFsW0rXqT+LKJI6Hlg=; b=WdbCq8FMowxHD6/d54wu2Izy3m4zhEOm+Lm15CmZTp6r9a1uyyH6g9gXq0iZqFEv/8 fF0yVP0pq+gOSL9dKze4AXLG11v7zJiddcL/P3yWRrImGI1dVeKwchbGSmEXQdt80XEb TP4S/oae3IdqOXg17jEzJB7S5yWwZcGt3DytYzSjdJfbmrlHW1dVne7Sg8T+QxcUGYz1 hZ8u6UF7vidRuQZl0ijaPztkbe3nWBh9ppb0MeXpos09vQ5Fhh8cOWe9GPzIvNiccv19 rYMdjpWjETTGfjPi3bpXgRPeyeUKB4hdyTK9GXOVyGYwdf6exdUlFOtSVQt2CWyisIwS TfAQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="ak6/8uPC"; dkim=pass header.i=@suse.com header.s=susede1 header.b="ak6/8uPC"; 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-48195-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48195-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com X-Forwarded-Encrypted: i=1; AJvYcCVRU44FxbsLeN4gTw7Zv5ggvHxeHCiKJoEMPHrYBVJSp2wUnS/otQ3SJZs7n3Fy1SUa23D8JPNmCfY+Mijxw106I4nb6g== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id g10-20020aa79dca000000b006dbdfa8419dsi11714299pfq.400.2024.02.01.05.29.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 05:29:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48195-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="ak6/8uPC"; dkim=pass header.i=@suse.com header.s=susede1 header.b="ak6/8uPC"; 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-48195-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48195-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id F056AB2B532 for ; Thu, 1 Feb 2024 13:11:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E89835D47C; Thu, 1 Feb 2024 13:09:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="ak6/8uPC"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="ak6/8uPC" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 A055F53369; Thu, 1 Feb 2024 13:09:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706792989; cv=none; b=Knsn4fI4vOhL4H0AFwBvWHgobrVhmoh5m0ttF2LpYn7JsiFkIN9sRS2d17J6OZepTv2n0OzDo4y73VtBYMXnjiNw/rqqo74rBF4IxUDqrBfCetewbVqCQeBUDdZ2REJfmvArVusMKAZRC1ntMT+4rzyKRaW0lsS5ZbKrntu6XoI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706792989; c=relaxed/simple; bh=CWsec72laiH13hslDdt/tQ5pFRPvNGWlQZH0jn7t9Zk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oJhvCvSwDlceQecDkYuvBWQqfdudq2BVZKzvLRWuKUxuGgTznXN59VvL3/zpWUgKh8oINDoxAkDFwDLTBn15otC0S9cJQkmFwbiiNN/zm5uPUefCGWWIhekKMP8Bw/5NEJUlR0OSgzRG8/ZZ7rHbo6LSfa92aoMHksakQQUHzMg= 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=ak6/8uPC; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=ak6/8uPC; arc=none smtp.client-ip=195.135.223.130 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 imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (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-out1.suse.de (Postfix) with ESMTPS id B71F722140; Thu, 1 Feb 2024 13:09:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1706792985; 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: in-reply-to:in-reply-to:references:references; bh=Tm++baup3koyn3Nz/n1HWTFZIXb00d390m5J46YHdYE=; b=ak6/8uPCq9RQwKpa88YgEQQI+jGzo+X/ZgRQvMeDOGBmCc6AMegY2kZSdDD0ouYCvblh09 fw4zPlbtNMZpR+lmfMHI67rN/5CUrPrE4j/XwCSBV9RfTKeI5VFoY2oQ5f9ugZ0ZuNifyI Z5nWGgyMjq4HGR2KMSnsMbrWChyNqz4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1706792985; 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: in-reply-to:in-reply-to:references:references; bh=Tm++baup3koyn3Nz/n1HWTFZIXb00d390m5J46YHdYE=; b=ak6/8uPCq9RQwKpa88YgEQQI+jGzo+X/ZgRQvMeDOGBmCc6AMegY2kZSdDD0ouYCvblh09 fw4zPlbtNMZpR+lmfMHI67rN/5CUrPrE4j/XwCSBV9RfTKeI5VFoY2oQ5f9ugZ0ZuNifyI Z5nWGgyMjq4HGR2KMSnsMbrWChyNqz4= Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 965CB139E1; Thu, 1 Feb 2024 13:09:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap2.dmz-prg2.suse.org with ESMTPSA id 6EWUJBmYu2VafgAAn2gu4w (envelope-from ); Thu, 01 Feb 2024 13:09:45 +0000 From: =?utf-8?q?Michal_Koutn=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 , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= , Vinicius Costa Gomes , Stephen Hemminger , Simon Horman , Pedro Tammela Subject: [PATCH v5 1/4] net/sched: Add helper macros with module names Date: Thu, 1 Feb 2024 14:09:40 +0100 Message-ID: <20240201130943.19536-2-mkoutny@suse.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240201130943.19536-1-mkoutny@suse.com> References: <20240201130943.19536-1-mkoutny@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b="ak6/8uPC" X-Spamd-Result: default: False [2.19 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; BAYES_HAM(-0.00)[31.01%]; 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(RLogq4uai3psdy7gygdsfysmzr)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; DKIM_TRACE(0.00)[suse.com:+]; MX_GOOD(-0.01)[]; RCPT_COUNT_TWELVE(0.00)[28]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:email]; 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]; RCVD_TLS_ALL(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: 2.19 X-Rspamd-Queue-Id: B71F722140 X-Spam-Level: ** X-Spam-Flag: NO X-Spamd-Bar: ++ X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789703414500162904 X-GMAIL-MSGID: 1789703414500162904 The macros are preparation for adding module aliases en mass in a separate commit. Although it would be tempting to create aliases like cls-foo for name cls_foo, this could not be used because modprobe utilities treat '-' and '_' interchangeably. In the end, the naming follows pattern of proto modules in linux/net.h. Signed-off-by: Michal Koutný --- include/net/act_api.h | 2 ++ include/net/pkt_cls.h | 2 ++ include/net/pkt_sched.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/include/net/act_api.h b/include/net/act_api.h index e1e5e72b901e..77ee0c657e2c 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h @@ -201,6 +201,8 @@ int tcf_idr_release(struct tc_action *a, bool bind); int tcf_register_action(struct tc_action_ops *a, struct pernet_operations *ops); int tcf_unregister_action(struct tc_action_ops *a, struct pernet_operations *ops); +#define NET_ACT_ALIAS_PREFIX "net-act-" +#define MODULE_ALIAS_NET_ACT(kind) MODULE_ALIAS(NET_ACT_ALIAS_PREFIX kind) int tcf_action_destroy(struct tc_action *actions[], int bind); int tcf_action_exec(struct sk_buff *skb, struct tc_action **actions, int nr_actions, struct tcf_result *res); diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index f308e8268651..a4ee43f493bb 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h @@ -24,6 +24,8 @@ struct tcf_walker { int register_tcf_proto_ops(struct tcf_proto_ops *ops); void unregister_tcf_proto_ops(struct tcf_proto_ops *ops); +#define NET_CLS_ALIAS_PREFIX "net-cls-" +#define MODULE_ALIAS_NET_CLS(kind) MODULE_ALIAS(NET_CLS_ALIAS_PREFIX kind) struct tcf_block_ext_info { enum flow_block_binder_type binder_type; diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 1e200d9a066d..d7b7b6cd4aa1 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h @@ -100,6 +100,8 @@ struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops, int register_qdisc(struct Qdisc_ops *qops); void unregister_qdisc(struct Qdisc_ops *qops); +#define NET_SCH_ALIAS_PREFIX "net-sch-" +#define MODULE_ALIAS_NET_SCH(id) MODULE_ALIAS(NET_SCH_ALIAS_PREFIX id) void qdisc_get_default(char *id, size_t len); int qdisc_set_default(const char *id);