All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2-next v2] rdma: Report device protocol
@ 2023-05-04 12:09 Kamal Heib
  2023-05-04 12:23 ` Leon Romanovsky
  0 siblings, 1 reply; 2+ messages in thread
From: Kamal Heib @ 2023-05-04 12:09 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Leon Romanovsky, netdev, linux-rdma, kheib

Add support for reporting the device protocol.

11: mlx5_0: node_type ca protocol roce fw 12.28.2006
    node_guid 248a:0703:004b:f094 sys_image_guid 248a:0703:004b:f094
12: mlx5_1: node_type ca protocol ib fw 12.28.2006
    node_guid 248a:0703:0049:d4f0 sys_image_guid 248a:0703:0049:d4f0
13: mlx5_2: node_type ca protocol ib fw 12.28.2006
    node_guid 248a:0703:0049:d4f1 sys_image_guid 248a:0703:0049:d4f0
19: siw0: node_type rnic protocol iw node_guid 0200:00ff:fe00:0000
    sys_image_guid 0200:00ff:fe00:0000

Signed-off-by: Kamal Heib <kheib@redhat.com>
---
v2: Use protocol instead of proto.
---
 rdma/dev.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/rdma/dev.c b/rdma/dev.c
index c684dde4a56f..f43b0e40911e 100644
--- a/rdma/dev.c
+++ b/rdma/dev.c
@@ -189,6 +189,16 @@ static void dev_print_node_type(struct rd *rd, struct nlattr **tb)
 			   node_str);
 }
 
+static void dev_print_dev_proto(struct rd *rd, struct nlattr **tb)
+{
+       const char *str;
+       if (!tb[RDMA_NLDEV_ATTR_DEV_PROTOCOL])
+               return;
+
+       str = mnl_attr_get_str(tb[RDMA_NLDEV_ATTR_DEV_PROTOCOL]);
+       print_color_string(PRINT_ANY, COLOR_NONE, "protocol", "protocol %s ", str);
+}
+
 static int dev_parse_cb(const struct nlmsghdr *nlh, void *data)
 {
 	struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {};
@@ -206,6 +216,7 @@ static int dev_parse_cb(const struct nlmsghdr *nlh, void *data)
 	print_color_string(PRINT_ANY, COLOR_NONE, "ifname", "%s: ", name);
 
 	dev_print_node_type(rd, tb);
+	dev_print_dev_proto(rd, tb);
 	dev_print_fw(rd, tb);
 	dev_print_node_guid(rd, tb);
 	dev_print_sys_image_guid(rd, tb);
-- 
2.40.1


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

* Re: [PATCH iproute2-next v2] rdma: Report device protocol
  2023-05-04 12:09 [PATCH iproute2-next v2] rdma: Report device protocol Kamal Heib
@ 2023-05-04 12:23 ` Leon Romanovsky
  0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2023-05-04 12:23 UTC (permalink / raw)
  To: Kamal Heib; +Cc: Stephen Hemminger, netdev, linux-rdma

On Thu, May 04, 2023 at 08:09:18AM -0400, Kamal Heib wrote:
> Add support for reporting the device protocol.
> 
> 11: mlx5_0: node_type ca protocol roce fw 12.28.2006
>     node_guid 248a:0703:004b:f094 sys_image_guid 248a:0703:004b:f094
> 12: mlx5_1: node_type ca protocol ib fw 12.28.2006
>     node_guid 248a:0703:0049:d4f0 sys_image_guid 248a:0703:0049:d4f0
> 13: mlx5_2: node_type ca protocol ib fw 12.28.2006
>     node_guid 248a:0703:0049:d4f1 sys_image_guid 248a:0703:0049:d4f0
> 19: siw0: node_type rnic protocol iw node_guid 0200:00ff:fe00:0000
>     sys_image_guid 0200:00ff:fe00:0000
> 
> Signed-off-by: Kamal Heib <kheib@redhat.com>
> ---
> v2: Use protocol instead of proto.
> ---
>  rdma/dev.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 

Thanks,
Acked-by: Leon Romanovsky <leonro@nvidia.com>

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

end of thread, other threads:[~2023-05-04 12:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-04 12:09 [PATCH iproute2-next v2] rdma: Report device protocol Kamal Heib
2023-05-04 12:23 ` Leon Romanovsky

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.