[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250529142033.2308815-2-kuba@kernel.org>
Date: Thu, 29 May 2025 07:20:32 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: mkubecek@...e.cz
Cc: danieller@...dia.com,
idosch@...sch.org,
netdev@...r.kernel.org,
Jakub Kicinski <kuba@...nel.org>
Subject: [PATCH ethtool 1/2] module_common: always print per-lane status in JSON
The JSON output type changes when loss of signal / fault is
detected. When there is no problem we print single bool, eg:
"rx_loss_of_signal": false,
but when there's a problem we print an array:
"rx_loss_of_signal": ["No", "Yes", "No", "No"],
This appears to be a mirror of the human-readable output,
but it's a pain to parse / unmarshall for user space.
Signed-off-by: Jakub Kicinski <kuba@...nel.org>
---
module-common.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/module-common.c b/module-common.c
index 9c21c2a55a18..ae500c62af89 100644
--- a/module-common.c
+++ b/module-common.c
@@ -308,11 +308,8 @@ void module_show_lane_status(const char *name, unsigned int lane_cnt,
convert_json_field_name(name, json_fn);
- if (!value) {
- if (is_json_context())
- print_bool(PRINT_JSON, json_fn, NULL, false);
- else
- printf("\t%-41s : None\n", name);
+ if (!value && !is_json_context()) {
+ printf("\t%-41s : None\n", name);
return;
}
--
2.49.0
Powered by blists - more mailing lists