devlink: Add a new devlink port lanes attribute and pass to netlink
authorDanielle Ratson <danieller@mellanox.com>
Thu, 9 Jul 2020 13:18:18 +0000 (16:18 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 9 Jul 2020 20:15:29 +0000 (13:15 -0700)
commita21cf0a8330bba60e44ca6c99e1591042f336ff5
tree47f66f8336258aac25fe6d09a31a25ec663a5a82
parent622d3e9201072aaa94d6291b8dee05e3dd50c3af
devlink: Add a new devlink port lanes attribute and pass to netlink

Add a new devlink port attribute that indicates the port's number of lanes.

Drivers are expected to set it via devlink_port_attrs_set(), before
registering the port.

The attribute is not passed to user space in case the number of lanes is
invalid (0).

Signed-off-by: Danielle Ratson <danieller@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core.c
include/net/devlink.h
include/uapi/linux/devlink.h
net/core/devlink.c