netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: Danielle Ratson <danieller@mellanox.com>
Cc: netdev@vger.kernel.org, dsahern@gmail.com,
	stephen@networkplumber.org, mlxsw@mellanox.com
Subject: Re: [PATCH iproute2-next 2/3] devlink: Expose number of port lanes
Date: Sun, 12 Jul 2020 11:14:06 +0300	[thread overview]
Message-ID: <20200712081406.GA117670@shredder> (raw)
In-Reply-To: <20200712080413.15435-3-danieller@mellanox.com>

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
> 

  reply	other threads:[~2020-07-12  8:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2020-07-12  8:04 ` [PATCH iproute2-next 3/3] devlink: Expose port split ability Danielle Ratson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200712081406.GA117670@shredder \
    --to=idosch@idosch.org \
    --cc=danieller@mellanox.com \
    --cc=dsahern@gmail.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).