-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'devlink-use-spec-to-generate-split-ops'
Jiri Pirko says: ==================== devlink: use spec to generate split ops This is an outcome of the discussion in the following thread: https://lore.kernel.org/netdev/20230720121829.566974-1-jiri@resnulli.us/ It serves as a dependency on the linked selector patchset. There is an existing spec for devlink used for userspace part generation. There are two commands supported there. This patchset extends the spec so kernel split ops code could be generated from it. ==================== Link: https://lore.kernel.org/r/20230803111340.1074067-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski <kuba@kernel.org>
- Loading branch information
Showing
14 changed files
with
230 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# SPDX-License-Identifier: GPL-2.0 | ||
|
||
obj-y := leftover.o core.o netlink.o dev.o health.o | ||
obj-y := leftover.o core.o netlink.o netlink_gen.o dev.o health.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) | ||
/* Do not edit directly, auto-generated from: */ | ||
/* Documentation/netlink/specs/devlink.yaml */ | ||
/* YNL-GEN kernel source */ | ||
|
||
#include <net/netlink.h> | ||
#include <net/genetlink.h> | ||
|
||
#include "netlink_gen.h" | ||
|
||
#include <uapi/linux/devlink.h> | ||
|
||
/* DEVLINK_CMD_GET - do */ | ||
static const struct nla_policy devlink_get_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = { | ||
[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, | ||
[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, | ||
}; | ||
|
||
/* DEVLINK_CMD_INFO_GET - do */ | ||
static const struct nla_policy devlink_info_get_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = { | ||
[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, | ||
[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, | ||
}; | ||
|
||
/* Ops table for devlink */ | ||
const struct genl_split_ops devlink_nl_ops[4] = { | ||
{ | ||
.cmd = DEVLINK_CMD_GET, | ||
.validate = GENL_DONT_VALIDATE_STRICT, | ||
.pre_doit = devlink_nl_pre_doit, | ||
.doit = devlink_nl_get_doit, | ||
.post_doit = devlink_nl_post_doit, | ||
.policy = devlink_get_nl_policy, | ||
.maxattr = DEVLINK_ATTR_DEV_NAME, | ||
.flags = GENL_CMD_CAP_DO, | ||
}, | ||
{ | ||
.cmd = DEVLINK_CMD_GET, | ||
.validate = GENL_DONT_VALIDATE_DUMP, | ||
.dumpit = devlink_nl_get_dumpit, | ||
.flags = GENL_CMD_CAP_DUMP, | ||
}, | ||
{ | ||
.cmd = DEVLINK_CMD_INFO_GET, | ||
.validate = GENL_DONT_VALIDATE_STRICT, | ||
.pre_doit = devlink_nl_pre_doit, | ||
.doit = devlink_nl_info_get_doit, | ||
.post_doit = devlink_nl_post_doit, | ||
.policy = devlink_info_get_nl_policy, | ||
.maxattr = DEVLINK_ATTR_DEV_NAME, | ||
.flags = GENL_CMD_CAP_DO, | ||
}, | ||
{ | ||
.cmd = DEVLINK_CMD_INFO_GET, | ||
.validate = GENL_DONT_VALIDATE_DUMP, | ||
.dumpit = devlink_nl_info_get_dumpit, | ||
.flags = GENL_CMD_CAP_DUMP, | ||
}, | ||
}; |
Oops, something went wrong.