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: <20250722170638.GT2459@horms.kernel.org>
Date: Tue, 22 Jul 2025 18:06:38 +0100
From: Simon Horman <horms@...nel.org>
To: Subbaraya Sundeep <sbhatta@...vell.com>
Cc: andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
	kuba@...nel.org, pabeni@...hat.com, gakula@...vell.com,
	hkelam@...vell.com, bbhushan2@...vell.com, jerinj@...vell.com,
	lcherian@...vell.com, sgoutham@...vell.com, netdev@...r.kernel.org
Subject: Re: [net-next PATCH v3 08/11] octeontx2-pf: Initialize new NIX SQ
 context for cn20k

On Thu, Jul 17, 2025 at 10:37:40PM +0530, Subbaraya Sundeep wrote:
> cn20k has different NIX context for send queue hence use
> the new cn20k mailbox to init SQ context.
> 
> Signed-off-by: Subbaraya Sundeep <sbhatta@...vell.com>
> ---
>  .../ethernet/marvell/octeontx2/nic/cn20k.c    | 36 ++++++++++++++++++-
>  1 file changed, 35 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn20k.c b/drivers/net/ethernet/marvell/octeontx2/nic/cn20k.c
> index 037548f36940..4f0afa5301b4 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/cn20k.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn20k.c
> @@ -389,11 +389,45 @@ static int cn20k_pool_aq_init(struct otx2_nic *pfvf, u16 pool_id,
>  	return 0;
>  }
>  
> +static int cn20k_sq_aq_init(void *dev, u16 qidx, u8 chan_offset, u16 sqb_aura)
> +{
> +	struct nix_cn20k_aq_enq_req *aq;
> +	struct otx2_nic *pfvf = dev;
> +
> +	/* Get memory to put this msg */
> +	aq = otx2_mbox_alloc_msg_nix_cn20k_aq_enq(&pfvf->mbox);
> +	if (!aq)
> +		return -ENOMEM;
> +
> +	aq->sq.cq = pfvf->hw.rx_queues + qidx;
> +	aq->sq.max_sqe_size = NIX_MAXSQESZ_W16; /* 128 byte */
> +	aq->sq.cq_ena = 1;
> +	aq->sq.ena = 1;
> +	aq->sq.smq = otx2_get_smq_idx(pfvf, qidx);
> +	aq->sq.smq_rr_weight = mtu_to_dwrr_weight(pfvf, pfvf->tx_max_pktlen);
> +	aq->sq.default_chan = pfvf->hw.tx_chan_base + chan_offset;
> +	aq->sq.sqe_stype = NIX_STYPE_STF; /* Cache SQB */
> +	aq->sq.sqb_aura = sqb_aura;
> +	aq->sq.sq_int_ena = NIX_SQINT_BITS;
> +	aq->sq.qint_idx = 0;
> +	/* Due pipelining impact minimum 2000 unused SQ CQE's
> +	 * need to maintain to avoid CQ overflow.
> +	 */
> +	aq->sq.cq_limit = ((SEND_CQ_SKID * 256) / (pfvf->qset.sqe_cnt));

nit: Unnecessary parentheses

     I think this will work just as well (completely untested):

	aq->sq.cq_limit = (SEND_CQ_SKID * 256) / pfvf->qset.sqe_cnt;

> +
> +	/* Fill AQ info */
> +	aq->qidx = qidx;
> +	aq->ctype = NIX_AQ_CTYPE_SQ;
> +	aq->op = NIX_AQ_INSTOP_INIT;
> +
> +	return otx2_sync_mbox_msg(&pfvf->mbox);
> +}

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ