linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2-rc] rdma: Fix owner name for the kernel resources
@ 2020-08-11  6:33 Leon Romanovsky
  2020-08-11  7:25 ` Leon Romanovsky
  2020-08-11 15:54 ` Stephen Hemminger
  0 siblings, 2 replies; 4+ messages in thread
From: Leon Romanovsky @ 2020-08-11  6:33 UTC (permalink / raw)
  To: Stephen Hemminger, David Ahern
  Cc: Leon Romanovsky, Doug Ledford, Jason Gunthorpe, linux-netdev,
	RDMA mailing list

From: Leon Romanovsky <leonro@nvidia.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@nvidia.com>
---
 rdma/res.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rdma/res.c b/rdma/res.c
index c99a1fcb..6eca87e5 100644
--- a/rdma/res.c
+++ b/rdma/res.c
@@ -161,7 +161,7 @@ void print_comm(struct rd *rd, const char *str, struct nlattr **nla_line)
 		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


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

* Re: [PATCH iproute2-rc] rdma: Fix owner name for the kernel resources
  2020-08-11  6:33 [PATCH iproute2-rc] rdma: Fix owner name for the kernel resources Leon Romanovsky
@ 2020-08-11  7:25 ` Leon Romanovsky
  2020-08-11 15:54 ` Stephen Hemminger
  1 sibling, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2020-08-11  7:25 UTC (permalink / raw)
  To: Stephen Hemminger, David Ahern
  Cc: Doug Ledford, Jason Gunthorpe, linux-netdev, RDMA mailing list

On Tue, Aug 11, 2020 at 09:33:04AM +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@nvidia.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@nvidia.com>
> ---
>  rdma/res.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Please drop this patch, I'll send another version with extra fix.

Thanks

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

* Re: [PATCH iproute2-rc] rdma: Fix owner name for the kernel resources
  2020-08-11  6:33 [PATCH iproute2-rc] rdma: Fix owner name for the kernel resources Leon Romanovsky
  2020-08-11  7:25 ` Leon Romanovsky
@ 2020-08-11 15:54 ` Stephen Hemminger
  2020-08-11 16:53   ` Leon Romanovsky
  1 sibling, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2020-08-11 15:54 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: David Ahern, Leon Romanovsky, Doug Ledford, Jason Gunthorpe,
	linux-netdev, RDMA mailing list

On Tue, 11 Aug 2020 09:33:04 +0300
Leon Romanovsky <leon@kernel.org> wrote:

> +	print_color_string(PRINT_ANY, COLOR_NONE, "comm", "comm %s ", tmp);

If you don't want color then just print_string will do the same thing.
	
	print_string(PRINT_ANY, "comm", "comm %s ", tmp);


	

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

* Re: [PATCH iproute2-rc] rdma: Fix owner name for the kernel resources
  2020-08-11 15:54 ` Stephen Hemminger
@ 2020-08-11 16:53   ` Leon Romanovsky
  0 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2020-08-11 16:53 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: David Ahern, Doug Ledford, Jason Gunthorpe, linux-netdev,
	RDMA mailing list

On Tue, Aug 11, 2020 at 08:54:17AM -0700, Stephen Hemminger wrote:
> On Tue, 11 Aug 2020 09:33:04 +0300
> Leon Romanovsky <leon@kernel.org> wrote:
>
> > +	print_color_string(PRINT_ANY, COLOR_NONE, "comm", "comm %s ", tmp);
>
> If you don't want color then just print_string will do the same thing.
>
> 	print_string(PRINT_ANY, "comm", "comm %s ", tmp);

We put print_color_string() in all places as a preparation to for the
future and didn't color it on purpose at this point of time.

I prefer to keep it in this way and color it later.

Thanks

>
>
>

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

end of thread, other threads:[~2020-08-11 16:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-11  6:33 [PATCH iproute2-rc] rdma: Fix owner name for the kernel resources Leon Romanovsky
2020-08-11  7:25 ` Leon Romanovsky
2020-08-11 15:54 ` Stephen Hemminger
2020-08-11 16:53   ` Leon Romanovsky

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).