forked from torvalds/linux
Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
net: core: devlink: add port_params_ops for devlink port parameters a…
…ltering
I'd like to discuss a possibility of handling devlink port parameters
with devlink port pointer supplied.
Current design makes it impossible to distinguish which port's parameter
should get altered (set) or retrieved (get) whenever there's a single
parameter registered within a few ports.
This patch aims to show how this can be changed:
- introduce structure port_params_ops that has callbacks for
get/set/validate;
- if devlink has registered port_params_ops, then upon every devlink
port parameter get/set call invoke port parameters callback
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
Suggested-by: Vadym Kochan <vadym.kochan@plvision.eu>
--
V2:
1) devlink:
- add commentary description over devlink_port_param_ops struct.
- add port param ops 'set' usage.
- remove WARN_ON upon registering devlink params in case of
get/set not set.
2) netdevsim:
- dynamically allocate port params, as well as their values.
- add base / max values for port params and devlink
params enums to ease-out iteration over them.
- separate devlink port params IDs and devlink param IDs.
- add statically allocated devlink port params array.- Loading branch information
1 parent
440c324
commit 6dafecaf0af65b20843fead0a9adb6bab7222e93
Showing
4 changed files
with
145 additions
and
11 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