From: Jakub Kicinski <kuba@kernel.org>
To: Jiri Pirko <jiri@resnulli.us>
Cc: Stephen Hemminger <stephen@networkplumber.org>, netdev@vger.kernel.org
Subject: Re: [PATCH 1/3] net/sched: netem: use extack
Date: Thu, 1 Feb 2024 09:00:46 -0800 [thread overview]
Message-ID: <20240201090046.1b93bcbd@kernel.org> (raw)
In-Reply-To: <Zbtks__SZIgoDTaj@nanopsycho>
On Thu, 1 Feb 2024 10:30:27 +0100 Jiri Pirko wrote:
> Thu, Feb 01, 2024 at 04:45:58AM CET, stephen@networkplumber.org wrote:
> >- if (!opt)
> >+ if (!opt) {
> >+ NL_SET_ERR_MSG_MOD(extack, "Netem missing required parameters");
>
> Drop "Netem " here.
>
> Otherwise, this looks fine.
Looks like most sch's require opt. Would it be a bad idea to pull
the check out to the caller? Minor simplification, plus the caller
has the outer message so they can use NL_SET_ERR_ATTR_MISS() and
friends.
$ git grep -A1 'if (!opt)' -- net/sched/
net/sched/cls_fw.c: if (!opt)
net/sched/cls_fw.c- return handle ? -EINVAL : 0; /* Succeed if it is old method. */
--
net/sched/cls_u32.c: if (!opt) {
net/sched/cls_u32.c- if (handle) {
--
net/sched/sch_cbs.c: if (!opt) {
net/sched/sch_cbs.c- NL_SET_ERR_MSG(extack, "Missing CBS qdisc options which are mandatory");
--
net/sched/sch_drr.c: if (!opt) {
net/sched/sch_drr.c- NL_SET_ERR_MSG(extack, "DRR options are required for this operation");
--
net/sched/sch_etf.c: if (!opt) {
net/sched/sch_etf.c- NL_SET_ERR_MSG(extack,
--
net/sched/sch_ets.c: if (!opt) {
net/sched/sch_ets.c- NL_SET_ERR_MSG(extack, "ETS options are required for this operation");
--
net/sched/sch_ets.c: if (!opt)
net/sched/sch_ets.c- return -EINVAL;
--
net/sched/sch_gred.c: if (!opt)
net/sched/sch_gred.c- return -EINVAL;
--
net/sched/sch_htb.c: if (!opt)
net/sched/sch_htb.c- return -EINVAL;
--
net/sched/sch_htb.c: if (!opt)
net/sched/sch_htb.c- goto failure;
--
net/sched/sch_multiq.c: if (!opt)
net/sched/sch_multiq.c- return -EINVAL;
--
net/sched/sch_netem.c: if (!opt)
net/sched/sch_netem.c- return -EINVAL;
--
net/sched/sch_prio.c: if (!opt)
net/sched/sch_prio.c- return -EINVAL;
--
net/sched/sch_red.c: if (!opt)
net/sched/sch_red.c- return -EINVAL;
--
net/sched/sch_skbprio.c: if (!opt)
net/sched/sch_skbprio.c- return 0;
--
net/sched/sch_taprio.c: if (!opt)
net/sched/sch_taprio.c- return -EINVAL;
--
net/sched/sch_tbf.c: if (!opt)
net/sched/sch_tbf.c- return -EINVAL;
next prev parent reply other threads:[~2024-02-01 17:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-01 3:45 [PATCH 0/3] net/sched: netem cleanups Stephen Hemminger
2024-02-01 3:45 ` [PATCH 1/3] net/sched: netem: use extack Stephen Hemminger
2024-02-01 9:30 ` Jiri Pirko
2024-02-01 17:00 ` Jakub Kicinski [this message]
2024-02-02 11:53 ` Donald Hunter
2024-02-02 16:23 ` Jakub Kicinski
2024-02-02 17:03 ` Donald Hunter
2024-02-01 3:45 ` [PATCH 2/3] net/sched: netem: get rid of unnecesary version message Stephen Hemminger
2024-02-01 9:31 ` Jiri Pirko
2024-02-01 3:46 ` [PATCH 3/3] net/sched: netem: update intro comment Stephen Hemminger
2024-02-01 9:32 ` Jiri Pirko
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=20240201090046.1b93bcbd@kernel.org \
--to=kuba@kernel.org \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/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 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.