Add a new attribute that indicates the port split ability to devlink port. Expose the attribute to user space as RO value, for example:
$devlink port show swp1 pci/0000:03:00.0/61: type eth netdev swp1 flavour physical port 1 splittable false lanes 1 Signed-off-by: Danielle Ratson <daniel...@mellanox.com> Reviewed-by: Jiri Pirko <j...@mellanox.com> --- devlink/devlink.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/devlink/devlink.c b/devlink/devlink.c index 4aeb9f34..bc39d507 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -3398,6 +3398,9 @@ static void pr_out_port(struct dl *dl, struct nlattr **tb) if (tb[DEVLINK_ATTR_PORT_SPLIT_GROUP]) print_uint(PRINT_ANY, "split_group", " split_group %u", mnl_attr_get_u32(tb[DEVLINK_ATTR_PORT_SPLIT_GROUP])); + if (tb[DEVLINK_ATTR_PORT_SPLITTABLE]) + print_bool(PRINT_ANY, "splittable", " splittable %s", + mnl_attr_get_u8(tb[DEVLINK_ATTR_PORT_SPLITTABLE])); if (tb[DEVLINK_ATTR_PORT_LANES]) print_uint(PRINT_ANY, "lanes", " lanes %u", mnl_attr_get_u32(tb[DEVLINK_ATTR_PORT_LANES])); -- 2.20.1