Skip to content

Commit 074dd3b

Browse files
committed
Merge branch 'devlink-trivial-names-cleanup'
Jiri Pirko says: ==================== devlink: trivial names cleanup This is a follow-up to Jakub's devlink code split and dump iteration helper patchset. No functional changes, just couple of renames to makes things consistent and perhaps easier to follow. ==================== Link: https://lore.kernel.org/r/20230131090613.2131740-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents dd25cfa + 8589ba4 commit 074dd3b

File tree

3 files changed

+73
-74
lines changed

3 files changed

+73
-74
lines changed

net/devlink/devl_internal.h

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ struct devlink_nl_dump_state {
115115
};
116116
};
117117

118-
struct devlink_gen_cmd {
118+
struct devlink_cmd {
119119
int (*dump_one)(struct sk_buff *msg, struct devlink *devlink,
120120
struct netlink_callback *cb);
121121
};
@@ -128,8 +128,8 @@ devlink_get_from_attrs_lock(struct net *net, struct nlattr **attrs);
128128
void devlink_notify_unregister(struct devlink *devlink);
129129
void devlink_notify_register(struct devlink *devlink);
130130

131-
int devlink_nl_instance_iter_dump(struct sk_buff *msg,
132-
struct netlink_callback *cb);
131+
int devlink_nl_instance_iter_dumpit(struct sk_buff *msg,
132+
struct netlink_callback *cb);
133133

134134
static inline struct devlink_nl_dump_state *
135135
devlink_dump_state(struct netlink_callback *cb)
@@ -139,22 +139,23 @@ devlink_dump_state(struct netlink_callback *cb)
139139
return (struct devlink_nl_dump_state *)cb->ctx;
140140
}
141141

142-
/* gen cmds */
143-
extern const struct devlink_gen_cmd devl_gen_inst;
144-
extern const struct devlink_gen_cmd devl_gen_port;
145-
extern const struct devlink_gen_cmd devl_gen_sb;
146-
extern const struct devlink_gen_cmd devl_gen_sb_pool;
147-
extern const struct devlink_gen_cmd devl_gen_sb_port_pool;
148-
extern const struct devlink_gen_cmd devl_gen_sb_tc_pool_bind;
149-
extern const struct devlink_gen_cmd devl_gen_selftests;
150-
extern const struct devlink_gen_cmd devl_gen_param;
151-
extern const struct devlink_gen_cmd devl_gen_region;
152-
extern const struct devlink_gen_cmd devl_gen_info;
153-
extern const struct devlink_gen_cmd devl_gen_health_reporter;
154-
extern const struct devlink_gen_cmd devl_gen_trap;
155-
extern const struct devlink_gen_cmd devl_gen_trap_group;
156-
extern const struct devlink_gen_cmd devl_gen_trap_policer;
157-
extern const struct devlink_gen_cmd devl_gen_linecard;
142+
/* Commands */
143+
extern const struct devlink_cmd devl_cmd_get;
144+
extern const struct devlink_cmd devl_cmd_port_get;
145+
extern const struct devlink_cmd devl_cmd_sb_get;
146+
extern const struct devlink_cmd devl_cmd_sb_pool_get;
147+
extern const struct devlink_cmd devl_cmd_sb_port_pool_get;
148+
extern const struct devlink_cmd devl_cmd_sb_tc_pool_bind_get;
149+
extern const struct devlink_cmd devl_cmd_param_get;
150+
extern const struct devlink_cmd devl_cmd_region_get;
151+
extern const struct devlink_cmd devl_cmd_info_get;
152+
extern const struct devlink_cmd devl_cmd_health_reporter_get;
153+
extern const struct devlink_cmd devl_cmd_trap_get;
154+
extern const struct devlink_cmd devl_cmd_trap_group_get;
155+
extern const struct devlink_cmd devl_cmd_trap_policer_get;
156+
extern const struct devlink_cmd devl_cmd_rate_get;
157+
extern const struct devlink_cmd devl_cmd_linecard_get;
158+
extern const struct devlink_cmd devl_cmd_selftests_get;
158159

159160
/* Ports */
160161
int devlink_port_netdevice_event(struct notifier_block *nb,
@@ -182,8 +183,6 @@ struct devlink_linecard *
182183
devlink_linecard_get_from_info(struct devlink *devlink, struct genl_info *info);
183184

184185
/* Rates */
185-
extern const struct devlink_gen_cmd devl_gen_rate_get;
186-
187186
struct devlink_rate *
188187
devlink_rate_get_from_info(struct devlink *devlink, struct genl_info *info);
189188
struct devlink_rate *

net/devlink/leftover.c

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@ devlink_nl_cmd_rate_get_dump_one(struct sk_buff *msg, struct devlink *devlink,
12361236
return err;
12371237
}
12381238

1239-
const struct devlink_gen_cmd devl_gen_rate_get = {
1239+
const struct devlink_cmd devl_cmd_rate_get = {
12401240
.dump_one = devlink_nl_cmd_rate_get_dump_one,
12411241
};
12421242

@@ -1303,7 +1303,7 @@ devlink_nl_cmd_get_dump_one(struct sk_buff *msg, struct devlink *devlink,
13031303
cb->nlh->nlmsg_seq, NLM_F_MULTI);
13041304
}
13051305

1306-
const struct devlink_gen_cmd devl_gen_inst = {
1306+
const struct devlink_cmd devl_cmd_get = {
13071307
.dump_one = devlink_nl_cmd_get_dump_one,
13081308
};
13091309

@@ -1359,7 +1359,7 @@ devlink_nl_cmd_port_get_dump_one(struct sk_buff *msg, struct devlink *devlink,
13591359
return err;
13601360
}
13611361

1362-
const struct devlink_gen_cmd devl_gen_port = {
1362+
const struct devlink_cmd devl_cmd_port_get = {
13631363
.dump_one = devlink_nl_cmd_port_get_dump_one,
13641364
};
13651365

@@ -2137,7 +2137,7 @@ static int devlink_nl_cmd_linecard_get_dump_one(struct sk_buff *msg,
21372137
return err;
21382138
}
21392139

2140-
const struct devlink_gen_cmd devl_gen_linecard = {
2140+
const struct devlink_cmd devl_cmd_linecard_get = {
21412141
.dump_one = devlink_nl_cmd_linecard_get_dump_one,
21422142
};
21432143

@@ -2392,7 +2392,7 @@ devlink_nl_cmd_sb_get_dump_one(struct sk_buff *msg, struct devlink *devlink,
23922392
return err;
23932393
}
23942394

2395-
const struct devlink_gen_cmd devl_gen_sb = {
2395+
const struct devlink_cmd devl_cmd_sb_get = {
23962396
.dump_one = devlink_nl_cmd_sb_get_dump_one,
23972397
};
23982398

@@ -2530,7 +2530,7 @@ devlink_nl_cmd_sb_pool_get_dump_one(struct sk_buff *msg,
25302530
return err;
25312531
}
25322532

2533-
const struct devlink_gen_cmd devl_gen_sb_pool = {
2533+
const struct devlink_cmd devl_cmd_sb_pool_get = {
25342534
.dump_one = devlink_nl_cmd_sb_pool_get_dump_one,
25352535
};
25362536

@@ -2738,7 +2738,7 @@ devlink_nl_cmd_sb_port_pool_get_dump_one(struct sk_buff *msg,
27382738
return err;
27392739
}
27402740

2741-
const struct devlink_gen_cmd devl_gen_sb_port_pool = {
2741+
const struct devlink_cmd devl_cmd_sb_port_pool_get = {
27422742
.dump_one = devlink_nl_cmd_sb_port_pool_get_dump_one,
27432743
};
27442744

@@ -2973,7 +2973,7 @@ devlink_nl_cmd_sb_tc_pool_bind_get_dump_one(struct sk_buff *msg,
29732973
return err;
29742974
}
29752975

2976-
const struct devlink_gen_cmd devl_gen_sb_tc_pool_bind = {
2976+
const struct devlink_cmd devl_cmd_sb_tc_pool_bind_get = {
29772977
.dump_one = devlink_nl_cmd_sb_tc_pool_bind_get_dump_one,
29782978
};
29792979

@@ -4785,7 +4785,7 @@ devlink_nl_cmd_selftests_get_dump_one(struct sk_buff *msg,
47854785
cb->extack);
47864786
}
47874787

4788-
const struct devlink_gen_cmd devl_gen_selftests = {
4788+
const struct devlink_cmd devl_cmd_selftests_get = {
47894789
.dump_one = devlink_nl_cmd_selftests_get_dump_one,
47904790
};
47914791

@@ -5271,7 +5271,7 @@ devlink_nl_cmd_param_get_dump_one(struct sk_buff *msg, struct devlink *devlink,
52715271
return err;
52725272
}
52735273

5274-
const struct devlink_gen_cmd devl_gen_param = {
5274+
const struct devlink_cmd devl_cmd_param_get = {
52755275
.dump_one = devlink_nl_cmd_param_get_dump_one,
52765276
};
52775277

@@ -5978,7 +5978,7 @@ devlink_nl_cmd_region_get_dump_one(struct sk_buff *msg, struct devlink *devlink,
59785978
return 0;
59795979
}
59805980

5981-
const struct devlink_gen_cmd devl_gen_region = {
5981+
const struct devlink_cmd devl_cmd_region_get = {
59825982
.dump_one = devlink_nl_cmd_region_get_dump_one,
59835983
};
59845984

@@ -6625,7 +6625,7 @@ devlink_nl_cmd_info_get_dump_one(struct sk_buff *msg, struct devlink *devlink,
66256625
return err;
66266626
}
66276627

6628-
const struct devlink_gen_cmd devl_gen_info = {
6628+
const struct devlink_cmd devl_cmd_info_get = {
66296629
.dump_one = devlink_nl_cmd_info_get_dump_one,
66306630
};
66316631

@@ -7793,7 +7793,7 @@ devlink_nl_cmd_health_reporter_get_dump_one(struct sk_buff *msg,
77937793
return 0;
77947794
}
77957795

7796-
const struct devlink_gen_cmd devl_gen_health_reporter = {
7796+
const struct devlink_cmd devl_cmd_health_reporter_get = {
77977797
.dump_one = devlink_nl_cmd_health_reporter_get_dump_one,
77987798
};
77997799

@@ -8311,7 +8311,7 @@ devlink_nl_cmd_trap_get_dump_one(struct sk_buff *msg, struct devlink *devlink,
83118311
return err;
83128312
}
83138313

8314-
const struct devlink_gen_cmd devl_gen_trap = {
8314+
const struct devlink_cmd devl_cmd_trap_get = {
83158315
.dump_one = devlink_nl_cmd_trap_get_dump_one,
83168316
};
83178317

@@ -8524,7 +8524,7 @@ devlink_nl_cmd_trap_group_get_dump_one(struct sk_buff *msg,
85248524
return err;
85258525
}
85268526

8527-
const struct devlink_gen_cmd devl_gen_trap_group = {
8527+
const struct devlink_cmd devl_cmd_trap_group_get = {
85288528
.dump_one = devlink_nl_cmd_trap_group_get_dump_one,
85298529
};
85308530

@@ -8817,7 +8817,7 @@ devlink_nl_cmd_trap_policer_get_dump_one(struct sk_buff *msg,
88178817
return err;
88188818
}
88198819

8820-
const struct devlink_gen_cmd devl_gen_trap_policer = {
8820+
const struct devlink_cmd devl_cmd_trap_policer_get = {
88218821
.dump_one = devlink_nl_cmd_trap_policer_get_dump_one,
88228822
};
88238823

@@ -8898,14 +8898,14 @@ const struct genl_small_ops devlink_nl_ops[56] = {
88988898
.cmd = DEVLINK_CMD_GET,
88998899
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
89008900
.doit = devlink_nl_cmd_get_doit,
8901-
.dumpit = devlink_nl_instance_iter_dump,
8901+
.dumpit = devlink_nl_instance_iter_dumpit,
89028902
/* can be retrieved by unprivileged users */
89038903
},
89048904
{
89058905
.cmd = DEVLINK_CMD_PORT_GET,
89068906
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
89078907
.doit = devlink_nl_cmd_port_get_doit,
8908-
.dumpit = devlink_nl_instance_iter_dump,
8908+
.dumpit = devlink_nl_instance_iter_dumpit,
89098909
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
89108910
/* can be retrieved by unprivileged users */
89118911
},
@@ -8919,7 +8919,7 @@ const struct genl_small_ops devlink_nl_ops[56] = {
89198919
{
89208920
.cmd = DEVLINK_CMD_RATE_GET,
89218921
.doit = devlink_nl_cmd_rate_get_doit,
8922-
.dumpit = devlink_nl_instance_iter_dump,
8922+
.dumpit = devlink_nl_instance_iter_dumpit,
89238923
.internal_flags = DEVLINK_NL_FLAG_NEED_RATE,
89248924
/* can be retrieved by unprivileged users */
89258925
},
@@ -8967,7 +8967,7 @@ const struct genl_small_ops devlink_nl_ops[56] = {
89678967
{
89688968
.cmd = DEVLINK_CMD_LINECARD_GET,
89698969
.doit = devlink_nl_cmd_linecard_get_doit,
8970-
.dumpit = devlink_nl_instance_iter_dump,
8970+
.dumpit = devlink_nl_instance_iter_dumpit,
89718971
.internal_flags = DEVLINK_NL_FLAG_NEED_LINECARD,
89728972
/* can be retrieved by unprivileged users */
89738973
},
@@ -8981,14 +8981,14 @@ const struct genl_small_ops devlink_nl_ops[56] = {
89818981
.cmd = DEVLINK_CMD_SB_GET,
89828982
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
89838983
.doit = devlink_nl_cmd_sb_get_doit,
8984-
.dumpit = devlink_nl_instance_iter_dump,
8984+
.dumpit = devlink_nl_instance_iter_dumpit,
89858985
/* can be retrieved by unprivileged users */
89868986
},
89878987
{
89888988
.cmd = DEVLINK_CMD_SB_POOL_GET,
89898989
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
89908990
.doit = devlink_nl_cmd_sb_pool_get_doit,
8991-
.dumpit = devlink_nl_instance_iter_dump,
8991+
.dumpit = devlink_nl_instance_iter_dumpit,
89928992
/* can be retrieved by unprivileged users */
89938993
},
89948994
{
@@ -9001,7 +9001,7 @@ const struct genl_small_ops devlink_nl_ops[56] = {
90019001
.cmd = DEVLINK_CMD_SB_PORT_POOL_GET,
90029002
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
90039003
.doit = devlink_nl_cmd_sb_port_pool_get_doit,
9004-
.dumpit = devlink_nl_instance_iter_dump,
9004+
.dumpit = devlink_nl_instance_iter_dumpit,
90059005
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
90069006
/* can be retrieved by unprivileged users */
90079007
},
@@ -9016,7 +9016,7 @@ const struct genl_small_ops devlink_nl_ops[56] = {
90169016
.cmd = DEVLINK_CMD_SB_TC_POOL_BIND_GET,
90179017
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
90189018
.doit = devlink_nl_cmd_sb_tc_pool_bind_get_doit,
9019-
.dumpit = devlink_nl_instance_iter_dump,
9019+
.dumpit = devlink_nl_instance_iter_dumpit,
90209020
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
90219021
/* can be retrieved by unprivileged users */
90229022
},
@@ -9097,7 +9097,7 @@ const struct genl_small_ops devlink_nl_ops[56] = {
90979097
.cmd = DEVLINK_CMD_PARAM_GET,
90989098
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
90999099
.doit = devlink_nl_cmd_param_get_doit,
9100-
.dumpit = devlink_nl_instance_iter_dump,
9100+
.dumpit = devlink_nl_instance_iter_dumpit,
91019101
/* can be retrieved by unprivileged users */
91029102
},
91039103
{
@@ -9125,7 +9125,7 @@ const struct genl_small_ops devlink_nl_ops[56] = {
91259125
.cmd = DEVLINK_CMD_REGION_GET,
91269126
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
91279127
.doit = devlink_nl_cmd_region_get_doit,
9128-
.dumpit = devlink_nl_instance_iter_dump,
9128+
.dumpit = devlink_nl_instance_iter_dumpit,
91299129
.flags = GENL_ADMIN_PERM,
91309130
},
91319131
{
@@ -9151,14 +9151,14 @@ const struct genl_small_ops devlink_nl_ops[56] = {
91519151
.cmd = DEVLINK_CMD_INFO_GET,
91529152
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
91539153
.doit = devlink_nl_cmd_info_get_doit,
9154-
.dumpit = devlink_nl_instance_iter_dump,
9154+
.dumpit = devlink_nl_instance_iter_dumpit,
91559155
/* can be retrieved by unprivileged users */
91569156
},
91579157
{
91589158
.cmd = DEVLINK_CMD_HEALTH_REPORTER_GET,
91599159
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
91609160
.doit = devlink_nl_cmd_health_reporter_get_doit,
9161-
.dumpit = devlink_nl_instance_iter_dump,
9161+
.dumpit = devlink_nl_instance_iter_dumpit,
91629162
.internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK_OR_PORT,
91639163
/* can be retrieved by unprivileged users */
91649164
},
@@ -9213,7 +9213,7 @@ const struct genl_small_ops devlink_nl_ops[56] = {
92139213
{
92149214
.cmd = DEVLINK_CMD_TRAP_GET,
92159215
.doit = devlink_nl_cmd_trap_get_doit,
9216-
.dumpit = devlink_nl_instance_iter_dump,
9216+
.dumpit = devlink_nl_instance_iter_dumpit,
92179217
/* can be retrieved by unprivileged users */
92189218
},
92199219
{
@@ -9224,7 +9224,7 @@ const struct genl_small_ops devlink_nl_ops[56] = {
92249224
{
92259225
.cmd = DEVLINK_CMD_TRAP_GROUP_GET,
92269226
.doit = devlink_nl_cmd_trap_group_get_doit,
9227-
.dumpit = devlink_nl_instance_iter_dump,
9227+
.dumpit = devlink_nl_instance_iter_dumpit,
92289228
/* can be retrieved by unprivileged users */
92299229
},
92309230
{
@@ -9235,7 +9235,7 @@ const struct genl_small_ops devlink_nl_ops[56] = {
92359235
{
92369236
.cmd = DEVLINK_CMD_TRAP_POLICER_GET,
92379237
.doit = devlink_nl_cmd_trap_policer_get_doit,
9238-
.dumpit = devlink_nl_instance_iter_dump,
9238+
.dumpit = devlink_nl_instance_iter_dumpit,
92399239
/* can be retrieved by unprivileged users */
92409240
},
92419241
{
@@ -9246,7 +9246,7 @@ const struct genl_small_ops devlink_nl_ops[56] = {
92469246
{
92479247
.cmd = DEVLINK_CMD_SELFTESTS_GET,
92489248
.doit = devlink_nl_cmd_selftests_get_doit,
9249-
.dumpit = devlink_nl_instance_iter_dump,
9249+
.dumpit = devlink_nl_instance_iter_dumpit,
92509250
/* can be retrieved by unprivileged users */
92519251
},
92529252
{

0 commit comments

Comments
 (0)