All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH ethtool] ethtool: fec: Change the prompt string to adapt to current situations
@ 2022-06-02  5:36 Simon Horman
  2022-06-02 18:55 ` Michal Kubecek
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Horman @ 2022-06-02  5:36 UTC (permalink / raw)
  To: Michal Kubecek; +Cc: netdev, oss-drivers, Yu Xiao, Simon Horman

From: Yu Xiao <yu.xiao@corigine.com>

Majority upstream drivers uses `Configured FEC encodings` to report
supported modes. At which point it is better to change the text in
ethtool user space that changes the meaning of the field, which is
better to suit for the current situations.

So changing `Configured FEC encodings` to `Supported/Configured FEC
encodings` to adapt to both implementations.

Signed-off-by: Yu Xiao <yu.xiao@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
---

This patch resulted from a discussion on netdev regarding
updating the behaviour of the NFP driver. It was concluded in
that thread that it would be better to update the ethtool documentation
to reflect current implementations of the feature.

Ref: [PATCH net] nfp: correct the output of `ethtool --show-fec <intf>`
     https://lore.kernel.org/netdev/20220530084842.21258-1-simon.horman@corigine.com/
---
 ethtool.c     | 2 +-
 netlink/fec.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ethtool.c b/ethtool.c
index 277253090245..8654f70de03b 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -5567,7 +5567,7 @@ static int do_gfec(struct cmd_context *ctx)
 	}
 
 	fprintf(stdout, "FEC parameters for %s:\n", ctx->devname);
-	fprintf(stdout, "Configured FEC encodings:");
+	fprintf(stdout, "Supported/Configured FEC encodings:");
 	dump_fec(feccmd.fec);
 	fprintf(stdout, "\n");
 
diff --git a/netlink/fec.c b/netlink/fec.c
index f2659199c157..1762ae349ca6 100644
--- a/netlink/fec.c
+++ b/netlink/fec.c
@@ -153,7 +153,7 @@ int fec_reply_cb(const struct nlmsghdr *nlhdr, void *data)
 	print_string(PRINT_ANY, "ifname", "FEC parameters for %s:\n",
 		     nlctx->devname);
 
-	open_json_array("config", "Configured FEC encodings:");
+	open_json_array("support/config", "Supported/Configured FEC encodings:");
 	fa = tb[ETHTOOL_A_FEC_AUTO] && mnl_attr_get_u8(tb[ETHTOOL_A_FEC_AUTO]);
 	if (fa)
 		print_string(PRINT_ANY, NULL, " %s", "Auto");
-- 
2.30.2


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

* Re: [PATCH ethtool] ethtool: fec: Change the prompt string to adapt to current situations
  2022-06-02  5:36 [PATCH ethtool] ethtool: fec: Change the prompt string to adapt to current situations Simon Horman
@ 2022-06-02 18:55 ` Michal Kubecek
  2022-06-06  3:13   ` Macris Xiao
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Kubecek @ 2022-06-02 18:55 UTC (permalink / raw)
  To: Simon Horman; +Cc: netdev, oss-drivers, Yu Xiao

[-- Attachment #1: Type: text/plain, Size: 2525 bytes --]

On Thu, Jun 02, 2022 at 07:36:26AM +0200, Simon Horman wrote:
> From: Yu Xiao <yu.xiao@corigine.com>
> 
> Majority upstream drivers uses `Configured FEC encodings` to report
> supported modes. At which point it is better to change the text in
> ethtool user space that changes the meaning of the field, which is
> better to suit for the current situations.
> 
> So changing `Configured FEC encodings` to `Supported/Configured FEC
> encodings` to adapt to both implementations.
> 
> Signed-off-by: Yu Xiao <yu.xiao@corigine.com>
> Signed-off-by: Simon Horman <simon.horman@corigine.com>
> ---
> 
> This patch resulted from a discussion on netdev regarding
> updating the behaviour of the NFP driver. It was concluded in
> that thread that it would be better to update the ethtool documentation
> to reflect current implementations of the feature.
> 
> Ref: [PATCH net] nfp: correct the output of `ethtool --show-fec <intf>`
>      https://lore.kernel.org/netdev/20220530084842.21258-1-simon.horman@corigine.com/
> ---
>  ethtool.c     | 2 +-
>  netlink/fec.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ethtool.c b/ethtool.c
> index 277253090245..8654f70de03b 100644
> --- a/ethtool.c
> +++ b/ethtool.c
> @@ -5567,7 +5567,7 @@ static int do_gfec(struct cmd_context *ctx)
>  	}
>  
>  	fprintf(stdout, "FEC parameters for %s:\n", ctx->devname);
> -	fprintf(stdout, "Configured FEC encodings:");
> +	fprintf(stdout, "Supported/Configured FEC encodings:");

I'm OK with this part, even if I would prefer if we could unify what the
drivers present.

>  	dump_fec(feccmd.fec);
>  	fprintf(stdout, "\n");
>  
> diff --git a/netlink/fec.c b/netlink/fec.c
> index f2659199c157..1762ae349ca6 100644
> --- a/netlink/fec.c
> +++ b/netlink/fec.c
> @@ -153,7 +153,7 @@ int fec_reply_cb(const struct nlmsghdr *nlhdr, void *data)
>  	print_string(PRINT_ANY, "ifname", "FEC parameters for %s:\n",
>  		     nlctx->devname);
>  
> -	open_json_array("config", "Configured FEC encodings:");
> +	open_json_array("support/config", "Supported/Configured FEC encodings:");

AFAICS this would result in backword incompatible change of the JSON
output structure which is something we should avoid if we want people to
use JSON for scripting rather than the human readable text output.

Michal

>  	fa = tb[ETHTOOL_A_FEC_AUTO] && mnl_attr_get_u8(tb[ETHTOOL_A_FEC_AUTO]);
>  	if (fa)
>  		print_string(PRINT_ANY, NULL, " %s", "Auto");
> -- 
> 2.30.2
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* RE: [PATCH ethtool] ethtool: fec: Change the prompt string to adapt to current situations
  2022-06-02 18:55 ` Michal Kubecek
@ 2022-06-06  3:13   ` Macris Xiao
  0 siblings, 0 replies; 3+ messages in thread
From: Macris Xiao @ 2022-06-06  3:13 UTC (permalink / raw)
  To: Michal Kubecek; +Cc: netdev, oss-drivers, Simon Horman, Yinjun Zhang



> -----Original Message-----
> From: Michal Kubecek <mkubecek@suse.cz>
> Sent: 2022年6月3日 2:55
> To: Simon Horman <simon.horman@corigine.com>
> Cc: netdev@vger.kernel.org; oss-drivers <oss-drivers@corigine.com>; Macris
> Xiao <yu.xiao@corigine.com>
> Subject: Re: [PATCH ethtool] ethtool: fec: Change the prompt string to adapt
> to current situations
> 
> On Thu, Jun 02, 2022 at 07:36:26AM +0200, Simon Horman wrote:
> > From: Yu Xiao <yu.xiao@corigine.com>
> >
> > Majority upstream drivers uses `Configured FEC encodings` to report
> > supported modes. At which point it is better to change the text in
> > ethtool user space that changes the meaning of the field, which is
> > better to suit for the current situations.
> >
> > So changing `Configured FEC encodings` to `Supported/Configured FEC
> > encodings` to adapt to both implementations.
> >
> > Signed-off-by: Yu Xiao <yu.xiao@corigine.com>
> > Signed-off-by: Simon Horman <simon.horman@corigine.com>
> > ---
> >
> > This patch resulted from a discussion on netdev regarding updating the
> > behaviour of the NFP driver. It was concluded in that thread that it
> > would be better to update the ethtool documentation to reflect current
> > implementations of the feature.
> >
> > Ref: [PATCH net] nfp: correct the output of `ethtool --show-fec <intf>`
> >
> > https://lore.kernel.org/netdev/20220530084842.21258-1-
> simon.horman@cor
> > igine.com/
> > ---
> >  ethtool.c     | 2 +-
> >  netlink/fec.c | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/ethtool.c b/ethtool.c
> > index 277253090245..8654f70de03b 100644
> > --- a/ethtool.c
> > +++ b/ethtool.c
> > @@ -5567,7 +5567,7 @@ static int do_gfec(struct cmd_context *ctx)
> >  	}
> >
> >  	fprintf(stdout, "FEC parameters for %s:\n", ctx->devname);
> > -	fprintf(stdout, "Configured FEC encodings:");
> > +	fprintf(stdout, "Supported/Configured FEC encodings:");
> 
> I'm OK with this part, even if I would prefer if we could unify what the drivers
> present.
> 
> >  	dump_fec(feccmd.fec);
> >  	fprintf(stdout, "\n");
> >
> > diff --git a/netlink/fec.c b/netlink/fec.c index
> > f2659199c157..1762ae349ca6 100644
> > --- a/netlink/fec.c
> > +++ b/netlink/fec.c
> > @@ -153,7 +153,7 @@ int fec_reply_cb(const struct nlmsghdr *nlhdr, void
> *data)
> >  	print_string(PRINT_ANY, "ifname", "FEC parameters for %s:\n",
> >  		     nlctx->devname);
> >
> > -	open_json_array("config", "Configured FEC encodings:");
> > +	open_json_array("support/config", "Supported/Configured FEC
> > +encodings:");
> 
> AFAICS this would result in backword incompatible change of the JSON
> output structure which is something we should avoid if we want people to
> use JSON for scripting rather than the human readable text output.
> 
> Michal
> 

Thank you for advice. So whether to use only the first part, and is this part not
needed?

Macris Xiao

> >  	fa = tb[ETHTOOL_A_FEC_AUTO] &&
> mnl_attr_get_u8(tb[ETHTOOL_A_FEC_AUTO]);
> >  	if (fa)
> >  		print_string(PRINT_ANY, NULL, " %s", "Auto");
> > --
> > 2.30.2
> >

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

end of thread, other threads:[~2022-06-06  3:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02  5:36 [PATCH ethtool] ethtool: fec: Change the prompt string to adapt to current situations Simon Horman
2022-06-02 18:55 ` Michal Kubecek
2022-06-06  3:13   ` Macris Xiao

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.