mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-22 16:06:04 -05:00
devlink: move small_ops definition into netlink.c
Move the generic netlink small_ops definition where they are consumed, into netlink.c Signed-off-by: Jiri Pirko <jiri@nvidia.com> Link: https://lore.kernel.org/r/20230828061657.300667-15-jiri@resnulli.us Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
890c556674
commit
29a390d177
3 changed files with 251 additions and 253 deletions
|
@ -121,8 +121,6 @@ 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[40];
|
||||
|
||||
struct devlink *
|
||||
devlink_get_from_attrs_lock(struct net *net, struct nlattr **attrs);
|
||||
|
||||
|
|
|
@ -31,257 +31,6 @@
|
|||
|
||||
#include "devl_internal.h"
|
||||
|
||||
const struct genl_small_ops devlink_nl_small_ops[40] = {
|
||||
{
|
||||
.cmd = DEVLINK_CMD_PORT_SET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_port_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_RATE_SET,
|
||||
.doit = devlink_nl_cmd_rate_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_RATE_NEW,
|
||||
.doit = devlink_nl_cmd_rate_new_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_RATE_DEL,
|
||||
.doit = devlink_nl_cmd_rate_del_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_PORT_SPLIT,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_port_split_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_PORT_UNSPLIT,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_port_unsplit_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_PORT_NEW,
|
||||
.doit = devlink_nl_cmd_port_new_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_PORT_DEL,
|
||||
.doit = devlink_nl_cmd_port_del_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
|
||||
},
|
||||
|
||||
{
|
||||
.cmd = DEVLINK_CMD_LINECARD_SET,
|
||||
.doit = devlink_nl_cmd_linecard_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.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_SET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_sb_port_pool_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
|
||||
},
|
||||
{
|
||||
.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,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_SB_OCC_SNAPSHOT,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_sb_occ_snapshot_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_SB_OCC_MAX_CLEAR,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_sb_occ_max_clear_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_ESWITCH_GET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_eswitch_get_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_ESWITCH_SET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_eswitch_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_DPIPE_TABLE_GET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_dpipe_table_get,
|
||||
/* can be retrieved by unprivileged users */
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_DPIPE_ENTRIES_GET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_dpipe_entries_get,
|
||||
/* can be retrieved by unprivileged users */
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_DPIPE_HEADERS_GET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_dpipe_headers_get,
|
||||
/* can be retrieved by unprivileged users */
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_dpipe_table_counters_set,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_RESOURCE_SET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_resource_set,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_RESOURCE_DUMP,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_resource_dump,
|
||||
/* can be retrieved by unprivileged users */
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_RELOAD,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_reload,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_PARAM_SET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_param_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_PORT_PARAM_GET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_port_param_get_doit,
|
||||
.dumpit = devlink_nl_cmd_port_param_get_dumpit,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
|
||||
/* can be retrieved by unprivileged users */
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_PORT_PARAM_SET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_port_param_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_REGION_NEW,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_region_new,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_REGION_DEL,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_region_del,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_REGION_READ,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT |
|
||||
GENL_DONT_VALIDATE_DUMP_STRICT,
|
||||
.dumpit = devlink_nl_cmd_region_read_dumpit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_HEALTH_REPORTER_SET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_health_reporter_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK_OR_PORT,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_HEALTH_REPORTER_RECOVER,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_health_reporter_recover_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK_OR_PORT,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_HEALTH_REPORTER_DIAGNOSE,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_health_reporter_diagnose_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK_OR_PORT,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT |
|
||||
GENL_DONT_VALIDATE_DUMP_STRICT,
|
||||
.dumpit = devlink_nl_cmd_health_reporter_dump_get_dumpit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_HEALTH_REPORTER_DUMP_CLEAR,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_health_reporter_dump_clear_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK_OR_PORT,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_HEALTH_REPORTER_TEST,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_health_reporter_test_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK_OR_PORT,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_FLASH_UPDATE,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_flash_update,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_TRAP_SET,
|
||||
.doit = devlink_nl_cmd_trap_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_TRAP_GROUP_SET,
|
||||
.doit = devlink_nl_cmd_trap_group_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_TRAP_POLICER_SET,
|
||||
.doit = devlink_nl_cmd_trap_policer_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_SELFTESTS_RUN,
|
||||
.doit = devlink_nl_cmd_selftests_run,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
/* -- No new ops here! Use split ops going forward! -- */
|
||||
};
|
||||
|
||||
void devlink_notify_register(struct devlink *devlink)
|
||||
{
|
||||
devlink_notify(devlink, DEVLINK_CMD_NEW);
|
||||
|
|
|
@ -255,6 +255,257 @@ int devlink_nl_dumpit(struct sk_buff *msg, struct netlink_callback *cb,
|
|||
return devlink_nl_inst_iter_dumpit(msg, cb, flags, dump_one);
|
||||
}
|
||||
|
||||
static const struct genl_small_ops devlink_nl_small_ops[40] = {
|
||||
{
|
||||
.cmd = DEVLINK_CMD_PORT_SET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_port_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_RATE_SET,
|
||||
.doit = devlink_nl_cmd_rate_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_RATE_NEW,
|
||||
.doit = devlink_nl_cmd_rate_new_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_RATE_DEL,
|
||||
.doit = devlink_nl_cmd_rate_del_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_PORT_SPLIT,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_port_split_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_PORT_UNSPLIT,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_port_unsplit_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_PORT_NEW,
|
||||
.doit = devlink_nl_cmd_port_new_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_PORT_DEL,
|
||||
.doit = devlink_nl_cmd_port_del_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
|
||||
},
|
||||
|
||||
{
|
||||
.cmd = DEVLINK_CMD_LINECARD_SET,
|
||||
.doit = devlink_nl_cmd_linecard_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.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_SET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_sb_port_pool_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
|
||||
},
|
||||
{
|
||||
.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,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_SB_OCC_SNAPSHOT,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_sb_occ_snapshot_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_SB_OCC_MAX_CLEAR,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_sb_occ_max_clear_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_ESWITCH_GET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_eswitch_get_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_ESWITCH_SET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_eswitch_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_DPIPE_TABLE_GET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_dpipe_table_get,
|
||||
/* can be retrieved by unprivileged users */
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_DPIPE_ENTRIES_GET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_dpipe_entries_get,
|
||||
/* can be retrieved by unprivileged users */
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_DPIPE_HEADERS_GET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_dpipe_headers_get,
|
||||
/* can be retrieved by unprivileged users */
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_dpipe_table_counters_set,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_RESOURCE_SET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_resource_set,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_RESOURCE_DUMP,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_resource_dump,
|
||||
/* can be retrieved by unprivileged users */
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_RELOAD,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_reload,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_PARAM_SET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_param_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_PORT_PARAM_GET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_port_param_get_doit,
|
||||
.dumpit = devlink_nl_cmd_port_param_get_dumpit,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
|
||||
/* can be retrieved by unprivileged users */
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_PORT_PARAM_SET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_port_param_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_PORT,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_REGION_NEW,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_region_new,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_REGION_DEL,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_region_del,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_REGION_READ,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT |
|
||||
GENL_DONT_VALIDATE_DUMP_STRICT,
|
||||
.dumpit = devlink_nl_cmd_region_read_dumpit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_HEALTH_REPORTER_SET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_health_reporter_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK_OR_PORT,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_HEALTH_REPORTER_RECOVER,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_health_reporter_recover_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK_OR_PORT,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_HEALTH_REPORTER_DIAGNOSE,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_health_reporter_diagnose_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK_OR_PORT,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT |
|
||||
GENL_DONT_VALIDATE_DUMP_STRICT,
|
||||
.dumpit = devlink_nl_cmd_health_reporter_dump_get_dumpit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_HEALTH_REPORTER_DUMP_CLEAR,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_health_reporter_dump_clear_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK_OR_PORT,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_HEALTH_REPORTER_TEST,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_health_reporter_test_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK_OR_PORT,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_FLASH_UPDATE,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = devlink_nl_cmd_flash_update,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_TRAP_SET,
|
||||
.doit = devlink_nl_cmd_trap_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_TRAP_GROUP_SET,
|
||||
.doit = devlink_nl_cmd_trap_group_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_TRAP_POLICER_SET,
|
||||
.doit = devlink_nl_cmd_trap_policer_set_doit,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
{
|
||||
.cmd = DEVLINK_CMD_SELFTESTS_RUN,
|
||||
.doit = devlink_nl_cmd_selftests_run,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
},
|
||||
/* -- No new ops here! Use split ops going forward! -- */
|
||||
};
|
||||
|
||||
struct genl_family devlink_nl_family __ro_after_init = {
|
||||
.name = DEVLINK_GENL_NAME,
|
||||
.version = DEVLINK_GENL_VERSION,
|
||||
|
|
Loading…
Reference in a new issue