From: Jakub Kicinski <kuba@kernel.org>
To: <edward.cree@amd.com>
Cc: <netdev@vger.kernel.org>, <linux-net-drivers@amd.com>,
<davem@davemloft.net>, <pabeni@redhat.com>, <edumazet@google.com>,
<habetsm.xilinx@gmail.com>, <johannes@sipsolutions.net>,
<marcelo.leitner@gmail.com>, Edward Cree <ecree.xilinx@gmail.com>
Subject: Re: [RFC PATCH v2 net-next 1/3] netlink: add support for formatted extack messages
Date: Thu, 13 Oct 2022 08:29:13 -0700 [thread overview]
Message-ID: <20221013082913.0719721e@kernel.org> (raw)
In-Reply-To: <26c2cf2e699de83905e2c21491b71af0e34d00d8.1665567166.git.ecree.xilinx@gmail.com>
On Thu, 13 Oct 2022 10:23:00 +0100 edward.cree@amd.com wrote:
> + if (snprintf(__extack->_msg_buf, NETLINK_MAX_FMTMSG_LEN, \
> + (fmt), ##args) >= NETLINK_MAX_FMTMSG_LEN) \
> + net_warn_ratelimited("truncated extack: " fmt "\n", \
> + ##args); \
> + \
Some "take it or leave it" comments:
- Jiri's idea of always printing may be worth exploring
- my preference would also be to produce a warning on overflow,
rather than the exact print, because I always worry about people
starting to depend on the print.
And WARN_ON() is really heavy and may trigger remediations even
tho truncated extack is just a minor nuisance.
I'd do:
pr(extack formatting overflow $__FILE__:$__func__:$__LINE__ $needed_len)
(I think splicing the "trunced extack:" with fmt will result
in the format string getting stored in .ro twice?)
next prev parent reply other threads:[~2022-10-13 15:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-13 9:22 [RFC PATCH v2 net-next 0/3] netlink: formatted extacks edward.cree
2022-10-13 9:23 ` [RFC PATCH v2 net-next 1/3] netlink: add support for formatted extack messages edward.cree
2022-10-13 15:29 ` Jakub Kicinski [this message]
2022-10-13 16:16 ` Johannes Berg
2022-10-13 16:32 ` Jakub Kicinski
2022-10-17 12:04 ` Edward Cree
2022-10-17 18:40 ` Jakub Kicinski
2022-10-13 9:23 ` [RFC PATCH v2 net-next 2/3] sfc: use formatted extacks instead of efx_tc_err() edward.cree
2022-10-13 9:23 ` [RFC PATCH v2 net-next 3/3] sfc: remove 'log-tc-errors' ethtool private flag edward.cree
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=20221013082913.0719721e@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@google.com \
--cc=edward.cree@amd.com \
--cc=habetsm.xilinx@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=linux-net-drivers@amd.com \
--cc=marcelo.leitner@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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;
as well as URLs for NNTP newsgroup(s).