From: Jiri Pirko <jiri@resnulli.us>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 1/3] net/sched: netem: use extack
Date: Thu, 1 Feb 2024 10:30:27 +0100 [thread overview]
Message-ID: <Zbtks__SZIgoDTaj@nanopsycho> (raw)
In-Reply-To: <20240201034653.450138-2-stephen@networkplumber.org>
Thu, Feb 01, 2024 at 04:45:58AM CET, stephen@networkplumber.org wrote:
>The error handling in netem predates introduction of extack,
>and was mostly using pr_info(). Use extack to put errors in
>result rather than console log.
>
[...]
>@@ -1068,18 +1073,16 @@ static int netem_init(struct Qdisc *sch, struct nlattr *opt,
> struct netlink_ext_ack *extack)
> {
> struct netem_sched_data *q = qdisc_priv(sch);
>- int ret;
>
> qdisc_watchdog_init(&q->watchdog, sch);
>
>- if (!opt)
>+ if (!opt) {
>+ NL_SET_ERR_MSG_MOD(extack, "Netem missing required parameters");
Drop "Netem " here.
Otherwise, this looks fine.
> return -EINVAL;
>+ }
>
> q->loss_model = CLG_RANDOM;
>- ret = netem_change(sch, opt, extack);
>- if (ret)
>- pr_info("netem: change failed\n");
>- return ret;
>+ return netem_change(sch, opt, extack);
> }
>
> static void netem_destroy(struct Qdisc *sch)
>--
>2.43.0
>
>
next prev parent reply other threads:[~2024-02-01 9:30 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 [this message]
2024-02-01 17:00 ` Jakub Kicinski
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=Zbtks__SZIgoDTaj@nanopsycho \
--to=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.