lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250317064053.4fe8425b@hermes.local>
Date: Mon, 17 Mar 2025 06:40:53 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: chia-yu.chang@...ia-bell-labs.com
Cc: netdev@...r.kernel.org, dave.taht@...il.com, pabeni@...hat.com,
 jhs@...atatu.com, kuba@...nel.org, xiyou.wangcong@...il.com,
 jiri@...nulli.us, davem@...emloft.net, edumazet@...gle.com,
 horms@...nel.org, andrew+netdev@...n.ch, donald.hunter@...il.com,
 ast@...erby.net, liuhangbin@...il.com, shuah@...nel.org,
 linux-kselftest@...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>, Oliver Tilmans
 <olivier.tilmans@...ia.com>, Bob Briscoe <research@...briscoe.net>, Henrik
 Steen <henrist@...rist.net>
Subject: Re: [PATCH v4 iproute2-next 1/1] tc: add dualpi2 scheduler module

On Sun, 16 Mar 2025 16:39:17 +0100
chia-yu.chang@...ia-bell-labs.com wrote:

> +static int try_get_percentage(int *val, const char *arg, int base)
> +{
> +	long res;
> +	char *ptr;
> +
> +	if (!arg || !*arg)
> +		return -1;
> +	res = strtol(arg, &ptr, base);
> +	if (!ptr || ptr == arg || (*ptr && strcmp(ptr, "%")))
> +		return -1;
> +	if (res == ULONG_MAX && errno == ERANGE)
> +		return -1;
> +	if (res < 0 || res > 100)
> +		return -1;
> +
> +	*val = res;
> +	return 0;
> +}
> +

I wonder if dualpi2 and netem could share some code on handling
scaled percentage values.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ