Skip to contentSkip to conversation

rdma: Fix owner name for the kernel resources

PATCH In review Leon Romanovsky 3 participants 4 messages Aug 11, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rdma: Fix owner name for the kernel resources

From: Leon Romanovsky <[email protected]>

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")
---
 rdma/res.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rdma/res.c +1 -1
index c99a1fcb..6eca87e5 100644
@@ -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

maintainer
#1 lore raw
Quoted 14 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

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]

Quoted 5 lines
Fixes b0a688a542cd ("rdma: Rewrite custom JSON and prints logic to use common API")
---
 rdma/res.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

Thanks

#2 lore raw
In reply to Leon Romanovsky

rdma/res.c void print_comm(struct rd *rd, const char *str, struct nlattr **nla_line) · line 164

Quoted 1 line · On Tue, 11 Aug 2020 09:33:04 +0300 Leon Romanovsky <[email protected]> wrote:
rdma/res.c +1 -0
+	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);
#3 lore raw
Quoted 8 lines · Stephen Hemminger

rdma/res.c void print_comm(struct rd *rd, const char *str, struct nlattr **nla_line) · line 164

Quoted 1 line · On Tue, 11 Aug 2020 09:33:04 +0300 Leon Romanovsky <[email protected]> wrote:
rdma/res.c +1 -0
+	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

Quoted 3 lines