[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241015084021.377104e2@kernel.org>
Date: Tue, 15 Oct 2024 08:40:21 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Jamal Hadi Salim <jhs@...atatu.com>, chia-yu.chang@...ia-bell-labs.com
Cc: netdev@...r.kernel.org, ij@...nel.org, ncardwell@...gle.com,
koen.de_schepper@...ia-bell-labs.com, g.white@...lelabs.com,
ingemar.s.johansson@...csson.com, mirja.kuehlewind@...csson.com,
cheshire@...le.com, rs.ietf@....at, Jason_Livingood@...cast.com,
vidhi_goel@...le.com, Olga Albisser <olga@...isser.org>, Olivier Tilmans
<olivier.tilmans@...ia.com>, Henrik Steen <henrist@...rist.net>, Bob
Briscoe <research@...briscoe.net>
Subject: Re: [PATCH net-next 01/44] sched: Add dualpi2 qdisc
On Tue, 15 Oct 2024 11:30:01 -0400 Jamal Hadi Salim wrote:
> > + if (tb[TCA_DUALPI2_ALPHA]) {
> > + u32 alpha = nla_get_u32(tb[TCA_DUALPI2_ALPHA]);
> > +
> > + if (alpha > ALPHA_BETA_MAX) {
> > + NL_SET_ERR_MSG_ATTR(extack, tb[TCA_DUALPI2_ALPHA],
> > + "alpha is too large.");
> > + sch_tree_unlock(sch);
> > + return -EINVAL;
> > + }
> > + q->pi2.alpha = dualpi2_scale_alpha_beta(alpha);
> > + }
>
> You should consider using netlink policies for these checks (for
> example, you can check for min/max without replicating code as above).
> Applies in quiet a few places (and not just for max/min validation)
In fact I think we should also start asking for YAML specs.
Donald already added most of the existing TC stuff.
Please extend Documentation/netlink/specs/tc.yaml
Powered by blists - more mailing lists