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] [day] [month] [year] [list]
Message-ID: <20240805034819.GA13225@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
Date: Sun, 4 Aug 2024 20:48:19 -0700
From: Shradha Gupta <shradhagupta@...ux.microsoft.com>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: Zhu Yanjun <yanjun.zhu@...ux.dev>, linux-hyperv@...r.kernel.org,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-rdma@...r.kernel.org, "K. Y. Srinivasan" <kys@...rosoft.com>,
	Haiyang Zhang <haiyangz@...rosoft.com>,
	Wei Liu <wei.liu@...nel.org>, Dexuan Cui <decui@...rosoft.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Long Li <longli@...rosoft.com>,
	Ajay Sharma <sharmaajay@...rosoft.com>,
	Simon Horman <horms@...nel.org>,
	Konstantin Taranov <kotaranov@...rosoft.com>,
	Souradeep Chakrabarti <schakrabarti@...ux.microsoft.com>,
	Erick Archer <erick.archer@...look.com>,
	Pavan Chebbi <pavan.chebbi@...adcom.com>,
	Ahmed Zaki <ahmed.zaki@...el.com>,
	Colin Ian King <colin.i.king@...il.com>
Subject: Re: [PATCH net-next v2] net: mana: Implement
 get_ringparam/set_ringparam for mana

On Sat, Aug 03, 2024 at 11:31:54AM -0700, Stephen Hemminger wrote:
> On Sun, 4 Aug 2024 02:09:21 +0800
> Zhu Yanjun <yanjun.zhu@...ux.dev> wrote:
> 
> > >   
> > >   	/*  The minimum size of the WQE is 32 bytes, hence
> > > -	 *  MAX_SEND_BUFFERS_PER_QUEUE represents the maximum number of WQEs
> > > +	 *  apc->tx_queue_size represents the maximum number of WQEs
> > >   	 *  the SQ can store. This value is then used to size other queues
> > >   	 *  to prevent overflow.
> > > +	 *  Also note that the txq_size is always going to be MANA_PAGE_ALIGNED,
> > > +	 *  as tx_queue_size is always a power of 2.
> > >   	 */
> > > -	txq_size = MAX_SEND_BUFFERS_PER_QUEUE * 32;
> > > -	BUILD_BUG_ON(!MANA_PAGE_ALIGNED(txq_size));
> > > +	txq_size = apc->tx_queue_size * 32;  
> > 
> > Not sure if the following is needed or not.
> > "
> > WARN_ON(!MANA_PAGE_ALIGNED(txq_size));
> > "
> > 
> > Zhu Yanjun
> 
> On many systems warn is set to panic the system.
> Any constraint like this should be enforced where user input
> is managed. In this patch, that would be earlier in mana_set_ringparam().
> Looking there, the only requirement is that txq_size is between
> the min/max buffers per queue and a power of 2.

Thanks Stephen, that's right.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ