diff options
author | Jiri Pirko <jiri@mellanox.com> | 2018-05-18 09:29:02 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-05-19 16:30:39 -0400 |
commit | 08474c1a9df0cefcc3d197bd1d770695a34b9d60 (patch) | |
tree | ad98306122c9ff54630c0d29e3141f26e690e53b /include/net/devlink.h | |
parent | 5ec1380a21bb6cd2ba89e31c44dfcc150f9ef792 (diff) | |
download | linux-stable-08474c1a9df0cefcc3d197bd1d770695a34b9d60.tar.gz linux-stable-08474c1a9df0cefcc3d197bd1d770695a34b9d60.tar.bz2 linux-stable-08474c1a9df0cefcc3d197bd1d770695a34b9d60.zip |
devlink: introduce a helper to generate physical port names
Each driver implements physical port name generation by itself. However
as devlink has all needed info, it can easily do the job for all its
users. So implement this helper in devlink.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/devlink.h')
-rw-r--r-- | include/net/devlink.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/devlink.h b/include/net/devlink.h index 6eae15cf0f57..9686a1aa4ec9 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -378,6 +378,8 @@ void devlink_port_attrs_set(struct devlink_port *devlink_port, enum devlink_port_flavour flavour, u32 port_number, bool split, u32 split_subport_number); +int devlink_port_get_phys_port_name(struct devlink_port *devlink_port, + char *name, size_t len); int devlink_sb_register(struct devlink *devlink, unsigned int sb_index, u32 size, u16 ingress_pools_count, u16 egress_pools_count, u16 ingress_tc_count, @@ -482,6 +484,13 @@ static inline void devlink_port_attrs_set(struct devlink_port *devlink_port, { } +static inline int +devlink_port_get_phys_port_name(struct devlink_port *devlink_port, + char *name, size_t len) +{ + return -EOPNOTSUPP; +} + static inline int devlink_sb_register(struct devlink *devlink, unsigned int sb_index, u32 size, u16 ingress_pools_count, |