[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200811073201.663398-2-leon@kernel.org>
Date: Tue, 11 Aug 2020 10:32:00 +0300
From: Leon Romanovsky <leon@...nel.org>
To: Stephen Hemminger <stephen@...workplumber.org>,
David Ahern <dsahern@...il.com>
Cc: Leon Romanovsky <leonro@...dia.com>,
Doug Ledford <dledford@...hat.com>,
Jason Gunthorpe <jgg@...dia.com>,
linux-netdev <netdev@...r.kernel.org>,
RDMA mailing list <linux-rdma@...r.kernel.org>
Subject: [PATCH iproute2-rc v1 1/2] rdma: Fix owner name for the kernel resources
From: Leon Romanovsky <leonro@...dia.com>
Owner of kernel resources is printed in different format than user
resources to easy with the reader by simply looking on the name.
The kernel owner will have "[ ]" around the name.
Before this change:
[leonro@vm ~]$ rdma res show qp
link rocep0s9/1 lqpn 1 type GSI state RTS sq-psn 58 comm ib_core
After this change:
[leonro@vm ~]$ rdma res show qp
link rocep0s9/1 lqpn 1 type GSI state RTS sq-psn 58 comm [ib_core]
Fixes: b0a688a542cd ("rdma: Rewrite custom JSON and prints logic to use common API")
Signed-off-by: Leon Romanovsky <leonro@...dia.com>
---
rdma/res.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rdma/res.c b/rdma/res.c
index c99a1fcb..b7a703f8 100644
--- a/rdma/res.c
+++ b/rdma/res.c
@@ -157,11 +157,11 @@ void print_comm(struct rd *rd, const char *str, struct nlattr **nla_line)
if (!str)
return;
- if (nla_line[RDMA_NLDEV_ATTR_RES_PID])
+ if (nla_line[RDMA_NLDEV_ATTR_RES_PID] || rd->json_output)
snprintf(tmp, sizeof(tmp), "%s", str);
else
snprintf(tmp, sizeof(tmp), "[%s]", str);
- print_color_string(PRINT_ANY, COLOR_NONE, "comm", "comm %s ", str);
+ print_color_string(PRINT_ANY, COLOR_NONE, "comm", "comm %s ", tmp);
}
void print_dev(struct rd *rd, uint32_t idx, const char *name)
--
2.26.2
Powered by blists - more mailing lists