All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2 v1 1/2] rdma: colorize interface names
@ 2020-08-16 23:02 Stephen Hemminger
  2020-08-16 23:02 ` [PATCH iproute2 v1 2/2] rdma: use print_type() rather than print_color_type(xx, COLOR_NONE) Stephen Hemminger
  2020-08-17  7:46 ` [PATCH iproute2 v1 1/2] rdma: colorize interface names Leon Romanovsky
  0 siblings, 2 replies; 4+ messages in thread
From: Stephen Hemminger @ 2020-08-16 23:02 UTC (permalink / raw)
  To: leon; +Cc: netdev, Stephen Hemminger

Use the standard color outputs for interface names

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 rdma/dev.c  | 2 +-
 rdma/link.c | 2 +-
 rdma/res.c  | 6 +++---
 rdma/stat.c | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/rdma/dev.c b/rdma/dev.c
index a11081b82170..fd4c2376550c 100644
--- a/rdma/dev.c
+++ b/rdma/dev.c
@@ -203,7 +203,7 @@ static int dev_parse_cb(const struct nlmsghdr *nlh, void *data)
 	idx =  mnl_attr_get_u32(tb[RDMA_NLDEV_ATTR_DEV_INDEX]);
 	name = mnl_attr_get_str(tb[RDMA_NLDEV_ATTR_DEV_NAME]);
 	print_color_uint(PRINT_ANY, COLOR_NONE, "ifindex", "%u: ", idx);
-	print_color_string(PRINT_ANY, COLOR_NONE, "ifname", "%s: ", name);
+	print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname", "%s: ", name);
 
 	dev_print_node_type(rd, tb);
 	dev_print_fw(rd, tb);
diff --git a/rdma/link.c b/rdma/link.c
index bf24b849a1e0..4b68eb28ec36 100644
--- a/rdma/link.c
+++ b/rdma/link.c
@@ -244,7 +244,7 @@ static int link_parse_cb(const struct nlmsghdr *nlh, void *data)
 
 	open_json_object(NULL);
 	print_color_uint(PRINT_JSON, COLOR_NONE, "ifindex", NULL, idx);
-	print_color_string(PRINT_ANY, COLOR_NONE, "ifname", "link %s/", name);
+	print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname", "link %s/", name);
 	print_color_uint(PRINT_ANY, COLOR_NONE, "port", "%u ", port);
 	link_print_subnet_prefix(rd, tb);
 	link_print_lid(rd, tb);
diff --git a/rdma/res.c b/rdma/res.c
index dc12bbe4bffe..4661dda4c303 100644
--- a/rdma/res.c
+++ b/rdma/res.c
@@ -76,7 +76,7 @@ static int res_no_args_parse_cb(const struct nlmsghdr *nlh, void *data)
 	name = mnl_attr_get_str(tb[RDMA_NLDEV_ATTR_DEV_NAME]);
 	open_json_object(NULL);
 	print_color_uint(PRINT_ANY, COLOR_NONE, "ifindex", "%u: ", idx);
-	print_color_string(PRINT_ANY, COLOR_NONE, "ifname", "%s: ", name);
+	print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname", "%s: ", name);
 	res_print_summary(rd, tb);
 	newline(rd);
 	return MNL_CB_OK;
@@ -167,7 +167,7 @@ void print_comm(struct rd *rd, const char *str, struct nlattr **nla_line)
 void print_dev(struct rd *rd, uint32_t idx, const char *name)
 {
 	print_color_int(PRINT_ANY, COLOR_NONE, "ifindex", NULL, idx);
-	print_color_string(PRINT_ANY, COLOR_NONE, "ifname", "dev %s ", name);
+	print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname", "dev %s ", name);
 }
 
 void print_link(struct rd *rd, uint32_t idx, const char *name, uint32_t port,
@@ -176,7 +176,7 @@ void print_link(struct rd *rd, uint32_t idx, const char *name, uint32_t port,
 	char tmp[64] = {};
 
 	print_color_uint(PRINT_JSON, COLOR_NONE, "ifindex", NULL, idx);
-	print_color_string(PRINT_ANY, COLOR_NONE, "ifname", NULL, name);
+	print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname", NULL, name);
 	if (nla_line[RDMA_NLDEV_ATTR_PORT_INDEX]) {
 		print_color_uint(PRINT_ANY, COLOR_NONE, "port", NULL, port);
 		snprintf(tmp, sizeof(tmp), "%s/%d", name, port);
diff --git a/rdma/stat.c b/rdma/stat.c
index a2b5da1c7797..274e4aca5172 100644
--- a/rdma/stat.c
+++ b/rdma/stat.c
@@ -711,7 +711,7 @@ static int stat_show_parse_cb(const struct nlmsghdr *nlh, void *data)
 	name = mnl_attr_get_str(tb[RDMA_NLDEV_ATTR_DEV_NAME]);
 	port = mnl_attr_get_u32(tb[RDMA_NLDEV_ATTR_PORT_INDEX]);
 	open_json_object(NULL);
-	print_color_string(PRINT_ANY, COLOR_NONE, "ifname", "link %s/", name);
+	print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname", "link %s/", name);
 	print_color_uint(PRINT_ANY, COLOR_NONE, "port", "%u ", port);
 	ret = res_get_hwcounters(rd, tb[RDMA_NLDEV_ATTR_STAT_HWCOUNTERS], true);
 
-- 
2.27.0


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

end of thread, other threads:[~2020-08-17  7:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-16 23:02 [PATCH iproute2 v1 1/2] rdma: colorize interface names Stephen Hemminger
2020-08-16 23:02 ` [PATCH iproute2 v1 2/2] rdma: use print_type() rather than print_color_type(xx, COLOR_NONE) Stephen Hemminger
2020-08-17  7:45   ` Leon Romanovsky
2020-08-17  7:46 ` [PATCH iproute2 v1 1/2] rdma: colorize interface names 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.