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: <a9473fc0-d721-466e-b70c-8e9010c5c541@kernel.org>
Date: Wed, 26 Feb 2025 09:06:10 -0700
From: David Ahern <dsahern@...nel.org>
To: Jonathan Lennox <jonathan.lennox@....com>
Cc: netdev@...r.kernel.org, Stephen Hemminger <stephen@...workplumber.org>
Subject: Re: [PATCH iproute2 v3] tc: Fix rounding in tc_calc_xmittime and
 tc_calc_xmitsize.

On 2/24/25 11:42 AM, Jonathan Lennox wrote:
> diff --git a/tc/tc_core.c b/tc/tc_core.c
> index 37547e9b..32fd094f 100644
> --- a/tc/tc_core.c
> +++ b/tc/tc_core.c
> @@ -23,12 +23,12 @@
> static double tick_in_usec = 1;
> static double clock_factor = 1;
> 
> -static unsigned int tc_core_time2tick(unsigned int time)
> +static double tc_core_time2tick(double time)
> {
> 	return time * tick_in_usec;
> }
> 
> -unsigned int tc_core_tick2time(unsigned int tick)
> +double tc_core_tick2time(double tick)
> {
> 	return tick / tick_in_usec;
> }
> @@ -45,7 +45,7 @@ unsigned int tc_core_ktime2time(unsigned int ktime)
> 
> unsigned int tc_calc_xmittime(__u64 rate, unsigned int size)
> {
> -	return tc_core_time2tick(TIME_UNITS_PER_SEC*((double)size/(double)rate));
> +	return ceil(tc_core_time2tick(TIME_UNITS_PER_SEC*((double)size/(double)rate)));
> }
> 
> unsigned int tc_calc_xmitsize(__u64 rate, unsigned int ticks)
> diff --git a/tc/tc_core.h b/tc/tc_core.h
> index 7a986ac2..c0fb7481 100644
> --- a/tc/tc_core.h
> +++ b/tc/tc_core.h
> @@ -12,7 +12,7 @@ enum link_layer {
> };
> 
> 
> -unsigned tc_core_tick2time(unsigned tick);
> +double tc_core_tick2time(double tick);
> unsigned tc_core_time2ktime(unsigned time);
> unsigned tc_core_ktime2time(unsigned ktime);
> unsigned tc_calc_xmittime(__u64 rate, unsigned size);


git am (and patch for that matter) is not liking your patch. Please make
sure the patch is against iproute2-next and top of tree.

You should also try sending the patch to yourself, saving to a file and
applying using `git am`.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ