From: Jakub Kicinski <kuba@kernel.org>
To: Donald Hunter <donald.hunter@gmail.com>
Cc: Jiri Pirko <jiri@resnulli.us>,
Stephen Hemminger <stephen@networkplumber.org>,
netdev@vger.kernel.org
Subject: Re: [PATCH 1/3] net/sched: netem: use extack
Date: Fri, 2 Feb 2024 08:23:58 -0800 [thread overview]
Message-ID: <20240202082358.1f2fd8ec@kernel.org> (raw)
In-Reply-To: <m2bk8zulpb.fsf@gmail.com>
On Fri, 02 Feb 2024 11:53:04 +0000 Donald Hunter wrote:
> > 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.
>
> There's also these which maybe complicates things:
>
> $ git grep -A1 'if (opt == NULL)' -- net/sched/
> net/sched/cls_flow.c: if (opt == NULL)
> net/sched/cls_flow.c- return -EINVAL;
> --
> net/sched/sch_choke.c: if (opt == NULL)
> net/sched/sch_choke.c- return -EINVAL;
> --
> net/sched/sch_fifo.c: if (opt == NULL) {
> net/sched/sch_fifo.c- u32 limit = qdisc_dev(sch)->tx_queue_len;
> --
> net/sched/sch_hfsc.c: if (opt == NULL)
> net/sched/sch_hfsc.c- return -EINVAL;
> --
> net/sched/sch_plug.c: if (opt == NULL) {
> net/sched/sch_plug.c- q->limit = qdisc_dev(sch)->tx_queue_len
That's fine, I was thinking opt-in. Add a bit to ops that says
"init_requires_opts" or whatnot.
> I'm in favour of qdisc specific extack messages.
Most of them just say "$name requires options" in a more or less concise
and more or less well spelled form :( Even if we don't want to depend
purely on ATTR_MISS - extack messages support printf now, and we have
the qdisc name in the ops (ops->id), so we can printf the same string
in the core.
Just an idea, if you all prefer to keep things as they are, that's fine.
But we've been sprinkling the damn string messages throughout TC for
years now, and still they keep coming and still if you step one foot
away from the most actively developed actions and classifiers, you're
back in the 90s :(
next prev parent reply other threads:[~2024-02-02 16:24 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
2024-02-02 11:53 ` Donald Hunter
2024-02-02 16:23 ` Jakub Kicinski [this message]
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=20240202082358.1f2fd8ec@kernel.org \
--to=kuba@kernel.org \
--cc=donald.hunter@gmail.com \
--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 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).