From 5ae2d3cb2d16ad5d7e193978aefba1610de26ac5 Mon Sep 17 00:00:00 2001
From: Sabrina Dubroca <sdubroca@redhat.com>
Date: Fri, 9 Jun 2017 10:31:01 +0200
Subject: [PATCH] devlink: write usage help messages to stderr
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1459772
Upstream Status: iproute2.git commit 7a9466dbcba1
commit 7a9466dbcba1918a1c93de8f93b9ff3d62418fcf
Author: Jiri Pirko <jiri@mellanox.com>
Date: Fri Jul 22 18:34:29 2016 +0200
devlink: write usage help messages to stderr
In order to not confuse reader, write help messages into stderr.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Sabrina Dubroca <sdubroca@redhat.com>
---
devlink/devlink.c | 46 +++++++++++++++++++++++-----------------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/devlink/devlink.c b/devlink/devlink.c
index 07c28eb95270..bd801880c75f 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -952,7 +952,7 @@ static bool dl_dump_filter(struct dl *dl, struct nlattr **tb)
static void cmd_dev_help(void)
{
- pr_out("Usage: devlink dev show [ DEV ]\n");
+ pr_err("Usage: devlink dev show [ DEV ]\n");
}
static void __pr_out_handle(const char *bus_name, const char *dev_name)
@@ -1147,10 +1147,10 @@ static int cmd_dev(struct dl *dl)
static void cmd_port_help(void)
{
- pr_out("Usage: devlink port show [ DEV/PORT_INDEX ]\n");
- pr_out(" devlink port set DEV/PORT_INDEX [ type { eth | ib | auto} ]\n");
- pr_out(" devlink port split DEV/PORT_INDEX count COUNT\n");
- pr_out(" devlink port unsplit DEV/PORT_INDEX\n");
+ pr_err("Usage: devlink port show [ DEV/PORT_INDEX ]\n");
+ pr_err(" devlink port set DEV/PORT_INDEX [ type { eth | ib | auto} ]\n");
+ pr_err(" devlink port split DEV/PORT_INDEX count COUNT\n");
+ pr_err(" devlink port unsplit DEV/PORT_INDEX\n");
}
static const char *port_type_name(uint32_t type)
@@ -1297,22 +1297,22 @@ static int cmd_port(struct dl *dl)
static void cmd_sb_help(void)
{
- pr_out("Usage: devlink sb show [ DEV [ sb SB_INDEX ] ]\n");
- pr_out(" devlink sb pool show [ DEV [ sb SB_INDEX ] pool POOL_INDEX ]\n");
- pr_out(" devlink sb pool set DEV [ sb SB_INDEX ] pool POOL_INDEX\n");
- pr_out(" size POOL_SIZE thtype { static | dynamic }\n");
- pr_out(" devlink sb port pool show [ DEV/PORT_INDEX [ sb SB_INDEX ]\n");
- pr_out(" pool POOL_INDEX ]\n");
- pr_out(" devlink sb port pool set DEV/PORT_INDEX [ sb SB_INDEX ]\n");
- pr_out(" pool POOL_INDEX th THRESHOLD\n");
- pr_out(" devlink sb tc bind show [ DEV/PORT_INDEX [ sb SB_INDEX ] tc TC_INDEX\n");
- pr_out(" type { ingress | egress } ]\n");
- pr_out(" devlink sb tc bind set DEV/PORT_INDEX [ sb SB_INDEX ] tc TC_INDEX\n");
- pr_out(" type { ingress | egress } pool POOL_INDEX\n");
- pr_out(" th THRESHOLD\n");
- pr_out(" devlink sb occupancy show { DEV | DEV/PORT_INDEX } [ sb SB_INDEX ]\n");
- pr_out(" devlink sb occupancy snapshot DEV [ sb SB_INDEX ]\n");
- pr_out(" devlink sb occupancy clearmax DEV [ sb SB_INDEX ]\n");
+ pr_err("Usage: devlink sb show [ DEV [ sb SB_INDEX ] ]\n");
+ pr_err(" devlink sb pool show [ DEV [ sb SB_INDEX ] pool POOL_INDEX ]\n");
+ pr_err(" devlink sb pool set DEV [ sb SB_INDEX ] pool POOL_INDEX\n");
+ pr_err(" size POOL_SIZE thtype { static | dynamic }\n");
+ pr_err(" devlink sb port pool show [ DEV/PORT_INDEX [ sb SB_INDEX ]\n");
+ pr_err(" pool POOL_INDEX ]\n");
+ pr_err(" devlink sb port pool set DEV/PORT_INDEX [ sb SB_INDEX ]\n");
+ pr_err(" pool POOL_INDEX th THRESHOLD\n");
+ pr_err(" devlink sb tc bind show [ DEV/PORT_INDEX [ sb SB_INDEX ] tc TC_INDEX\n");
+ pr_err(" type { ingress | egress } ]\n");
+ pr_err(" devlink sb tc bind set DEV/PORT_INDEX [ sb SB_INDEX ] tc TC_INDEX\n");
+ pr_err(" type { ingress | egress } pool POOL_INDEX\n");
+ pr_err(" th THRESHOLD\n");
+ pr_err(" devlink sb occupancy show { DEV | DEV/PORT_INDEX } [ sb SB_INDEX ]\n");
+ pr_err(" devlink sb occupancy snapshot DEV [ sb SB_INDEX ]\n");
+ pr_err(" devlink sb occupancy clearmax DEV [ sb SB_INDEX ]\n");
}
static void pr_out_sb(struct nlattr **tb)
@@ -2114,7 +2114,7 @@ static int cmd_mon_show(struct dl *dl)
static void cmd_mon_help(void)
{
- pr_out("Usage: devlink monitor [ all | OBJECT-LIST ]\n"
+ pr_err("Usage: devlink monitor [ all | OBJECT-LIST ]\n"
"where OBJECT-LIST := { dev | port }\n");
}
@@ -2133,7 +2133,7 @@ static int cmd_mon(struct dl *dl)
static void help(void)
{
- pr_out("Usage: devlink [ OPTIONS ] OBJECT { COMMAND | help }\n"
+ pr_err("Usage: devlink [ OPTIONS ] OBJECT { COMMAND | help }\n"
"where OBJECT := { dev | port | sb | monitor }\n"
" OPTIONS := { -V[ersion] | -n[no-nice-names] }\n");
}
--
2.13.1