netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2-next v2 0/2] Expose port attributes
@ 2020-07-30 14:33 Danielle Ratson
  2020-07-30 14:33 ` [PATCH iproute2-next v2 1/2] devlink: Expose number of port lanes Danielle Ratson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Danielle Ratson @ 2020-07-30 14:33 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

v2: *Update 'devlink_policy' with the new attributes

Danielle Ratson (2):
  devlink: Expose number of port lanes
  devlink: Expose port split ability

 devlink/devlink.c | 9 +++++++++
 1 file changed, 9 insertions(+)

-- 
2.20.1


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

* [PATCH iproute2-next v2 1/2] devlink: Expose number of port lanes
  2020-07-30 14:33 [PATCH iproute2-next v2 0/2] Expose port attributes Danielle Ratson
@ 2020-07-30 14:33 ` Danielle Ratson
  2020-07-30 14:33 ` [PATCH iproute2-next v2 2/2] devlink: Expose port split ability Danielle Ratson
  2020-08-03 14:38 ` [PATCH iproute2-next v2 0/2] Expose port attributes David Ahern
  2 siblings, 0 replies; 4+ messages in thread
From: Danielle Ratson @ 2020-07-30 14:33 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>
---
 devlink/devlink.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/devlink/devlink.c b/devlink/devlink.c
index 7dbe9c7e..39bc1119 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -581,6 +581,7 @@ static const enum mnl_attr_data_type devlink_policy[DEVLINK_ATTR_MAX + 1] = {
 	[DEVLINK_ATTR_PORT_NETDEV_IFINDEX] = MNL_TYPE_U32,
 	[DEVLINK_ATTR_PORT_NETDEV_NAME] = MNL_TYPE_NUL_STRING,
 	[DEVLINK_ATTR_PORT_IBDEV_NAME] = MNL_TYPE_NUL_STRING,
+	[DEVLINK_ATTR_PORT_LANES] = MNL_TYPE_U32,
 	[DEVLINK_ATTR_SB_INDEX] = MNL_TYPE_U32,
 	[DEVLINK_ATTR_SB_SIZE] = MNL_TYPE_U32,
 	[DEVLINK_ATTR_SB_INGRESS_POOL_COUNT] = MNL_TYPE_U16,
@@ -3423,6 +3424,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] 4+ messages in thread

* [PATCH iproute2-next v2 2/2] devlink: Expose port split ability
  2020-07-30 14:33 [PATCH iproute2-next v2 0/2] Expose port attributes Danielle Ratson
  2020-07-30 14:33 ` [PATCH iproute2-next v2 1/2] devlink: Expose number of port lanes Danielle Ratson
@ 2020-07-30 14:33 ` Danielle Ratson
  2020-08-03 14:38 ` [PATCH iproute2-next v2 0/2] Expose port attributes David Ahern
  2 siblings, 0 replies; 4+ messages in thread
From: Danielle Ratson @ 2020-07-30 14:33 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>
---
 devlink/devlink.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/devlink/devlink.c b/devlink/devlink.c
index 39bc1119..a22e931e 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -582,6 +582,7 @@ static const enum mnl_attr_data_type devlink_policy[DEVLINK_ATTR_MAX + 1] = {
 	[DEVLINK_ATTR_PORT_NETDEV_NAME] = MNL_TYPE_NUL_STRING,
 	[DEVLINK_ATTR_PORT_IBDEV_NAME] = MNL_TYPE_NUL_STRING,
 	[DEVLINK_ATTR_PORT_LANES] = MNL_TYPE_U32,
+	[DEVLINK_ATTR_PORT_SPLITTABLE] = MNL_TYPE_U8,
 	[DEVLINK_ATTR_SB_INDEX] = MNL_TYPE_U32,
 	[DEVLINK_ATTR_SB_SIZE] = MNL_TYPE_U32,
 	[DEVLINK_ATTR_SB_INGRESS_POOL_COUNT] = MNL_TYPE_U16,
@@ -3424,6 +3425,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] 4+ messages in thread

* Re: [PATCH iproute2-next v2 0/2] Expose port attributes
  2020-07-30 14:33 [PATCH iproute2-next v2 0/2] Expose port attributes Danielle Ratson
  2020-07-30 14:33 ` [PATCH iproute2-next v2 1/2] devlink: Expose number of port lanes Danielle Ratson
  2020-07-30 14:33 ` [PATCH iproute2-next v2 2/2] devlink: Expose port split ability Danielle Ratson
@ 2020-08-03 14:38 ` David Ahern
  2 siblings, 0 replies; 4+ messages in thread
From: David Ahern @ 2020-08-03 14:38 UTC (permalink / raw)
  To: Danielle Ratson, netdev; +Cc: stephen, mlxsw

On 7/30/20 8:33 AM, Danielle Ratson wrote:
> 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
> 
> v2: *Update 'devlink_policy' with the new attributes
> 
> Danielle Ratson (2):
>   devlink: Expose number of port lanes
>   devlink: Expose port split ability
> 
>  devlink/devlink.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 

applied to iproute2-next. Thanks,

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

end of thread, other threads:[~2020-08-03 14:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-30 14:33 [PATCH iproute2-next v2 0/2] Expose port attributes Danielle Ratson
2020-07-30 14:33 ` [PATCH iproute2-next v2 1/2] devlink: Expose number of port lanes Danielle Ratson
2020-07-30 14:33 ` [PATCH iproute2-next v2 2/2] devlink: Expose port split ability Danielle Ratson
2020-08-03 14:38 ` [PATCH iproute2-next v2 0/2] Expose port attributes David Ahern

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).