From: Yael Chemla <ychemla@nvidia.com>
To: Jakub Kicinski <kuba@kernel.org>, Tariq Toukan <tariqt@nvidia.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Saeed Mahameed <saeedm@nvidia.com>,
Leon Romanovsky <leon@kernel.org>,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org, Moshe Shemesh <moshe@nvidia.com>,
Mark Bloch <mbloch@nvidia.com>, Gal Pressman <gal@nvidia.com>
Subject: Re: [PATCH net-next 2/2] net/mlx5e: Log error messages when extack is not present
Date: Wed, 4 Jun 2025 00:01:05 +0300 [thread overview]
Message-ID: <2c0f4a69-dd90-4822-9981-faa90f7a58a6@nvidia.com> (raw)
In-Reply-To: <20250527174955.594f3617@kernel.org>
On 28/05/2025 3:49, Jakub Kicinski wrote:
> On Sun, 25 May 2025 14:47:32 +0300 Tariq Toukan wrote:
>> Encapsulate netlink error message macros to ensure error message remain
>> visible in dmesg when the userspace does not support netlink.
>>
>> This allows drivers to continue providing meaningful error messages even
>> when netlink is available in kernel but not in userspace.
>>
>> Replace direct extack macro calls with new wrapper macros to support
>> this fallback behavior.
>
> Please break this down API by API and explain for each why user space
> can't use netlink. If we thought this was a good idea we would have
> added the pr_err() to the NL_SET_ERR_MSG_MOD() from the start.
Hi Jakub,
Thanks for the feedback.
To clarify: extack can be NULL when userspace tools (like ethtool, tc,
or devlink) send Netlink messages without the NLM_F_ACK flag. In such
cases, the kernel usually won’t send an NLMSG_ERROR unless the failure
is immediate. For more complex or asynchronous operations (like hardware
offloads), NLM_F_ACK enables meaningful error reporting; otherwise,
userspace might see only a generic errno or nothing at all.
The NL_SET_ERR_MSG_MOD() and NL_SET_ERR_MSG_FMT_MOD() macros are safe in
this context—they internally check for extack and no-op if it’s NULL.
Regarding the APIs modified in this patch:
Ethtool APIs: While Netlink support was introduced around versions
5.6–5.8, many LTS distributions (e.g., Ubuntu 20.04, CentOS 7) still
ship with older userspace ethtool utilities that rely on ioctl for
certain operations. In these ioctl-based paths, the extack pointer
passed down to the driver may legitimately be NULL.
TC APIs: Even though TC is predominantly Netlink-based, extack can still
be NULL in certain internal driver code, legacy handling, or specific
test/debug scenarios.
If a narrower scope is preferred, I can revise the patch to include only
the ethtool-related changes, which were the primary motivation behind
this work.
Thanks again,
Yael Chemla
next prev parent reply other threads:[~2025-06-03 21:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-25 11:47 [PATCH net-next 0/2] net/mlx5: misc changes 2025-05-25 Tariq Toukan
2025-05-25 11:47 ` [PATCH net-next 1/2] net/mlx5: Warn when write combining is not supported Tariq Toukan
2025-05-25 11:47 ` [PATCH net-next 2/2] net/mlx5e: Log error messages when extack is not present Tariq Toukan
2025-05-28 0:49 ` Jakub Kicinski
2025-06-03 21:01 ` Yael Chemla [this message]
2025-06-04 2:50 ` Jakub Kicinski
2025-06-04 10:23 ` Ido Schimmel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2c0f4a69-dd90-4822-9981-faa90f7a58a6@nvidia.com \
--to=ychemla@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mbloch@nvidia.com \
--cc=moshe@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®