netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2-next 0/3] Expose port attributes
@ 2020-07-12  8:04 Danielle Ratson
  2020-07-12  8:04 ` [PATCH iproute2-next 1/3] include: Update kernel headers Danielle Ratson
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Danielle Ratson @ 2020-07-12  8:04 UTC (permalink / raw)
  To: netdev; +Cc: dsahern, stephen, mlxsw, Danielle Ratson

Add two new devlink port attributes:
- Lanes: indicates the number of port lanes.
- Splittable: indicates the port split ability.

Patch 1: Update kernel headers
Patch 2: Expose number of lanes
Patch 3: Expose split ability

Danielle Ratson (3):
  include: Update kernel headers
  devlink: Expose number of port lanes
  devlink: Expose port split ability

 devlink/devlink.c            | 7 +++++++
 include/uapi/linux/devlink.h | 3 +++
 2 files changed, 10 insertions(+)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH iproute2-next 1/3] include: Update kernel headers
  2020-07-12  8:04 [PATCH iproute2-next 0/3] Expose port attributes Danielle Ratson
@ 2020-07-12  8:04 ` Danielle Ratson
  2020-07-12  8:04 ` [PATCH iproute2-next 2/3] devlink: Expose number of port lanes Danielle Ratson
  2020-07-12  8:04 ` [PATCH iproute2-next 3/3] devlink: Expose port split ability Danielle Ratson
  2 siblings, 0 replies; 5+ messages in thread
From: Danielle Ratson @ 2020-07-12  8:04 UTC (permalink / raw)
  To: netdev; +Cc: dsahern, stephen, mlxsw, Danielle Ratson

Update kernel headers for following commit, with new devlink attributes.

Signed-off-by: Danielle Ratson <danieller@mellanox.com>
---
 include/uapi/linux/devlink.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h
index d3ee69ba..b7f23faa 100644
--- a/include/uapi/linux/devlink.h
+++ b/include/uapi/linux/devlink.h
@@ -455,6 +455,9 @@ enum devlink_attr {
 
 	DEVLINK_ATTR_INFO_BOARD_SERIAL_NUMBER,	/* string */
 
+	DEVLINK_ATTR_PORT_LANES,			/* u32 */
+	DEVLINK_ATTR_PORT_SPLITTABLE,			/* u8 */
+
 	/* add new attributes above here, update the policy in devlink.c */
 
 	__DEVLINK_ATTR_MAX,
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH iproute2-next 2/3] devlink: Expose number of port lanes
  2020-07-12  8:04 [PATCH iproute2-next 0/3] Expose port attributes Danielle Ratson
  2020-07-12  8:04 ` [PATCH iproute2-next 1/3] include: Update kernel headers Danielle Ratson
@ 2020-07-12  8:04 ` Danielle Ratson
  2020-07-12  8:14   ` Ido Schimmel
  2020-07-12  8:04 ` [PATCH iproute2-next 3/3] devlink: Expose port split ability Danielle Ratson
  2 siblings, 1 reply; 5+ messages in thread
From: Danielle Ratson @ 2020-07-12  8:04 UTC (permalink / raw)
  To: netdev; +Cc: dsahern, stephen, mlxsw, Danielle Ratson

Add a new attribute that indicates the port's number of lanes 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 lanes 1

Signed-off-by: Danielle Ratson <danieller@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
---
 devlink/devlink.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/devlink/devlink.c b/devlink/devlink.c
index 535c98d1..4aeb9f34 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -3398,6 +3398,10 @@ 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_LANES])
+		print_uint(PRINT_ANY, "lanes", " lanes %u",
+			   mnl_attr_get_u32(tb[DEVLINK_ATTR_PORT_LANES]));
+
 	pr_out_port_function(dl, tb);
 	pr_out_port_handle_end(dl);
 }
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH iproute2-next 3/3] devlink: Expose port split ability
  2020-07-12  8:04 [PATCH iproute2-next 0/3] Expose port attributes Danielle Ratson
  2020-07-12  8:04 ` [PATCH iproute2-next 1/3] include: Update kernel headers Danielle Ratson
  2020-07-12  8:04 ` [PATCH iproute2-next 2/3] devlink: Expose number of port lanes Danielle Ratson
@ 2020-07-12  8:04 ` Danielle Ratson
  2 siblings, 0 replies; 5+ messages in thread
From: Danielle Ratson @ 2020-07-12  8:04 UTC (permalink / raw)
  To: netdev; +Cc: dsahern, stephen, mlxsw, Danielle Ratson

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 <danieller@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH iproute2-next 2/3] devlink: Expose number of port lanes
  2020-07-12  8:04 ` [PATCH iproute2-next 2/3] devlink: Expose number of port lanes Danielle Ratson
@ 2020-07-12  8:14   ` Ido Schimmel
  0 siblings, 0 replies; 5+ messages in thread
From: Ido Schimmel @ 2020-07-12  8:14 UTC (permalink / raw)
  To: Danielle Ratson; +Cc: netdev, dsahern, stephen, mlxsw

On Sun, Jul 12, 2020 at 11:04:12AM +0300, Danielle Ratson wrote:
> Add a new attribute that indicates the port's number of lanes 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 lanes 1
> 
> Signed-off-by: Danielle Ratson <danieller@mellanox.com>
> Reviewed-by: Jiri Pirko <jiri@mellanox.com>
> ---
>  devlink/devlink.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/devlink/devlink.c b/devlink/devlink.c
> index 535c98d1..4aeb9f34 100644
> --- a/devlink/devlink.c
> +++ b/devlink/devlink.c
> @@ -3398,6 +3398,10 @@ 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_LANES])

I think you need to update 'devlink_policy' with the new attributes

> +		print_uint(PRINT_ANY, "lanes", " lanes %u",
> +			   mnl_attr_get_u32(tb[DEVLINK_ATTR_PORT_LANES]));
> +
>  	pr_out_port_function(dl, tb);
>  	pr_out_port_handle_end(dl);
>  }
> -- 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-12  8:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-12  8:04 [PATCH iproute2-next 0/3] Expose port attributes Danielle Ratson
2020-07-12  8:04 ` [PATCH iproute2-next 1/3] include: Update kernel headers Danielle Ratson
2020-07-12  8:04 ` [PATCH iproute2-next 2/3] devlink: Expose number of port lanes Danielle Ratson
2020-07-12  8:14   ` Ido Schimmel
2020-07-12  8:04 ` [PATCH iproute2-next 3/3] devlink: Expose port split ability Danielle Ratson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).