[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZowP36I9jcRmUDkg@shredder.mtl.com>
Date: Mon, 8 Jul 2024 19:12:15 +0300
From: Ido Schimmel <idosch@...dia.com>
To: Krzysztof Olędzki <ole@....pl>
Cc: Andrew Lunn <andrew@...n.ch>, Michal Kubecek <mkubecek@...e.cz>,
Moshe Shemesh <moshe@...dia.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
tariqt@...dia.com, Dan Merillat <git@....merillat.org>
Subject: Re: [PATCH] qsfp: Better handling of Page 03h netlink read failure
Hi, thanks for the patch. Some comments below (mainly about the
process).
Subject prefix should be "[PATCH ethtool]" instead of "[PATCH]"
Best to post as a separate thread instead of as a reply to a thread.
Looks weird in lore (https://lore.kernel.org/netdev/) otherwise.
On Sun, Jul 07, 2024 at 08:41:38PM -0700, Krzysztof Olędzki wrote:
> Page 03h may not be available due to a bug in a driver.
> This is a non-fatal error and sff8636_dom_parse() handles this
> correctly, allowing it to provide the remaining information.
In addition to the problem, need to describe what the patch is doing in
imperative mood. Something like:
"
When dumping the EEPROM contents of a QSFP transceiver module, ethtool
will only ask the kernel to retrieve Upper Page 03h if the module
advertised it as supported.
However, some kernel drivers like mlx4 are currently unable to provide
the page, resulting in the kernel returning an error. Since Upper Page
03h is optional, do not treat the error as fatal. Instead, print an
error message and allow ethtool to continue and parse / print the
contents of the other pages.
Before:
# ethtool -m eth3
<OUTPUT BEFORE>
After:
# ethtool -m eth3
<OUTPUT AFTER>
Fixes: 25b64c66f58d ("ethtool: Add netlink handler for getmodule (-m)")
Signed-off-by: Krzysztof Olędzki <ole@....pl>
"
>
> Also, add an error message to clarify otherwise cryptic
> "netlink error: Invalid argument" message.
> ---
> qsfp.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/qsfp.c b/qsfp.c
> index a2921fb..208eddc 100644
> --- a/qsfp.c
> +++ b/qsfp.c
> @@ -1038,8 +1038,16 @@ sff8636_memory_map_init_pages(struct cmd_context *ctx,
>
> sff8636_request_init(&request, 0x3, SFF8636_PAGE_SIZE);
> ret = nl_get_eeprom_page(ctx, &request);
> - if (ret < 0)
> - return ret;
> + if (ret < 0) {
> + /* Page 03h is not available due to a bug in the driver.
> + * This is a non-fatal error and sff8636_dom_parse()
> + * handles this correctly.
> + */
> +
Unnecessary blank line
> + fprintf(stderr, "Failed to read Upper Page 03h, driver error?\n");
> + return 0;
> + }
> +
> map->page_03h = request.data - SFF8636_PAGE_SIZE;
>
> return 0;
> --
> 2.45.2
>
Powered by blists - more mailing lists