netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ethtool: Fix JSON output for IRQ coalescing
@ 2025-01-22  1:14 Michael Edwards
  2025-01-22  2:17 ` Jakub Kicinski
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Edwards @ 2025-01-22  1:14 UTC (permalink / raw)
  To: netdev; +Cc: Michael Edwards

Currently, for a NIC that supports CQE mode settings, the output of
ethtool --json -c eth0 looks like this:

[ {
        "ifname": "eth0",
        "rx": false,
        "tx": false,
        "rx-usecs": 33,
        "rx-frames": 88,
        "tx-usecs": 158,
        "tx-frames": 128,
        "rx": true,
        "tx": false
    } ]

This diff will change the first rx/tx pair to adaptive-{rx|tx} and
the second pair to cqe-mode-{rx|tx} to match the keys used to set
the corresponding settings.
---
 netlink/coalesce.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/netlink/coalesce.c b/netlink/coalesce.c
index bb93f9b..bc8b57b 100644
--- a/netlink/coalesce.c
+++ b/netlink/coalesce.c
@@ -39,9 +39,9 @@ int coalesce_reply_cb(const struct nlmsghdr *nlhdr, void *data)
 		show_cr();
 	print_string(PRINT_ANY, "ifname", "Coalesce parameters for %s:\n",
 		     nlctx->devname);
-	show_bool("rx", "Adaptive RX: %s  ",
+	show_bool("adaptive-rx", "Adaptive RX: %s  ",
 		  tb[ETHTOOL_A_COALESCE_USE_ADAPTIVE_RX]);
-	show_bool("tx", "TX: %s\n", tb[ETHTOOL_A_COALESCE_USE_ADAPTIVE_TX]);
+	show_bool("adaptive-tx", "TX: %s\n", tb[ETHTOOL_A_COALESCE_USE_ADAPTIVE_TX]);
 	show_u32("stats-block-usecs", "stats-block-usecs:\t",
 		 tb[ETHTOOL_A_COALESCE_STATS_BLOCK_USECS]);
 	show_u32("sample-interval", "sample-interval:\t",
@@ -85,9 +85,9 @@ int coalesce_reply_cb(const struct nlmsghdr *nlhdr, void *data)
 	show_u32("tx-frame-high", "tx-frame-high:\t",
 		 tb[ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH]);
 	show_cr();
-	show_bool("rx", "CQE mode RX: %s  ",
+	show_bool("cqe-mode-rx", "CQE mode RX: %s  ",
 		  tb[ETHTOOL_A_COALESCE_USE_CQE_MODE_RX]);
-	show_bool("tx", "TX: %s\n", tb[ETHTOOL_A_COALESCE_USE_CQE_MODE_TX]);
+	show_bool("cqe-mode-tx", "TX: %s\n", tb[ETHTOOL_A_COALESCE_USE_CQE_MODE_TX]);
 	show_cr();
 	show_u32("tx-aggr-max-bytes", "tx-aggr-max-bytes:\t",
 		 tb[ETHTOOL_A_COALESCE_TX_AGGR_MAX_BYTES]);
-- 
2.43.5


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

* Re: [PATCH] ethtool: Fix JSON output for IRQ coalescing
  2025-01-22  1:14 [PATCH] ethtool: Fix JSON output for IRQ coalescing Michael Edwards
@ 2025-01-22  2:17 ` Jakub Kicinski
  2025-01-22 17:40   ` Michael Edwards
  0 siblings, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2025-01-22  2:17 UTC (permalink / raw)
  To: Michael Edwards; +Cc: netdev

On Tue, 21 Jan 2025 17:14:34 -0800 Michael Edwards wrote:
> Currently, for a NIC that supports CQE mode settings, the output of
> ethtool --json -c eth0 looks like this:
> 
> [ {
>         "ifname": "eth0",
>         "rx": false,
>         "tx": false,
>         "rx-usecs": 33,
>         "rx-frames": 88,
>         "tx-usecs": 158,
>         "tx-frames": 128,
>         "rx": true,
>         "tx": false
>     } ]
> 
> This diff will change the first rx/tx pair to adaptive-{rx|tx} and
> the second pair to cqe-mode-{rx|tx} to match the keys used to set
> the corresponding settings.

Missing 3 details:
 - your Signed-off-by tag
 - To: Michal K who maintains ethtool
 - Fixes tag pointing to the commit where it got broken

Renaming adaptive keys may be a bit controversial. We can decide
whether it's okay to change the key based on how long we had json
output for "rx" and "tx" before "modes" got added (IOW how long 
this has been broken for). If breakage is recent we need to leave
adaptive be, someone may already be using 'rx' and 'tx' as the keys
in their scripts.

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

* [PATCH] ethtool: Fix JSON output for IRQ coalescing
  2025-01-22  2:17 ` Jakub Kicinski
@ 2025-01-22 17:40   ` Michael Edwards
  2025-01-22 23:13     ` Jakub Kicinski
                       ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Michael Edwards @ 2025-01-22 17:40 UTC (permalink / raw)
  To: netdev, mkubecek; +Cc: Michael Edwards

Currently, for a NIC that supports CQE mode settings, the output of
ethtool --json -c eth0 looks like this:

[ {
        "ifname": "eth0",
        "rx": false,
        "tx": false,
        "rx-usecs": 33,
        "rx-frames": 88,
        "tx-usecs": 158,
        "tx-frames": 128,
        "rx": true,
        "tx": false
    } ]

This diff will change the first rx/tx pair to adaptive-{rx|tx} and
the second pair to cqe-mode-{rx|tx} to match the keys used to set
the corresponding settings.

Fixes: 7e5c1ddbe67d ("pause: add --json support")
Fixes: ecfb7302cfe6 ("netlink: settings: add netlink support for coalesce cqe mode parameter")
Signed-off-by: Michael Edwards <mkedwards@meta.com>
---
 netlink/coalesce.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/netlink/coalesce.c b/netlink/coalesce.c
index bb93f9b224d6..bc8b57b6d412 100644
--- a/netlink/coalesce.c
+++ b/netlink/coalesce.c
@@ -39,9 +39,9 @@ int coalesce_reply_cb(const struct nlmsghdr *nlhdr, void *data)
 		show_cr();
 	print_string(PRINT_ANY, "ifname", "Coalesce parameters for %s:\n",
 		     nlctx->devname);
-	show_bool("rx", "Adaptive RX: %s  ",
+	show_bool("adaptive-rx", "Adaptive RX: %s  ",
 		  tb[ETHTOOL_A_COALESCE_USE_ADAPTIVE_RX]);
-	show_bool("tx", "TX: %s\n", tb[ETHTOOL_A_COALESCE_USE_ADAPTIVE_TX]);
+	show_bool("adaptive-tx", "TX: %s\n", tb[ETHTOOL_A_COALESCE_USE_ADAPTIVE_TX]);
 	show_u32("stats-block-usecs", "stats-block-usecs:\t",
 		 tb[ETHTOOL_A_COALESCE_STATS_BLOCK_USECS]);
 	show_u32("sample-interval", "sample-interval:\t",
@@ -85,9 +85,9 @@ int coalesce_reply_cb(const struct nlmsghdr *nlhdr, void *data)
 	show_u32("tx-frame-high", "tx-frame-high:\t",
 		 tb[ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH]);
 	show_cr();
-	show_bool("rx", "CQE mode RX: %s  ",
+	show_bool("cqe-mode-rx", "CQE mode RX: %s  ",
 		  tb[ETHTOOL_A_COALESCE_USE_CQE_MODE_RX]);
-	show_bool("tx", "TX: %s\n", tb[ETHTOOL_A_COALESCE_USE_CQE_MODE_TX]);
+	show_bool("cqe-mode-tx", "TX: %s\n", tb[ETHTOOL_A_COALESCE_USE_CQE_MODE_TX]);
 	show_cr();
 	show_u32("tx-aggr-max-bytes", "tx-aggr-max-bytes:\t",
 		 tb[ETHTOOL_A_COALESCE_TX_AGGR_MAX_BYTES]);
-- 
2.43.5


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

* Re: [PATCH] ethtool: Fix JSON output for IRQ coalescing
  2025-01-22 17:40   ` Michael Edwards
@ 2025-01-22 23:13     ` Jakub Kicinski
  2025-01-23 10:12     ` Michal Kubecek
  2025-01-23 11:30     ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 6+ messages in thread
From: Jakub Kicinski @ 2025-01-22 23:13 UTC (permalink / raw)
  To: Michael Edwards; +Cc: netdev, mkubecek

On Wed, 22 Jan 2025 09:40:15 -0800 Michael Edwards wrote:
> This diff will change the first rx/tx pair to adaptive-{rx|tx} and
> the second pair to cqe-mode-{rx|tx} to match the keys used to set
> the corresponding settings.

This has been broken for 3.5 years, so I think we can assume the old
keys weren't used:

Reviewed-by: Jakub Kicinski <kuba@kernel.org>

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

* Re: [PATCH] ethtool: Fix JSON output for IRQ coalescing
  2025-01-22 17:40   ` Michael Edwards
  2025-01-22 23:13     ` Jakub Kicinski
@ 2025-01-23 10:12     ` Michal Kubecek
  2025-01-23 11:30     ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 6+ messages in thread
From: Michal Kubecek @ 2025-01-23 10:12 UTC (permalink / raw)
  To: Michael Edwards; +Cc: netdev

On Wed, Jan 22, 2025 at 09:40:15AM -0800, Michael Edwards wrote:
> Currently, for a NIC that supports CQE mode settings, the output of
> ethtool --json -c eth0 looks like this:
> 
> [ {
>         "ifname": "eth0",
>         "rx": false,
>         "tx": false,
>         "rx-usecs": 33,
>         "rx-frames": 88,
>         "tx-usecs": 158,
>         "tx-frames": 128,
>         "rx": true,
>         "tx": false
>     } ]
> 
> This diff will change the first rx/tx pair to adaptive-{rx|tx} and
> the second pair to cqe-mode-{rx|tx} to match the keys used to set
> the corresponding settings.
> 
> Fixes: 7e5c1ddbe67d ("pause: add --json support")
> Fixes: ecfb7302cfe6 ("netlink: settings: add netlink support for coalesce cqe mode parameter")
> Signed-off-by: Michael Edwards <mkedwards@meta.com>
> ---

Good catch. I guess I should find some JSON linting tool to run on new
or modified JSON output that would catch issues like this.

Michal

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

* Re: [PATCH] ethtool: Fix JSON output for IRQ coalescing
  2025-01-22 17:40   ` Michael Edwards
  2025-01-22 23:13     ` Jakub Kicinski
  2025-01-23 10:12     ` Michal Kubecek
@ 2025-01-23 11:30     ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-01-23 11:30 UTC (permalink / raw)
  To: Michael Edwards; +Cc: netdev, mkubecek

Hello:

This patch was applied to ethtool/ethtool.git (master)
by Michal Kubecek <mkubecek@suse.cz>:

On Wed, 22 Jan 2025 09:40:15 -0800 you wrote:
> Currently, for a NIC that supports CQE mode settings, the output of
> ethtool --json -c eth0 looks like this:
> 
> [ {
>         "ifname": "eth0",
>         "rx": false,
>         "tx": false,
>         "rx-usecs": 33,
>         "rx-frames": 88,
>         "tx-usecs": 158,
>         "tx-frames": 128,
>         "rx": true,
>         "tx": false
>     } ]
> 
> [...]

Here is the summary with links:
  - ethtool: Fix JSON output for IRQ coalescing
    https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=c62310eb2999

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-01-23 11:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-22  1:14 [PATCH] ethtool: Fix JSON output for IRQ coalescing Michael Edwards
2025-01-22  2:17 ` Jakub Kicinski
2025-01-22 17:40   ` Michael Edwards
2025-01-22 23:13     ` Jakub Kicinski
2025-01-23 10:12     ` Michal Kubecek
2025-01-23 11:30     ` patchwork-bot+netdevbpf

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