[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<PAXPR07MB7984749932F11F883982B4C2A323A@PAXPR07MB7984.eurprd07.prod.outlook.com>
Date: Mon, 4 Aug 2025 08:31:21 +0000
From: "Chia-Yu Chang (Nokia)" <chia-yu.chang@...ia-bell-labs.com>
To: David Ahern <dsahern@...nel.org>, "alok.a.tiwari@...cle.com"
<alok.a.tiwari@...cle.com>, "donald.hunter@...il.com"
<donald.hunter@...il.com>, "xandfury@...il.com" <xandfury@...il.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>, "dave.taht@...il.com"
<dave.taht@...il.com>, "pabeni@...hat.com" <pabeni@...hat.com>,
"jhs@...atatu.com" <jhs@...atatu.com>, "kuba@...nel.org" <kuba@...nel.org>,
"stephen@...workplumber.org" <stephen@...workplumber.org>,
"xiyou.wangcong@...il.com" <xiyou.wangcong@...il.com>, "jiri@...nulli.us"
<jiri@...nulli.us>, "davem@...emloft.net" <davem@...emloft.net>,
"edumazet@...gle.com" <edumazet@...gle.com>, "horms@...nel.org"
<horms@...nel.org>, "andrew+netdev@...n.ch" <andrew+netdev@...n.ch>,
"ast@...erby.net" <ast@...erby.net>, "liuhangbin@...il.com"
<liuhangbin@...il.com>, "shuah@...nel.org" <shuah@...nel.org>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
"ij@...nel.org" <ij@...nel.org>, "ncardwell@...gle.com"
<ncardwell@...gle.com>, "Koen De Schepper (Nokia)"
<koen.de_schepper@...ia-bell-labs.com>, "g.white@...lelabs.com"
<g.white@...lelabs.com>, "ingemar.s.johansson@...csson.com"
<ingemar.s.johansson@...csson.com>, "mirja.kuehlewind@...csson.com"
<mirja.kuehlewind@...csson.com>, "cheshire@...le.com" <cheshire@...le.com>,
"rs.ietf@....at" <rs.ietf@....at>, "Jason_Livingood@...cast.com"
<Jason_Livingood@...cast.com>, "vidhi_goel@...le.com" <vidhi_goel@...le.com>
CC: Olga Albisser <olga@...isser.org>, "Olivier Tilmans (Nokia)"
<olivier.tilmans@...ia.com>, Bob Briscoe <research@...briscoe.net>, Henrik
Steen <henrist@...rist.net>
Subject: RE: [PATCH v11 iproute2-next 1/1] tc: add dualpi2 scheduler module
> -----Original Message-----
> From: David Ahern <dsahern@...nel.org>
> Sent: Wednesday, July 30, 2025 1:45 AM
> To: Chia-Yu Chang (Nokia) <chia-yu.chang@...ia-bell-labs.com>; alok.a.tiwari@...cle.com; donald.hunter@...il.com; xandfury@...il.com; netdev@...r.kernel.org; dave.taht@...il.com; pabeni@...hat.com; jhs@...atatu.com; kuba@...nel.org; stephen@...workplumber.org; xiyou.wangcong@...il.com; jiri@...nulli.us; davem@...emloft.net; edumazet@...gle.com; horms@...nel.org; andrew+netdev@...n.ch; ast@...erby.net; liuhangbin@...il.com; shuah@...nel.org; linux-kselftest@...r.kernel.org; ij@...nel.org; ncardwell@...gle.com; Koen De Schepper (Nokia) <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
> Cc: Olga Albisser <olga@...isser.org>; Olivier Tilmans (Nokia) <olivier.tilmans@...ia.com>; Bob Briscoe <research@...briscoe.net>; Henrik Steen <henrist@...rist.net>
> Subject: Re: [PATCH v11 iproute2-next 1/1] tc: add dualpi2 scheduler module
>
>
> CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information.
>
>
>
> On 7/17/25 5:23 PM, chia-yu.chang@...ia-bell-labs.com wrote:
> > diff --git a/include/uapi/linux/pkt_sched.h
> > b/include/uapi/linux/pkt_sched.h index 958d9407..15d1a37a 100644
> > --- a/include/uapi/linux/pkt_sched.h
> > +++ b/include/uapi/linux/pkt_sched.h
>
> you can drop the uapi changes.
Hi,
Sorry for the late reply, this will be done along with the following two requests.
>
[...]
> > --git a/lib/utils.c b/lib/utils.c index 706e93c3..dd242d4d 100644
> > --- a/lib/utils.c
> > +++ b/lib/utils.c
> > @@ -220,6 +220,36 @@ int get_unsigned(unsigned int *val, const char *arg, int base)
> > return 0;
> > }
> >
> > +int get_float(float *val, const char *arg) {
> > + float res;
> > + char *ptr;
> > +
> > + if (!arg || !*arg)
> > + return -1;
> > + res = strtof(arg, &ptr);
> > + if (!ptr || ptr == arg || *ptr)
> > + return -1;
> > + *val = res;
> > + return 0;
> > +}
>
> Put the move of get_float in a standlone patch indicating it is a code move.
>
>
> > +
> > +int get_float_min_max(float *val, const char *arg, float min, float
> > +max) {
> > + float res;
> > + char *ptr;
> > +
> > + if (!arg || !*arg)
> > + return -1;
> > + res = strtof(arg, &ptr);
> > + if (!ptr || ptr == arg || *ptr)
> > + return -1;
> > + if (res < min || res > max)
> > + return -1;
> > + *val = res;
> > + return 0;
> > +}
> > +
> > /*
> > * get_time_rtt is "translated" from a similar routine "get_time" in
> > * tc_util.c. We don't use the exact same routine because tc passes
>
> Add get_float_min_max in a standalone patch.
>
>
>
> > diff --git a/tc/q_dualpi2.c b/tc/q_dualpi2.c new file mode 100644
> > index 00000000..50d52aad
> > --- /dev/null
> > +++ b/tc/q_dualpi2.c
> > @@ -0,0 +1,528 @@
[...]
> > +
> > +static int get_packets(uint32_t *val, const char *arg) {
> > + unsigned long res;
> > + char *ptr;
> > +
> > + if (!arg || !*arg)
> > + return -1;
> > + res = strtoul(arg, &ptr, 10);
> > + if (!ptr || ptr == arg ||
> > + !(matches(ptr, "pkts") == 0 || matches(ptr, "packets") ==
> > + 0))
>
> we are not allowing any more uses of "matches".
Then, is it allowed to use strncmp iteratively?
Or any other suggested function could be used?
>
>
> > + return -1;
> > + if (res == ULONG_MAX && errno == ERANGE)
> > + return -1;
> > + if (res > 0xFFFFFFFFUL)
> > + return -1;
> > + *val = res;
> > +
> > + return 0;
> > +}
[...]
> > +static int dualpi2_parse_opt(const struct qdisc_util *qu, int argc,
> > + char **argv, struct nlmsghdr *n, const char
> > +*dev) {
> > + uint32_t limit = 0;
> > + uint32_t memory_limit = 0;
> > + uint32_t target = 0;
> > + uint32_t tupdate = 0;
> > + uint32_t alpha = DEFAULT_ALPHA_BETA;
> > + uint32_t beta = DEFAULT_ALPHA_BETA;
> > + int32_t coupling_factor = -1;
> > + uint8_t ecn_mask = 0;
> > + int step_unit = __TCA_DUALPI2_MAX;
> > + uint32_t step_thresh = 0;
> > + uint32_t min_qlen_step = 0;
> > + bool set_min_qlen_step = false;
> > + int c_protection = -1;
> > + uint8_t drop_early = __TCA_DUALPI2_DROP_EARLY_MAX;
> > + uint8_t drop_overload = __TCA_DUALPI2_DROP_OVERLOAD_MAX;
> > + uint8_t split_gso = __TCA_DUALPI2_SPLIT_GSO_MAX;
> > + uint32_t rtt_max = 0;
> > + uint32_t rtt_typ = 0;
> > + struct rtattr *tail;
>
> iproute2 follows kernel coding standards and netdev's preference for reverse xmas tree listing of variables.
Sure, I will take correspondence course of actions.
Chia-Yu
Powered by blists - more mailing lists