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: <20231204134830.uqz5xi7h7utnou7q@skbuf>
Date: Mon, 4 Dec 2023 15:48:30 +0200
From: Vladimir Oltean <vladimir.oltean@....com>
To: Roger Quadros <rogerq@...nel.org>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
	pabeni@...hat.com, s-vadapalli@...com, r-gunasekaran@...com,
	vigneshr@...com, srk@...com, horms@...nel.org, p-varis@...com,
	netdev@...r.kernel.org
Subject: Re: [PATCH v7 net-next 5/8] net: ethernet: ti: am65-cpsw: add mqprio
 qdisc offload in channel mode

On Fri, Dec 01, 2023 at 03:57:59PM +0200, Roger Quadros wrote:
> diff --git a/drivers/net/ethernet/ti/am65-cpsw-qos.c b/drivers/net/ethernet/ti/am65-cpsw-qos.c
> index 49ae9d1cd948..2733bac55bfa 100644
> --- a/drivers/net/ethernet/ti/am65-cpsw-qos.c
> +++ b/drivers/net/ethernet/ti/am65-cpsw-qos.c
> @@ -15,6 +15,8 @@
>  #include "am65-cpts.h"
>  #include "cpsw_ale.h"
>  
> +#define TO_MBPS(x)	((x) * 8 / 1000000)

Can be rewritten as ((x) * BITS_PER_BYTE / MEGA)

and further as ((x) / BYTES_PER_MBIT).

Also, I wonder if it wouldn't be better to do a DIV_ROUND_UP(x, BYTES_PER_MBIT)
instead. When user space requests a certain bandwidth, it expects to get it.
If the hardware is not fine grained enough, it should prefer giving it slightly
more rather than slightly less.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ