devlink: trivial names cleanup
Subsystems (3)
Jiri Pirko
maintainercover devlink: trivial names cleanup
From: Jiri Pirko <[email protected]>
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.
Jiri Pirko (3):
devlink: rename devlink_nl_instance_iter_dump() to "dumpit"
devlink: remove "gen" from struct devlink_gen_cmd name
devlink: rename and reorder instances of struct devlink_cmd
net/devlink/devl_internal.h | 41 ++++++++++++------------ net/devlink/leftover.c | 64 ++++++++++++++++++------------------- net/devlink/netlink.c | 42 ++++++++++++------------ 3 files changed, 73 insertions(+), 74 deletions(-)
Signature · 1 line
2.39.0
Jiri Pirko
maintainerPATCH 1/3 devlink: rename devlink_nl_instance_iter_dump() to "dumpit"
From: Jiri Pirko <[email protected]>
To have the name of the function consistent with the struct cb name, rename devlink_nl_instance_iter_dump() to devlink_nl_instance_iter_dumpit().
--- net/devlink/devl_internal.h | 4 ++-- net/devlink/leftover.c | 32 ++++++++++++++++---------------- net/devlink/netlink.c | 4 ++-- 3 files changed, 20 insertions(+), 20 deletions(-)
net/devlink/devl_internal.h +2 -2
@@ -128,8 +128,8 @@ devlink_get_from_attrs_lock(struct net *net, struct nlattr **attrs);void devlink_notify_unregister (struct devlink *devlink);void devlink_notify_register (struct devlink *devlink); -int devlink_nl_instance_iter_dump (struct sk_buff *msg, -struct netlink_callback *cb); +int devlink_nl_instance_iter_dumpit (struct sk_buff *msg, +struct netlink_callback *cb);static inline struct devlink_nl_dump_state *devlink_dump_state (struct netlink_callback *cb)
net/devlink/leftover.c +16 -16
@@ -8898,14 +8898,14 @@ const struct genl_small_ops devlink_nl_ops[56] = { .cmd = DEVLINK_CMD_GET, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = devlink_nl_cmd_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, /* can be retrieved by unprivileged users */ }, { .cmd = DEVLINK_CMD_PORT_GET, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = devlink_nl_cmd_port_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, .internal_flags = DEVLINK_NL_FLAG_NEED_PORT, /* can be retrieved by unprivileged users */ },
@@ -8919,7 +8919,7 @@ const struct genl_small_ops devlink_nl_ops[56] = { { .cmd = DEVLINK_CMD_RATE_GET, .doit = devlink_nl_cmd_rate_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, .internal_flags = DEVLINK_NL_FLAG_NEED_RATE, /* can be retrieved by unprivileged users */ },
@@ -8967,7 +8967,7 @@ const struct genl_small_ops devlink_nl_ops[56] = { { .cmd = DEVLINK_CMD_LINECARD_GET, .doit = devlink_nl_cmd_linecard_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, .internal_flags = DEVLINK_NL_FLAG_NEED_LINECARD, /* can be retrieved by unprivileged users */ },
@@ -8981,14 +8981,14 @@ const struct genl_small_ops devlink_nl_ops[56] = { .cmd = DEVLINK_CMD_SB_GET, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = devlink_nl_cmd_sb_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, /* can be retrieved by unprivileged users */ }, { .cmd = DEVLINK_CMD_SB_POOL_GET, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = devlink_nl_cmd_sb_pool_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, /* can be retrieved by unprivileged users */ }, {
@@ -9001,7 +9001,7 @@ const struct genl_small_ops devlink_nl_ops[56] = { .cmd = DEVLINK_CMD_SB_PORT_POOL_GET, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = devlink_nl_cmd_sb_port_pool_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, .internal_flags = DEVLINK_NL_FLAG_NEED_PORT, /* can be retrieved by unprivileged users */ },
@@ -9016,7 +9016,7 @@ const struct genl_small_ops devlink_nl_ops[56] = { .cmd = DEVLINK_CMD_SB_TC_POOL_BIND_GET, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = devlink_nl_cmd_sb_tc_pool_bind_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, .internal_flags = DEVLINK_NL_FLAG_NEED_PORT, /* can be retrieved by unprivileged users */ },
@@ -9097,7 +9097,7 @@ const struct genl_small_ops devlink_nl_ops[56] = { .cmd = DEVLINK_CMD_PARAM_GET, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = devlink_nl_cmd_param_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, /* can be retrieved by unprivileged users */ }, {
@@ -9125,7 +9125,7 @@ const struct genl_small_ops devlink_nl_ops[56] = { .cmd = DEVLINK_CMD_REGION_GET, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = devlink_nl_cmd_region_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, .flags = GENL_ADMIN_PERM, }, {
@@ -9151,14 +9151,14 @@ const struct genl_small_ops devlink_nl_ops[56] = { .cmd = DEVLINK_CMD_INFO_GET, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = devlink_nl_cmd_info_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, /* can be retrieved by unprivileged users */ }, { .cmd = DEVLINK_CMD_HEALTH_REPORTER_GET, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = devlink_nl_cmd_health_reporter_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK_OR_PORT, /* can be retrieved by unprivileged users */ },
@@ -9213,7 +9213,7 @@ const struct genl_small_ops devlink_nl_ops[56] = { { .cmd = DEVLINK_CMD_TRAP_GET, .doit = devlink_nl_cmd_trap_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, /* can be retrieved by unprivileged users */ }, {
@@ -9224,7 +9224,7 @@ const struct genl_small_ops devlink_nl_ops[56] = { { .cmd = DEVLINK_CMD_TRAP_GROUP_GET, .doit = devlink_nl_cmd_trap_group_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, /* can be retrieved by unprivileged users */ }, {
@@ -9235,7 +9235,7 @@ const struct genl_small_ops devlink_nl_ops[56] = { { .cmd = DEVLINK_CMD_TRAP_POLICER_GET, .doit = devlink_nl_cmd_trap_policer_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, /* can be retrieved by unprivileged users */ }, {
@@ -9246,7 +9246,7 @@ const struct genl_small_ops devlink_nl_ops[56] = { { .cmd = DEVLINK_CMD_SELFTESTS_GET, .doit = devlink_nl_cmd_selftests_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, /* can be retrieved by unprivileged users */ }, {
net/devlink/netlink.c +2 -2
@@ -196,8 +196,8 @@ static const struct devlink_gen_cmd *devl_gen_cmds[] = { [DEVLINK_CMD_SELFTESTS_GET] = &devl_gen_selftests, }; -int devlink_nl_instance_iter_dump (struct sk_buff *msg, -struct netlink_callback *cb) +int devlink_nl_instance_iter_dumpit (struct sk_buff *msg, +struct netlink_callback *cb) {const struct genl_dumpit_info *info =genl_dumpit_info (cb);struct devlink_nl_dump_state *state =devlink_dump_state (cb);
Signature · 1 line
2.39.0
Re: [patch net-next 1/3] devlink: rename devlink_nl_instance_iter_dump() to "dumpit"
Quoted 8 lines · Jiri Pirko
From: Jiri Pirko <[email protected]>
To have the name of the function consistent with the struct cb name, rename
devlink_nl_instance_iter_dump()todevlink_nl_instance_iter_dumpit().Signed-off-by Jiri Pirko <[email protected]>---
It's a few extra characters, but I think i prefer seeing dumpit in the name vs dump. I understand that the use of "it" comes from the fact that .do is invalid. However, being consistent seems better to me here. Easier to search for dumpit as well vs dump.
Thanks,
Jake
Quoted 180 lines
net/devlink/devl_internal.h | 4 ++-- net/devlink/leftover.c | 32 ++++++++++++++++---------------- net/devlink/netlink.c | 4 ++-- 3 files changed, 20 insertions(+), 20 deletions(-)net/devlink/devl_internal.h +2
-2@@ -128,8 +128,8 @@ devlink_get_from_attrs_lock(struct net *net, struct nlattr **attrs);void devlink_notify_unregister (struct devlink *devlink);void devlink_notify_register (struct devlink *devlink); -int devlink_nl_instance_iter_dump (struct sk_buff *msg, -struct netlink_callback *cb); +int devlink_nl_instance_iter_dumpit (struct sk_buff *msg, +struct netlink_callback *cb);static inline struct devlink_nl_dump_state *devlink_dump_state (struct netlink_callback *cb)net/devlink/leftover.c +16
-16@@ -8898,14 +8898,14 @@ const struct genl_small_ops devlink_nl_ops[56] = { .cmd = DEVLINK_CMD_GET, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = devlink_nl_cmd_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, /* can be retrieved by unprivileged users */ }, { .cmd = DEVLINK_CMD_PORT_GET, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = devlink_nl_cmd_port_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, .internal_flags = DEVLINK_NL_FLAG_NEED_PORT, /* can be retrieved by unprivileged users */ },@@ -8919,7 +8919,7 @@ const struct genl_small_ops devlink_nl_ops[56] = { { .cmd = DEVLINK_CMD_RATE_GET, .doit = devlink_nl_cmd_rate_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, .internal_flags = DEVLINK_NL_FLAG_NEED_RATE, /* can be retrieved by unprivileged users */ },@@ -8967,7 +8967,7 @@ const struct genl_small_ops devlink_nl_ops[56] = { { .cmd = DEVLINK_CMD_LINECARD_GET, .doit = devlink_nl_cmd_linecard_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, .internal_flags = DEVLINK_NL_FLAG_NEED_LINECARD, /* can be retrieved by unprivileged users */ },@@ -8981,14 +8981,14 @@ const struct genl_small_ops devlink_nl_ops[56] = { .cmd = DEVLINK_CMD_SB_GET, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = devlink_nl_cmd_sb_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, /* can be retrieved by unprivileged users */ }, { .cmd = DEVLINK_CMD_SB_POOL_GET, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = devlink_nl_cmd_sb_pool_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, /* can be retrieved by unprivileged users */ }, {@@ -9001,7 +9001,7 @@ const struct genl_small_ops devlink_nl_ops[56] = { .cmd = DEVLINK_CMD_SB_PORT_POOL_GET, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = devlink_nl_cmd_sb_port_pool_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, .internal_flags = DEVLINK_NL_FLAG_NEED_PORT, /* can be retrieved by unprivileged users */ },@@ -9016,7 +9016,7 @@ const struct genl_small_ops devlink_nl_ops[56] = { .cmd = DEVLINK_CMD_SB_TC_POOL_BIND_GET, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = devlink_nl_cmd_sb_tc_pool_bind_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, .internal_flags = DEVLINK_NL_FLAG_NEED_PORT, /* can be retrieved by unprivileged users */ },@@ -9097,7 +9097,7 @@ const struct genl_small_ops devlink_nl_ops[56] = { .cmd = DEVLINK_CMD_PARAM_GET, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = devlink_nl_cmd_param_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, /* can be retrieved by unprivileged users */ }, {@@ -9125,7 +9125,7 @@ const struct genl_small_ops devlink_nl_ops[56] = { .cmd = DEVLINK_CMD_REGION_GET, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = devlink_nl_cmd_region_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, .flags = GENL_ADMIN_PERM, }, {@@ -9151,14 +9151,14 @@ const struct genl_small_ops devlink_nl_ops[56] = { .cmd = DEVLINK_CMD_INFO_GET, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = devlink_nl_cmd_info_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, /* can be retrieved by unprivileged users */ }, { .cmd = DEVLINK_CMD_HEALTH_REPORTER_GET, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = devlink_nl_cmd_health_reporter_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK_OR_PORT, /* can be retrieved by unprivileged users */ },@@ -9213,7 +9213,7 @@ const struct genl_small_ops devlink_nl_ops[56] = { { .cmd = DEVLINK_CMD_TRAP_GET, .doit = devlink_nl_cmd_trap_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, /* can be retrieved by unprivileged users */ }, {@@ -9224,7 +9224,7 @@ const struct genl_small_ops devlink_nl_ops[56] = { { .cmd = DEVLINK_CMD_TRAP_GROUP_GET, .doit = devlink_nl_cmd_trap_group_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, /* can be retrieved by unprivileged users */ }, {@@ -9235,7 +9235,7 @@ const struct genl_small_ops devlink_nl_ops[56] = { { .cmd = DEVLINK_CMD_TRAP_POLICER_GET, .doit = devlink_nl_cmd_trap_policer_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, /* can be retrieved by unprivileged users */ }, {@@ -9246,7 +9246,7 @@ const struct genl_small_ops devlink_nl_ops[56] = { { .cmd = DEVLINK_CMD_SELFTESTS_GET, .doit = devlink_nl_cmd_selftests_get_doit, - .dumpit = devlink_nl_instance_iter_dump, + .dumpit = devlink_nl_instance_iter_dumpit, /* can be retrieved by unprivileged users */ }, {net/devlink/netlink.c +2
-2@@ -196,8 +196,8 @@ static const struct devlink_gen_cmd *devl_gen_cmds[] = { [DEVLINK_CMD_SELFTESTS_GET] = &devl_gen_selftests, }; -int devlink_nl_instance_iter_dump (struct sk_buff *msg, -struct netlink_callback *cb) +int devlink_nl_instance_iter_dumpit (struct sk_buff *msg, +struct netlink_callback *cb) {const struct genl_dumpit_info *info =genl_dumpit_info (cb);struct devlink_nl_dump_state *state =devlink_dump_state (cb);
Jiri Pirko
maintainerPATCH 2/3 devlink: remove "gen" from struct devlink_gen_cmd name
In reply to Jiri PirkoFrom: Jiri Pirko <[email protected]>
No need to have "gen" inside name of the structure for devlink commands. Remove it.
--- net/devlink/devl_internal.h | 36 ++++++++++++++++++------------------ net/devlink/leftover.c | 32 ++++++++++++++++---------------- net/devlink/netlink.c | 4 ++-- 3 files changed, 36 insertions(+), 36 deletions(-)
net/devlink/devl_internal.h +18 -18
@@ -115,7 +115,7 @@ struct devlink_nl_dump_state { }; }; -struct devlink_gen_cmd { +struct devlink_cmd {int (*dump_one)(struct sk_buff *msg,struct devlink *devlink,struct netlink_callback *cb); };
@@ -139,22 +139,22 @@ devlink_dump_state(struct netlink_callback *cb)return (struct devlink_nl_dump_state *)cb->ctx; } -/* gen cmds */ -extern const struct devlink_gen_cmd devl_gen_inst; -extern const struct devlink_gen_cmd devl_gen_port; -extern const struct devlink_gen_cmd devl_gen_sb; -extern const struct devlink_gen_cmd devl_gen_sb_pool; -extern const struct devlink_gen_cmd devl_gen_sb_port_pool; -extern const struct devlink_gen_cmd devl_gen_sb_tc_pool_bind; -extern const struct devlink_gen_cmd devl_gen_selftests; -extern const struct devlink_gen_cmd devl_gen_param; -extern const struct devlink_gen_cmd devl_gen_region; -extern const struct devlink_gen_cmd devl_gen_info; -extern const struct devlink_gen_cmd devl_gen_health_reporter; -extern const struct devlink_gen_cmd devl_gen_trap; -extern const struct devlink_gen_cmd devl_gen_trap_group; -extern const struct devlink_gen_cmd devl_gen_trap_policer; -extern const struct devlink_gen_cmd devl_gen_linecard; +/* Commands */ +extern const struct devlink_cmd devl_gen_inst; +extern const struct devlink_cmd devl_gen_port; +extern const struct devlink_cmd devl_gen_sb; +extern const struct devlink_cmd devl_gen_sb_pool; +extern const struct devlink_cmd devl_gen_sb_port_pool; +extern const struct devlink_cmd devl_gen_sb_tc_pool_bind; +extern const struct devlink_cmd devl_gen_selftests; +extern const struct devlink_cmd devl_gen_param; +extern const struct devlink_cmd devl_gen_region; +extern const struct devlink_cmd devl_gen_info; +extern const struct devlink_cmd devl_gen_health_reporter; +extern const struct devlink_cmd devl_gen_trap; +extern const struct devlink_cmd devl_gen_trap_group; +extern const struct devlink_cmd devl_gen_trap_policer; +extern const struct devlink_cmd devl_gen_linecard;/* Ports */ int devlink_port_netdevice_event(struct notifier_block *nb,
@@ -182,7 +182,7 @@ struct devlink_linecard * devlink_linecard_get_from_info(struct devlink *devlink, struct genl_info *info);/* Rates */ -extern const struct devlink_gen_cmd devl_gen_rate_get; +extern const struct devlink_cmd devl_gen_rate_get;struct devlink_rate *devlink_rate_get_from_info (struct devlink *devlink,struct genl_info *info);
net/devlink/leftover.c +16 -16
@@ -1236,7 +1236,7 @@ devlink_nl_cmd_rate_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return err; } -const struct devlink_gen_cmd devl_gen_rate_get = { +const struct devlink_cmd devl_gen_rate_get = { .dump_one = devlink_nl_cmd_rate_get_dump_one, };
@@ -1303,7 +1303,7 @@ devlink_nl_cmd_get_dump_one(struct sk_buff *msg, struct devlink *devlink, cb->nlh->nlmsg_seq, NLM_F_MULTI); } -const struct devlink_gen_cmd devl_gen_inst = { +const struct devlink_cmd devl_gen_inst = { .dump_one = devlink_nl_cmd_get_dump_one, };
@@ -1359,7 +1359,7 @@ devlink_nl_cmd_port_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return err; } -const struct devlink_gen_cmd devl_gen_port = { +const struct devlink_cmd devl_gen_port = { .dump_one = devlink_nl_cmd_port_get_dump_one, };
@@ -2137,7 +2137,7 @@ static int devlink_nl_cmd_linecard_get_dump_one(struct sk_buff *msg,return err; } -const struct devlink_gen_cmd devl_gen_linecard = { +const struct devlink_cmd devl_gen_linecard = { .dump_one = devlink_nl_cmd_linecard_get_dump_one, };
@@ -2392,7 +2392,7 @@ devlink_nl_cmd_sb_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return err; } -const struct devlink_gen_cmd devl_gen_sb = { +const struct devlink_cmd devl_gen_sb = { .dump_one = devlink_nl_cmd_sb_get_dump_one, };
@@ -2530,7 +2530,7 @@ devlink_nl_cmd_sb_pool_get_dump_one(struct sk_buff *msg,return err; } -const struct devlink_gen_cmd devl_gen_sb_pool = { +const struct devlink_cmd devl_gen_sb_pool = { .dump_one = devlink_nl_cmd_sb_pool_get_dump_one, };
@@ -2738,7 +2738,7 @@ devlink_nl_cmd_sb_port_pool_get_dump_one(struct sk_buff *msg,return err; } -const struct devlink_gen_cmd devl_gen_sb_port_pool = { +const struct devlink_cmd devl_gen_sb_port_pool = { .dump_one = devlink_nl_cmd_sb_port_pool_get_dump_one, };
@@ -2973,7 +2973,7 @@ devlink_nl_cmd_sb_tc_pool_bind_get_dump_one(struct sk_buff *msg,return err; } -const struct devlink_gen_cmd devl_gen_sb_tc_pool_bind = { +const struct devlink_cmd devl_gen_sb_tc_pool_bind = { .dump_one = devlink_nl_cmd_sb_tc_pool_bind_get_dump_one, };
@@ -4785,7 +4785,7 @@ devlink_nl_cmd_selftests_get_dump_one(struct sk_buff *msg, cb->extack); } -const struct devlink_gen_cmd devl_gen_selftests = { +const struct devlink_cmd devl_gen_selftests = { .dump_one = devlink_nl_cmd_selftests_get_dump_one, };
@@ -5271,7 +5271,7 @@ devlink_nl_cmd_param_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return err; } -const struct devlink_gen_cmd devl_gen_param = { +const struct devlink_cmd devl_gen_param = { .dump_one = devlink_nl_cmd_param_get_dump_one, };
@@ -5978,7 +5978,7 @@ devlink_nl_cmd_region_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return 0 ; } -const struct devlink_gen_cmd devl_gen_region = { +const struct devlink_cmd devl_gen_region = { .dump_one = devlink_nl_cmd_region_get_dump_one, };
@@ -6625,7 +6625,7 @@ devlink_nl_cmd_info_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return err; } -const struct devlink_gen_cmd devl_gen_info = { +const struct devlink_cmd devl_gen_info = { .dump_one = devlink_nl_cmd_info_get_dump_one, };
@@ -7793,7 +7793,7 @@ devlink_nl_cmd_health_reporter_get_dump_one(struct sk_buff *msg,return 0 ; } -const struct devlink_gen_cmd devl_gen_health_reporter = { +const struct devlink_cmd devl_gen_health_reporter = { .dump_one = devlink_nl_cmd_health_reporter_get_dump_one, };
@@ -8311,7 +8311,7 @@ devlink_nl_cmd_trap_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return err; } -const struct devlink_gen_cmd devl_gen_trap = { +const struct devlink_cmd devl_gen_trap = { .dump_one = devlink_nl_cmd_trap_get_dump_one, };
@@ -8524,7 +8524,7 @@ devlink_nl_cmd_trap_group_get_dump_one(struct sk_buff *msg,return err; } -const struct devlink_gen_cmd devl_gen_trap_group = { +const struct devlink_cmd devl_gen_trap_group = { .dump_one = devlink_nl_cmd_trap_group_get_dump_one, };
@@ -8817,7 +8817,7 @@ devlink_nl_cmd_trap_policer_get_dump_one(struct sk_buff *msg,return err; } -const struct devlink_gen_cmd devl_gen_trap_policer = { +const struct devlink_cmd devl_gen_trap_policer = { .dump_one = devlink_nl_cmd_trap_policer_get_dump_one, };
net/devlink/netlink.c +2 -2
@@ -177,7 +177,7 @@ static void devlink_nl_post_doit(const struct genl_split_ops *ops,devlink_put (devlink); } -static const struct devlink_gen_cmd *devl_gen_cmds[] = { +static const struct devlink_cmd *devl_gen_cmds[] = { [DEVLINK_CMD_GET ] = &devl_gen_inst, [DEVLINK_CMD_PORT_GET ] = &devl_gen_port, [DEVLINK_CMD_SB_GET ] = &devl_gen_sb,
@@ -201,7 +201,7 @@ int devlink_nl_instance_iter_dumpit(struct sk_buff *msg, {const struct genl_dumpit_info *info =genl_dumpit_info (cb);struct devlink_nl_dump_state *state =devlink_dump_state (cb); -const struct devlink_gen_cmd *cmd; +const struct devlink_cmd *cmd;struct devlink *devlink;int err =0 ;
Signature · 1 line
2.39.0
Re: [patch net-next 2/3] devlink: remove "gen" from struct devlink_gen_cmd name
Quoted 4 lines · Jiri Pirko
From: Jiri Pirko <[email protected]>
No need to have "gen" inside name of the structure for devlink commands. Remove it.
And what about devl_gen_* names? Should they be renamed too?
Thanks
Quoted 242 lines
Signed-off-by Jiri Pirko <[email protected]>--- net/devlink/devl_internal.h | 36 ++++++++++++++++++------------------ net/devlink/leftover.c | 32 ++++++++++++++++---------------- net/devlink/netlink.c | 4 ++-- 3 files changed, 36 insertions(+), 36 deletions(-)net/devlink/devl_internal.h +18
-18@@ -115,7 +115,7 @@ struct devlink_nl_dump_state { }; }; -struct devlink_gen_cmd { +struct devlink_cmd {int (*dump_one)(struct sk_buff *msg,struct devlink *devlink,struct netlink_callback *cb); };@@ -139,22 +139,22 @@ devlink_dump_state(struct netlink_callback *cb)return (struct devlink_nl_dump_state *)cb->ctx; } -/* gen cmds */ -extern const struct devlink_gen_cmd devl_gen_inst; -extern const struct devlink_gen_cmd devl_gen_port; -extern const struct devlink_gen_cmd devl_gen_sb; -extern const struct devlink_gen_cmd devl_gen_sb_pool; -extern const struct devlink_gen_cmd devl_gen_sb_port_pool; -extern const struct devlink_gen_cmd devl_gen_sb_tc_pool_bind; -extern const struct devlink_gen_cmd devl_gen_selftests; -extern const struct devlink_gen_cmd devl_gen_param; -extern const struct devlink_gen_cmd devl_gen_region; -extern const struct devlink_gen_cmd devl_gen_info; -extern const struct devlink_gen_cmd devl_gen_health_reporter; -extern const struct devlink_gen_cmd devl_gen_trap; -extern const struct devlink_gen_cmd devl_gen_trap_group; -extern const struct devlink_gen_cmd devl_gen_trap_policer; -extern const struct devlink_gen_cmd devl_gen_linecard; +/* Commands */ +extern const struct devlink_cmd devl_gen_inst; +extern const struct devlink_cmd devl_gen_port; +extern const struct devlink_cmd devl_gen_sb; +extern const struct devlink_cmd devl_gen_sb_pool; +extern const struct devlink_cmd devl_gen_sb_port_pool; +extern const struct devlink_cmd devl_gen_sb_tc_pool_bind; +extern const struct devlink_cmd devl_gen_selftests; +extern const struct devlink_cmd devl_gen_param; +extern const struct devlink_cmd devl_gen_region; +extern const struct devlink_cmd devl_gen_info; +extern const struct devlink_cmd devl_gen_health_reporter; +extern const struct devlink_cmd devl_gen_trap; +extern const struct devlink_cmd devl_gen_trap_group; +extern const struct devlink_cmd devl_gen_trap_policer; +extern const struct devlink_cmd devl_gen_linecard;/* Ports */ int devlink_port_netdevice_event(struct notifier_block *nb,@@ -182,7 +182,7 @@ struct devlink_linecard * devlink_linecard_get_from_info(struct devlink *devlink, struct genl_info *info);/* Rates */ -extern const struct devlink_gen_cmd devl_gen_rate_get; +extern const struct devlink_cmd devl_gen_rate_get;struct devlink_rate *devlink_rate_get_from_info (struct devlink *devlink,struct genl_info *info);net/devlink/leftover.c +16
-16@@ -1236,7 +1236,7 @@ devlink_nl_cmd_rate_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return err; } -const struct devlink_gen_cmd devl_gen_rate_get = { +const struct devlink_cmd devl_gen_rate_get = { .dump_one = devlink_nl_cmd_rate_get_dump_one, };@@ -1303,7 +1303,7 @@ devlink_nl_cmd_get_dump_one(struct sk_buff *msg, struct devlink *devlink, cb->nlh->nlmsg_seq, NLM_F_MULTI); } -const struct devlink_gen_cmd devl_gen_inst = { +const struct devlink_cmd devl_gen_inst = { .dump_one = devlink_nl_cmd_get_dump_one, };@@ -1359,7 +1359,7 @@ devlink_nl_cmd_port_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return err; } -const struct devlink_gen_cmd devl_gen_port = { +const struct devlink_cmd devl_gen_port = { .dump_one = devlink_nl_cmd_port_get_dump_one, };@@ -2137,7 +2137,7 @@ static int devlink_nl_cmd_linecard_get_dump_one(struct sk_buff *msg,return err; } -const struct devlink_gen_cmd devl_gen_linecard = { +const struct devlink_cmd devl_gen_linecard = { .dump_one = devlink_nl_cmd_linecard_get_dump_one, };@@ -2392,7 +2392,7 @@ devlink_nl_cmd_sb_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return err; } -const struct devlink_gen_cmd devl_gen_sb = { +const struct devlink_cmd devl_gen_sb = { .dump_one = devlink_nl_cmd_sb_get_dump_one, };@@ -2530,7 +2530,7 @@ devlink_nl_cmd_sb_pool_get_dump_one(struct sk_buff *msg,return err; } -const struct devlink_gen_cmd devl_gen_sb_pool = { +const struct devlink_cmd devl_gen_sb_pool = { .dump_one = devlink_nl_cmd_sb_pool_get_dump_one, };@@ -2738,7 +2738,7 @@ devlink_nl_cmd_sb_port_pool_get_dump_one(struct sk_buff *msg,return err; } -const struct devlink_gen_cmd devl_gen_sb_port_pool = { +const struct devlink_cmd devl_gen_sb_port_pool = { .dump_one = devlink_nl_cmd_sb_port_pool_get_dump_one, };@@ -2973,7 +2973,7 @@ devlink_nl_cmd_sb_tc_pool_bind_get_dump_one(struct sk_buff *msg,return err; } -const struct devlink_gen_cmd devl_gen_sb_tc_pool_bind = { +const struct devlink_cmd devl_gen_sb_tc_pool_bind = { .dump_one = devlink_nl_cmd_sb_tc_pool_bind_get_dump_one, };@@ -4785,7 +4785,7 @@ devlink_nl_cmd_selftests_get_dump_one(struct sk_buff *msg, cb->extack); } -const struct devlink_gen_cmd devl_gen_selftests = { +const struct devlink_cmd devl_gen_selftests = { .dump_one = devlink_nl_cmd_selftests_get_dump_one, };@@ -5271,7 +5271,7 @@ devlink_nl_cmd_param_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return err; } -const struct devlink_gen_cmd devl_gen_param = { +const struct devlink_cmd devl_gen_param = { .dump_one = devlink_nl_cmd_param_get_dump_one, };@@ -5978,7 +5978,7 @@ devlink_nl_cmd_region_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return 0 ; } -const struct devlink_gen_cmd devl_gen_region = { +const struct devlink_cmd devl_gen_region = { .dump_one = devlink_nl_cmd_region_get_dump_one, };@@ -6625,7 +6625,7 @@ devlink_nl_cmd_info_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return err; } -const struct devlink_gen_cmd devl_gen_info = { +const struct devlink_cmd devl_gen_info = { .dump_one = devlink_nl_cmd_info_get_dump_one, };@@ -7793,7 +7793,7 @@ devlink_nl_cmd_health_reporter_get_dump_one(struct sk_buff *msg,return 0 ; } -const struct devlink_gen_cmd devl_gen_health_reporter = { +const struct devlink_cmd devl_gen_health_reporter = { .dump_one = devlink_nl_cmd_health_reporter_get_dump_one, };@@ -8311,7 +8311,7 @@ devlink_nl_cmd_trap_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return err; } -const struct devlink_gen_cmd devl_gen_trap = { +const struct devlink_cmd devl_gen_trap = { .dump_one = devlink_nl_cmd_trap_get_dump_one, };@@ -8524,7 +8524,7 @@ devlink_nl_cmd_trap_group_get_dump_one(struct sk_buff *msg,return err; } -const struct devlink_gen_cmd devl_gen_trap_group = { +const struct devlink_cmd devl_gen_trap_group = { .dump_one = devlink_nl_cmd_trap_group_get_dump_one, };@@ -8817,7 +8817,7 @@ devlink_nl_cmd_trap_policer_get_dump_one(struct sk_buff *msg,return err; } -const struct devlink_gen_cmd devl_gen_trap_policer = { +const struct devlink_cmd devl_gen_trap_policer = { .dump_one = devlink_nl_cmd_trap_policer_get_dump_one, };net/devlink/netlink.c +2
-2@@ -177,7 +177,7 @@ static void devlink_nl_post_doit(const struct genl_split_ops *ops,devlink_put (devlink); } -static const struct devlink_gen_cmd *devl_gen_cmds[] = { +static const struct devlink_cmd *devl_gen_cmds[] = { [DEVLINK_CMD_GET ] = &devl_gen_inst, [DEVLINK_CMD_PORT_GET ] = &devl_gen_port, [DEVLINK_CMD_SB_GET ] = &devl_gen_sb,@@ -201,7 +201,7 @@ int devlink_nl_instance_iter_dumpit(struct sk_buff *msg, {const struct genl_dumpit_info *info =genl_dumpit_info (cb);struct devlink_nl_dump_state *state =devlink_dump_state (cb); -const struct devlink_gen_cmd *cmd; +const struct devlink_cmd *cmd;struct devlink *devlink;int err =0 ;Signature · 1 line
2.39.0
Jiri Pirko
maintainerRe: [patch net-next 2/3] devlink: remove "gen" from struct devlink_gen_cmd name
Quoted 7 lines · Tue, Jan 31, 2023 at 12:51:47PM CET, [email protected] wrote:
Quoted 4 lines · Jiri Pirko
From: Jiri Pirko <[email protected]>
No need to have "gen" inside name of the structure for devlink commands. Remove it.
And what about devl_gen_* names? Should they be renamed too?
Yep, see the next patch :)
Re: [patch net-next 2/3] devlink: remove "gen" from struct devlink_gen_cmd name
Quoted 10 lines · Jiri Pirko
Quoted 7 lines · Tue, Jan 31, 2023 at 12:51:47PM CET, [email protected] wrote:
Quoted 4 lines · Jiri Pirko
From: Jiri Pirko <[email protected]>
No need to have "gen" inside name of the structure for devlink commands. Remove it.
And what about devl_gen_* names? Should they be renamed too?
Yep, see the next patch :)
Ohh, I would organize them differently.
Thanks
Jiri Pirko
maintainerRe: [patch net-next 2/3] devlink: remove "gen" from struct devlink_gen_cmd name
Quoted 5 lines · Tue, Jan 31, 2023 at 12:57:56PM CET, [email protected] wrote:
Quoted 4 lines · Jiri Pirko
Quoted 3 lines · Tue, Jan 31, 2023 at 12:51:47PM CET, [email protected] wrote:
Quoted 2 lines · Jiri Pirko
From: Jiri Pirko <[email protected]>
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
No need to have "gen" inside name of the structure for devlink commands. Remove it.
And what about devl_gen_* names? Should they be renamed too?
Yep, see the next patch :)
Ohh, I would organize them differently.
I wanted to rename the variable names once. That's why I have it in the next patch.
Quoted 2 lines
Thanks
Jiri Pirko
maintainerPATCH 3/3 devlink: rename and reorder instances of struct devlink_cmd
In reply to Jiri PirkoFrom: Jiri Pirko <[email protected]>
In order to maintain naming consistency, rename and reorder all usages of struct struct devlink_cmd in the following way:
1) Remove "gen" and replace it with "cmd" to match the struct name
2) Order devl_cmds[] and the header file to match the order of enum devlink_command
3) Move devl_cmd_rate_get among the peers
4) Remove "inst" for DEVLINK_CMD_GET
5) Add "_get" suffix to all to match DEVLINK_CMD_*_GET (only rate had it done correctly)
--- net/devlink/devl_internal.h | 33 ++++++++++++++++----------------- net/devlink/leftover.c | 32 ++++++++++++++++---------------- net/devlink/netlink.c | 36 ++++++++++++++++++------------------ 3 files changed, 50 insertions(+), 51 deletions(-)
net/devlink/devl_internal.h +16 -17
@@ -140,21 +140,22 @@ devlink_dump_state(struct netlink_callback *cb) }/* Commands */ -extern const struct devlink_cmd devl_gen_inst; -extern const struct devlink_cmd devl_gen_port; -extern const struct devlink_cmd devl_gen_sb; -extern const struct devlink_cmd devl_gen_sb_pool; -extern const struct devlink_cmd devl_gen_sb_port_pool; -extern const struct devlink_cmd devl_gen_sb_tc_pool_bind; -extern const struct devlink_cmd devl_gen_selftests; -extern const struct devlink_cmd devl_gen_param; -extern const struct devlink_cmd devl_gen_region; -extern const struct devlink_cmd devl_gen_info; -extern const struct devlink_cmd devl_gen_health_reporter; -extern const struct devlink_cmd devl_gen_trap; -extern const struct devlink_cmd devl_gen_trap_group; -extern const struct devlink_cmd devl_gen_trap_policer; -extern const struct devlink_cmd devl_gen_linecard; +extern const struct devlink_cmd devl_cmd_get; +extern const struct devlink_cmd devl_cmd_port_get; +extern const struct devlink_cmd devl_cmd_sb_get; +extern const struct devlink_cmd devl_cmd_sb_pool_get; +extern const struct devlink_cmd devl_cmd_sb_port_pool_get; +extern const struct devlink_cmd devl_cmd_sb_tc_pool_bind_get; +extern const struct devlink_cmd devl_cmd_param_get; +extern const struct devlink_cmd devl_cmd_region_get; +extern const struct devlink_cmd devl_cmd_info_get; +extern const struct devlink_cmd devl_cmd_health_reporter_get; +extern const struct devlink_cmd devl_cmd_trap_get; +extern const struct devlink_cmd devl_cmd_trap_group_get; +extern const struct devlink_cmd devl_cmd_trap_policer_get; +extern const struct devlink_cmd devl_cmd_rate_get; +extern const struct devlink_cmd devl_cmd_linecard_get; +extern const struct devlink_cmd devl_cmd_selftests_get;/* Ports */ int devlink_port_netdevice_event(struct notifier_block *nb,
@@ -182,8 +183,6 @@ struct devlink_linecard * devlink_linecard_get_from_info(struct devlink *devlink, struct genl_info *info);/* Rates */ -extern const struct devlink_cmd devl_gen_rate_get; -struct devlink_rate *devlink_rate_get_from_info (struct devlink *devlink,struct genl_info *info); struct devlink_rate *
net/devlink/leftover.c +16 -16
@@ -1236,7 +1236,7 @@ devlink_nl_cmd_rate_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return err; } -const struct devlink_cmd devl_gen_rate_get = { +const struct devlink_cmd devl_cmd_rate_get = { .dump_one = devlink_nl_cmd_rate_get_dump_one, };
@@ -1303,7 +1303,7 @@ devlink_nl_cmd_get_dump_one(struct sk_buff *msg, struct devlink *devlink, cb->nlh->nlmsg_seq, NLM_F_MULTI); } -const struct devlink_cmd devl_gen_inst = { +const struct devlink_cmd devl_cmd_get = { .dump_one = devlink_nl_cmd_get_dump_one, };
@@ -1359,7 +1359,7 @@ devlink_nl_cmd_port_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return err; } -const struct devlink_cmd devl_gen_port = { +const struct devlink_cmd devl_cmd_port_get = { .dump_one = devlink_nl_cmd_port_get_dump_one, };
@@ -2137,7 +2137,7 @@ static int devlink_nl_cmd_linecard_get_dump_one(struct sk_buff *msg,return err; } -const struct devlink_cmd devl_gen_linecard = { +const struct devlink_cmd devl_cmd_linecard_get = { .dump_one = devlink_nl_cmd_linecard_get_dump_one, };
@@ -2392,7 +2392,7 @@ devlink_nl_cmd_sb_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return err; } -const struct devlink_cmd devl_gen_sb = { +const struct devlink_cmd devl_cmd_sb_get = { .dump_one = devlink_nl_cmd_sb_get_dump_one, };
@@ -2530,7 +2530,7 @@ devlink_nl_cmd_sb_pool_get_dump_one(struct sk_buff *msg,return err; } -const struct devlink_cmd devl_gen_sb_pool = { +const struct devlink_cmd devl_cmd_sb_pool_get = { .dump_one = devlink_nl_cmd_sb_pool_get_dump_one, };
@@ -2738,7 +2738,7 @@ devlink_nl_cmd_sb_port_pool_get_dump_one(struct sk_buff *msg,return err; } -const struct devlink_cmd devl_gen_sb_port_pool = { +const struct devlink_cmd devl_cmd_sb_port_pool_get = { .dump_one = devlink_nl_cmd_sb_port_pool_get_dump_one, };
@@ -2973,7 +2973,7 @@ devlink_nl_cmd_sb_tc_pool_bind_get_dump_one(struct sk_buff *msg,return err; } -const struct devlink_cmd devl_gen_sb_tc_pool_bind = { +const struct devlink_cmd devl_cmd_sb_tc_pool_bind_get = { .dump_one = devlink_nl_cmd_sb_tc_pool_bind_get_dump_one, };
@@ -4785,7 +4785,7 @@ devlink_nl_cmd_selftests_get_dump_one(struct sk_buff *msg, cb->extack); } -const struct devlink_cmd devl_gen_selftests = { +const struct devlink_cmd devl_cmd_selftests_get = { .dump_one = devlink_nl_cmd_selftests_get_dump_one, };
@@ -5271,7 +5271,7 @@ devlink_nl_cmd_param_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return err; } -const struct devlink_cmd devl_gen_param = { +const struct devlink_cmd devl_cmd_param_get = { .dump_one = devlink_nl_cmd_param_get_dump_one, };
@@ -5978,7 +5978,7 @@ devlink_nl_cmd_region_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return 0 ; } -const struct devlink_cmd devl_gen_region = { +const struct devlink_cmd devl_cmd_region_get = { .dump_one = devlink_nl_cmd_region_get_dump_one, };
@@ -6625,7 +6625,7 @@ devlink_nl_cmd_info_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return err; } -const struct devlink_cmd devl_gen_info = { +const struct devlink_cmd devl_cmd_info_get = { .dump_one = devlink_nl_cmd_info_get_dump_one, };
@@ -7793,7 +7793,7 @@ devlink_nl_cmd_health_reporter_get_dump_one(struct sk_buff *msg,return 0 ; } -const struct devlink_cmd devl_gen_health_reporter = { +const struct devlink_cmd devl_cmd_health_reporter_get = { .dump_one = devlink_nl_cmd_health_reporter_get_dump_one, };
@@ -8311,7 +8311,7 @@ devlink_nl_cmd_trap_get_dump_one(struct sk_buff *msg, struct devlink *devlink,return err; } -const struct devlink_cmd devl_gen_trap = { +const struct devlink_cmd devl_cmd_trap_get = { .dump_one = devlink_nl_cmd_trap_get_dump_one, };
@@ -8524,7 +8524,7 @@ devlink_nl_cmd_trap_group_get_dump_one(struct sk_buff *msg,return err; } -const struct devlink_cmd devl_gen_trap_group = { +const struct devlink_cmd devl_cmd_trap_group_get = { .dump_one = devlink_nl_cmd_trap_group_get_dump_one, };
@@ -8817,7 +8817,7 @@ devlink_nl_cmd_trap_policer_get_dump_one(struct sk_buff *msg,return err; } -const struct devlink_cmd devl_gen_trap_policer = { +const struct devlink_cmd devl_cmd_trap_policer_get = { .dump_one = devlink_nl_cmd_trap_policer_get_dump_one, };
net/devlink/netlink.c +18 -18
@@ -177,23 +177,23 @@ static void devlink_nl_post_doit(const struct genl_split_ops *ops,devlink_put (devlink); } -static const struct devlink_cmd *devl_gen_cmds[] = { - [DEVLINK_CMD_GET ] = &devl_gen_inst, - [DEVLINK_CMD_PORT_GET ] = &devl_gen_port, - [DEVLINK_CMD_SB_GET ] = &devl_gen_sb, - [DEVLINK_CMD_SB_POOL_GET ] = &devl_gen_sb_pool, - [DEVLINK_CMD_SB_PORT_POOL_GET ] = &devl_gen_sb_port_pool, - [DEVLINK_CMD_SB_TC_POOL_BIND_GET ] = &devl_gen_sb_tc_pool_bind, - [DEVLINK_CMD_PARAM_GET ] = &devl_gen_param, - [DEVLINK_CMD_REGION_GET ] = &devl_gen_region, - [DEVLINK_CMD_INFO_GET ] = &devl_gen_info, - [DEVLINK_CMD_HEALTH_REPORTER_GET ] = &devl_gen_health_reporter, - [DEVLINK_CMD_RATE_GET ] = &devl_gen_rate_get, - [DEVLINK_CMD_TRAP_GET ] = &devl_gen_trap, - [DEVLINK_CMD_TRAP_GROUP_GET ] = &devl_gen_trap_group, - [DEVLINK_CMD_TRAP_POLICER_GET ] = &devl_gen_trap_policer, - [DEVLINK_CMD_LINECARD_GET ] = &devl_gen_linecard, - [DEVLINK_CMD_SELFTESTS_GET ] = &devl_gen_selftests, +static const struct devlink_cmd *devl_cmds[] = { + [DEVLINK_CMD_GET ] = &devl_cmd_get, + [DEVLINK_CMD_PORT_GET ] = &devl_cmd_port_get, + [DEVLINK_CMD_SB_GET ] = &devl_cmd_sb_get, + [DEVLINK_CMD_SB_POOL_GET ] = &devl_cmd_sb_pool_get, + [DEVLINK_CMD_SB_PORT_POOL_GET ] = &devl_cmd_sb_port_pool_get, + [DEVLINK_CMD_SB_TC_POOL_BIND_GET ] = &devl_cmd_sb_tc_pool_bind_get, + [DEVLINK_CMD_PARAM_GET ] = &devl_cmd_param_get, + [DEVLINK_CMD_REGION_GET ] = &devl_cmd_region_get, + [DEVLINK_CMD_INFO_GET ] = &devl_cmd_info_get, + [DEVLINK_CMD_HEALTH_REPORTER_GET ] = &devl_cmd_health_reporter_get, + [DEVLINK_CMD_TRAP_GET ] = &devl_cmd_trap_get, + [DEVLINK_CMD_TRAP_GROUP_GET ] = &devl_cmd_trap_group_get, + [DEVLINK_CMD_TRAP_POLICER_GET ] = &devl_cmd_trap_policer_get, + [DEVLINK_CMD_RATE_GET ] = &devl_cmd_rate_get, + [DEVLINK_CMD_LINECARD_GET ] = &devl_cmd_linecard_get, + [DEVLINK_CMD_SELFTESTS_GET ] = &devl_cmd_selftests_get, }; int devlink_nl_instance_iter_dumpit(struct sk_buff *msg,
@@ -205,7 +205,7 @@ int devlink_nl_instance_iter_dumpit(struct sk_buff *msg,struct devlink *devlink;int err =0 ; - cmd = devl_gen_cmds[info->op.cmd]; + cmd = devl_cmds[info->op.cmd];while ((devlink =devlinks_xa_find_get (sock_net (msg->sk), &state->instance))) {
Signature · 1 line
2.39.0
Quoted 11 lines · Jiri Pirko
From: Jiri Pirko <[email protected]>
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.
Jiri Pirko (3):
devlink: renamedevlink_nl_instance_iter_dump()to "dumpit"
devlink: remove "gen" from structdevlink_gen_cmdname
devlink: rename and reorder instances of structdevlink_cmd
Thanks,
Jacob Keller
Reviewed-byQuoted 7 lines · Leon Romanovsky
Quoted 6 lines · Jiri Pirko
From: Jiri Pirko <[email protected]>
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.
Quoted 8 lines
Quoted 5 lines
Jiri Pirko (3):
devlink: renamedevlink_nl_instance_iter_dump()to "dumpit"
devlink: remove "gen" from structdevlink_gen_cmdname
devlink: rename and reorder instances of structdevlink_cmdThanks,
Reviewed-by Leon Romanovsky <[email protected]>
I like these name cleanups as well.
Thanks,
Jake
Jakub Kicinski
maintainerQuoted 3 lines · On Tue, 31 Jan 2023 10:06:10 +0100 Jiri Pirko wrote:
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.
What's the weakest form of ack?
? ;)
Jiri Pirko
maintainerQuoted 8 lines · Wed, Feb 01, 2023 at 06:18:13AM CET, [email protected] wrote:
Quoted 3 lines · On Tue, 31 Jan 2023 10:06:10 +0100 Jiri Pirko wrote:
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.
What's the weakest form of ack?
Thanks for looking :D
This series was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Quoted 6 lines · On Tue, 31 Jan 2023 10:06:10 +0100 you wrote:
From: Jiri Pirko <[email protected]>
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.
Quoted 6 lines
Jiri Pirko (3):
devlink: renamedevlink_nl_instance_iter_dump()to "dumpit"
devlink: remove "gen" from structdevlink_gen_cmdname
devlink: rename and reorder instances of structdevlink_cmd[...]
Here is the summary with links:
- [net-next,1/3] devlink: rename devlink_nl_instance_iter_dump() to "dumpit"
https://git.kernel.org/netdev/net-next/c/c3a4fd5718ea - [net-next,2/3] devlink: remove "gen" from struct devlink_gen_cmd name https://git.kernel.org/netdev/net-next/c/f87445953d4c - [net-next,3/3] devlink: rename and reorder instances of struct devlink_cmd https://git.kernel.org/netdev/net-next/c/8589ba4e642a
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html