[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240803113154.67a37efb@hermes.local>
Date: Sat, 3 Aug 2024 11:31:54 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Zhu Yanjun <yanjun.zhu@...ux.dev>
Cc: Shradha Gupta <shradhagupta@...ux.microsoft.com>,
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 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.
Powered by blists - more mailing lists