From: Parav Pandit <parav@nvidia.com>
To: <netdev@vger.kernel.org>, <stephen@networkplumber.org>,
<dsahern@kernel.org>
Cc: Parav Pandit <parav@nvidia.com>, Jiri Pirko <jiri@nvidia.com>
Subject: [PATCH iproute2-next RESEND 2/3] devlink: Show external port attribute
Date: Fri, 18 Sep 2020 13:16:48 +0300 [thread overview]
Message-ID: <20200918101649.60086-3-parav@nvidia.com> (raw)
In-Reply-To: <20200918101649.60086-1-parav@nvidia.com>
If a port is for an external controller, port's external attribute is
set. Show such external attribute.
An example of an external controller port for PCI VF:
$ devlink port show pci/0000:06:00.0/2
pci/0000:06:00.0/2: type eth netdev ens2f0c1pf0vf1 flavour pcivf pfnum 0 vfnum 1 external true splittable false
function:
hw_addr 00:00:00:00:00:00
$ devlink port show pci/0000:06:00.0/2 -jp
{
"port": {
"pci/0000:06:00.0/2": {
"type": "eth",
"netdev": "ens2f0c1pf0vf1",
"flavour": "pcivf",
"pfnum": 0,
"vfnum": 1,
"external": true,
"splittable": false,
"function": {
"hw_addr": "00:00:00:00:00:00"
}
}
}
}
Signed-off-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
---
devlink/devlink.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/devlink/devlink.c b/devlink/devlink.c
index 007677a5..9f99c031 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -3351,6 +3351,12 @@ static void pr_out_port_pfvf_num(struct dl *dl, struct nlattr **tb)
fn_num = mnl_attr_get_u16(tb[DEVLINK_ATTR_PORT_PCI_VF_NUMBER]);
print_uint(PRINT_ANY, "vfnum", " vfnum %u", fn_num);
}
+ if (tb[DEVLINK_ATTR_PORT_EXTERNAL]) {
+ uint8_t external;
+
+ external = mnl_attr_get_u8(tb[DEVLINK_ATTR_PORT_EXTERNAL]);
+ print_bool(PRINT_ANY, "external", " external %s", external);
+ }
}
static void pr_out_port_function(struct dl *dl, struct nlattr **tb_port)
--
2.26.2
next prev parent reply other threads:[~2020-09-18 10:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-18 8:02 [PATCH net-next 0/3] devlink show controller and external info Parav Pandit
2020-09-18 8:02 ` [PATCH net-next 1/3] devlink: Update kernel headers Parav Pandit
2020-09-18 8:02 ` [PATCH net-next 2/3] devlink: Show external port attribute Parav Pandit
2020-09-18 8:03 ` [PATCH net-next 3/3] devlink: Show controller number of a devlink port Parav Pandit
2020-09-18 10:08 ` [PATCH net-next 0/3] devlink show controller and external info Parav Pandit
2020-09-18 10:16 ` [PATCH iproute2-next RESEND " Parav Pandit
2020-09-18 10:16 ` [PATCH iproute2-next RESEND 1/3] devlink: Update kernel headers Parav Pandit
2020-09-18 10:16 ` Parav Pandit [this message]
2020-09-18 10:16 ` [PATCH iproute2-next RESEND 3/3] devlink: Show controller number of a devlink port Parav Pandit
2020-09-23 2:21 ` [PATCH iproute2-next RESEND 0/3] devlink show controller and external info David Ahern
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=20200918101649.60086-3-parav@nvidia.com \
--to=parav@nvidia.com \
--cc=dsahern@kernel.org \
--cc=jiri@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.