Skip to content

Commit b265770

Browse files
Werkovkuba-moo
authored andcommitted
net/sched: Add helper macros with module names
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ý <mkoutny@suse.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Link: https://lore.kernel.org/r/20240201130943.19536-2-mkoutny@suse.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent d81c079 commit b265770

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

include/net/act_api.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ int tcf_idr_release(struct tc_action *a, bool bind);
201201
int tcf_register_action(struct tc_action_ops *a, struct pernet_operations *ops);
202202
int tcf_unregister_action(struct tc_action_ops *a,
203203
struct pernet_operations *ops);
204+
#define NET_ACT_ALIAS_PREFIX "net-act-"
205+
#define MODULE_ALIAS_NET_ACT(kind) MODULE_ALIAS(NET_ACT_ALIAS_PREFIX kind)
204206
int tcf_action_destroy(struct tc_action *actions[], int bind);
205207
int tcf_action_exec(struct sk_buff *skb, struct tc_action **actions,
206208
int nr_actions, struct tcf_result *res);

include/net/pkt_cls.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ struct tcf_walker {
2424

2525
int register_tcf_proto_ops(struct tcf_proto_ops *ops);
2626
void unregister_tcf_proto_ops(struct tcf_proto_ops *ops);
27+
#define NET_CLS_ALIAS_PREFIX "net-cls-"
28+
#define MODULE_ALIAS_NET_CLS(kind) MODULE_ALIAS(NET_CLS_ALIAS_PREFIX kind)
2729

2830
struct tcf_block_ext_info {
2931
enum flow_block_binder_type binder_type;

include/net/pkt_sched.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops,
100100

101101
int register_qdisc(struct Qdisc_ops *qops);
102102
void unregister_qdisc(struct Qdisc_ops *qops);
103+
#define NET_SCH_ALIAS_PREFIX "net-sch-"
104+
#define MODULE_ALIAS_NET_SCH(id) MODULE_ALIAS(NET_SCH_ALIAS_PREFIX id)
103105
void qdisc_get_default(char *id, size_t len);
104106
int qdisc_set_default(const char *id);
105107

0 commit comments

Comments
 (0)