From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [patch iproute2/net-next 2/2] devlink: introduce support for showing port number and split subport number Date: Fri, 25 May 2018 08:19:26 -0600 Message-ID: <122dbae7-7327-698a-110f-cc87c513e115@gmail.com> References: <20180520081539.1372-1-jiri@resnulli.us> <20180520081539.1372-3-jiri@resnulli.us> <20180524063952.GC2295@nanopsycho> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, idosch@mellanox.com, jakub.kicinski@netronome.com, mlxsw@mellanox.com, andrew@lunn.ch, vivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com, michael.chan@broadcom.com, ganeshgr@chelsio.com, saeedm@mellanox.com, simon.horman@netronome.com, pieter.jansenvanvuuren@netronome.com, john.hurley@netronome.com, dirk.vandermerwe@netronome.com, alexander.h.duyck@intel.com, ogerlitz@mellanox.com, vijaya.guvva@cavium.com, satananda.burla@cavium.com, raghu.vatsavayi@cavium.com, felix.manlunas@cavium.com, gospo@broadcom.com, sathya.perla@broadcom.com, vasundhara-v.volam@broadcom.com, tariqt@mellanox.com, eranbe@mellanox.com, jeffrey.t.kirsher@intel.com, roopa@cumulusnetworks.com To: Jiri Pirko Return-path: Received: from mail-pf0-f196.google.com ([209.85.192.196]:42188 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935791AbeEYOS7 (ORCPT ); Fri, 25 May 2018 10:18:59 -0400 Received: by mail-pf0-f196.google.com with SMTP id p14-v6so2667751pfh.9 for ; Fri, 25 May 2018 07:18:58 -0700 (PDT) In-Reply-To: <20180524063952.GC2295@nanopsycho> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 5/24/18 12:39 AM, Jiri Pirko wrote: > Wed, May 23, 2018 at 10:05:49PM CEST, dsahern@gmail.com wrote: >> On 5/20/18 2:15 AM, Jiri Pirko wrote: >>> From: Jiri Pirko >>> >>> Signed-off-by: Jiri Pirko >>> --- >>> devlink/devlink.c | 6 ++++++ >>> include/uapi/linux/devlink.h | 2 ++ >>> 2 files changed, 8 insertions(+) >>> >>> diff --git a/devlink/devlink.c b/devlink/devlink.c >>> index df2c66dac1c7..b0ae17767dab 100644 >>> --- a/devlink/devlink.c >>> +++ b/devlink/devlink.c >>> @@ -1737,9 +1737,15 @@ static void pr_out_port(struct dl *dl, struct nlattr **tb) >>> >>> pr_out_str(dl, "flavour", port_flavour_name(port_flavour)); >>> } >>> + if (tb[DEVLINK_ATTR_PORT_NUMBER]) >>> + pr_out_uint(dl, "number", >>> + mnl_attr_get_u32(tb[DEVLINK_ATTR_PORT_NUMBER])); >> >> "number" is a label means nothing. "port" is more descriptive. > > That attribute name is "port_number". As the other attributes are > named "port_something", and the "something" is printed out here, the > "number" is consistent with it. Each line represents a port with a list > of attributes. The name of the attribute is not relevant here. That's an API that very few people will see. I am looking at this from a user perspective and the word "number" followed by a number is not clear. > >> >> # ./devlink port >> pci/0000:03:00.0/1: type eth netdev swp17 flavour physical number 17 >> pci/0000:03:00.0/3: type eth netdev swp18 flavour physical number 18 >> pci/0000:03:00.0/5: type eth netdev swp19 flavour physical number 19 >> pci/0000:03:00.0/7: type eth netdev swp20 flavour physical number 20 >> pci/0000:03:00.0/9: type eth netdev swp21 flavour physical number 21 >> ... >> pci/0000:03:00.0/61: type eth netdev swp1s0 flavour physical number 1 >> split_group 1 subport 0 >> pci/0000:03:00.0/62: type eth netdev swp1s1 flavour physical number 1 >> split_group 1 subport 1 >>