netdevsim: Allow setting parent node of rate objects

Implement new devlink ops that allow setting rate node as a parent for
devlink port (leaf) or another devlink node through devlink API.
Expose parent names to netdevsim debugfs in read only mode.

Co-developed-by: Vlad Buslov <vladbu@nvidia.com>
Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Signed-off-by: Dmytro Linkin <dlinkin@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Dmytro Linkin
2021-06-02 15:17:29 +03:00
committed by David S. Miller
parent d755598450
commit f3d101b485
2 changed files with 89 additions and 4 deletions

View File

@@ -211,6 +211,8 @@ struct nsim_dev_port {
unsigned int port_index;
enum nsim_dev_port_type port_type;
struct dentry *ddir;
struct dentry *rate_parent;
char *parent_name;
struct netdevsim *ns;
};