summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJiri Pirko <jiri@nvidia.com>2023-08-11 17:57:10 +0200
committerJakub Kicinski <kuba@kernel.org>2023-08-14 11:47:25 -0700
commit833e479d330c29aa4cfd35b8647d5993d5a78643 (patch)
treee30bda93caf41cb6f1ee56b5a135d3c6428d54a1 /net
parentddff283280ba0a6b84929f357859f7ea74cecfbe (diff)
devlink: remove converted commands from small ops
As the commands are already defined in split ops, remove them from small ops. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Link: https://lore.kernel.org/r/20230811155714.1736405-10-jiri@resnulli.us Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/devlink/devl_internal.h2
-rw-r--r--net/devlink/leftover.c99
2 files changed, 3 insertions, 98 deletions
diff --git a/net/devlink/devl_internal.h b/net/devlink/devl_internal.h
index 7caa385703de..eb1d5066c73f 100644
--- a/net/devlink/devl_internal.h
+++ b/net/devlink/devl_internal.h
@@ -118,7 +118,7 @@ typedef int devlink_nl_dump_one_func_t(struct sk_buff *msg,
struct netlink_callback *cb,
int flags);
-extern const struct genl_small_ops devlink_nl_small_ops[54];
+extern const struct genl_small_ops devlink_nl_small_ops[40];
struct devlink *
devlink_get_from_attrs_lock(struct net *net, struct nlattr **attrs);
diff --git a/net/devlink/leftover.c b/net/devlink/leftover.c
index 883c65545d26..3883a90d32bb 100644
--- a/net/devlink/leftover.c
+++ b/net/devlink/leftover.c
@@ -6307,15 +6307,7 @@ static int devlink_nl_cmd_trap_policer_set_doit(struct sk_buff *skb,
return devlink_trap_policer_set(devlink, policer_item, info);
}
-const struct genl_small_ops devlink_nl_small_ops[54] = {
- {
- .cmd = DEVLINK_CMD_PORT_GET,
- .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .doit = devlink_nl_port_get_doit,
- .dumpit = devlink_nl_port_get_dumpit,
- .internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
- /* can be retrieved by unprivileged users */
- },
+const struct genl_small_ops devlink_nl_small_ops[40] = {
{
.cmd = DEVLINK_CMD_PORT_SET,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
@@ -6324,12 +6316,6 @@ const struct genl_small_ops devlink_nl_small_ops[54] = {
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
},
{
- .cmd = DEVLINK_CMD_RATE_GET,
- .doit = devlink_nl_rate_get_doit,
- .dumpit = devlink_nl_rate_get_dumpit,
- /* can be retrieved by unprivileged users */
- },
- {
.cmd = DEVLINK_CMD_RATE_SET,
.doit = devlink_nl_cmd_rate_set_doit,
.flags = GENL_ADMIN_PERM,
@@ -6369,46 +6355,19 @@ const struct genl_small_ops devlink_nl_small_ops[54] = {
.flags = GENL_ADMIN_PERM,
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
},
- {
- .cmd = DEVLINK_CMD_LINECARD_GET,
- .doit = devlink_nl_linecard_get_doit,
- .dumpit = devlink_nl_linecard_get_dumpit,
- /* can be retrieved by unprivileged users */
- },
+
{
.cmd = DEVLINK_CMD_LINECARD_SET,
.doit = devlink_nl_cmd_linecard_set_doit,
.flags = GENL_ADMIN_PERM,
},
{
- .cmd = DEVLINK_CMD_SB_GET,
- .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .doit = devlink_nl_sb_get_doit,
- .dumpit = devlink_nl_sb_get_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_sb_pool_get_doit,
- .dumpit = devlink_nl_sb_pool_get_dumpit,
- /* can be retrieved by unprivileged users */
- },
- {
.cmd = DEVLINK_CMD_SB_POOL_SET,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
.doit = devlink_nl_cmd_sb_pool_set_doit,
.flags = GENL_ADMIN_PERM,
},
{
- .cmd = DEVLINK_CMD_SB_PORT_POOL_GET,
- .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .doit = devlink_nl_sb_port_pool_get_doit,
- .dumpit = devlink_nl_sb_port_pool_get_dumpit,
- .internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
- /* can be retrieved by unprivileged users */
- },
- {
.cmd = DEVLINK_CMD_SB_PORT_POOL_SET,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
.doit = devlink_nl_cmd_sb_port_pool_set_doit,
@@ -6416,14 +6375,6 @@ const struct genl_small_ops devlink_nl_small_ops[54] = {
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
},
{
- .cmd = DEVLINK_CMD_SB_TC_POOL_BIND_GET,
- .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .doit = devlink_nl_sb_tc_pool_bind_get_doit,
- .dumpit = devlink_nl_sb_tc_pool_bind_get_dumpit,
- .internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
- /* can be retrieved by unprivileged users */
- },
- {
.cmd = DEVLINK_CMD_SB_TC_POOL_BIND_SET,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
.doit = devlink_nl_cmd_sb_tc_pool_bind_set_doit,
@@ -6497,13 +6448,6 @@ const struct genl_small_ops devlink_nl_small_ops[54] = {
.flags = GENL_ADMIN_PERM,
},
{
- .cmd = DEVLINK_CMD_PARAM_GET,
- .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .doit = devlink_nl_param_get_doit,
- .dumpit = devlink_nl_param_get_dumpit,
- /* can be retrieved by unprivileged users */
- },
- {
.cmd = DEVLINK_CMD_PARAM_SET,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
.doit = devlink_nl_cmd_param_set_doit,
@@ -6525,13 +6469,6 @@ const struct genl_small_ops devlink_nl_small_ops[54] = {
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
},
{
- .cmd = DEVLINK_CMD_REGION_GET,
- .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .doit = devlink_nl_region_get_doit,
- .dumpit = devlink_nl_region_get_dumpit,
- .flags = GENL_ADMIN_PERM,
- },
- {
.cmd = DEVLINK_CMD_REGION_NEW,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
.doit = devlink_nl_cmd_region_new,
@@ -6551,14 +6488,6 @@ const struct genl_small_ops devlink_nl_small_ops[54] = {
.flags = GENL_ADMIN_PERM,
},
{
- .cmd = DEVLINK_CMD_HEALTH_REPORTER_GET,
- .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .doit = devlink_nl_health_reporter_get_doit,
- .dumpit = devlink_nl_health_reporter_get_dumpit,
- .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK_OR_PORT,
- /* can be retrieved by unprivileged users */
- },
- {
.cmd = DEVLINK_CMD_HEALTH_REPORTER_SET,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
.doit = devlink_nl_cmd_health_reporter_set_doit,
@@ -6607,45 +6536,21 @@ const struct genl_small_ops devlink_nl_small_ops[54] = {
.flags = GENL_ADMIN_PERM,
},
{
- .cmd = DEVLINK_CMD_TRAP_GET,
- .doit = devlink_nl_trap_get_doit,
- .dumpit = devlink_nl_trap_get_dumpit,
- /* can be retrieved by unprivileged users */
- },
- {
.cmd = DEVLINK_CMD_TRAP_SET,
.doit = devlink_nl_cmd_trap_set_doit,
.flags = GENL_ADMIN_PERM,
},
{
- .cmd = DEVLINK_CMD_TRAP_GROUP_GET,
- .doit = devlink_nl_trap_group_get_doit,
- .dumpit = devlink_nl_trap_group_get_dumpit,
- /* can be retrieved by unprivileged users */
- },
- {
.cmd = DEVLINK_CMD_TRAP_GROUP_SET,
.doit = devlink_nl_cmd_trap_group_set_doit,
.flags = GENL_ADMIN_PERM,
},
{
- .cmd = DEVLINK_CMD_TRAP_POLICER_GET,
- .doit = devlink_nl_trap_policer_get_doit,
- .dumpit = devlink_nl_trap_policer_get_dumpit,
- /* can be retrieved by unprivileged users */
- },
- {
.cmd = DEVLINK_CMD_TRAP_POLICER_SET,
.doit = devlink_nl_cmd_trap_policer_set_doit,
.flags = GENL_ADMIN_PERM,
},
{
- .cmd = DEVLINK_CMD_SELFTESTS_GET,
- .doit = devlink_nl_selftests_get_doit,
- .dumpit = devlink_nl_selftests_get_dumpit,
- /* can be retrieved by unprivileged users */
- },
- {
.cmd = DEVLINK_CMD_SELFTESTS_RUN,
.doit = devlink_nl_cmd_selftests_run,
.flags = GENL_ADMIN_PERM,