Subject: Re: [PATCH net-next v5 08/15] octeontx2-pf: ipsec: Setup NIX HW resources for inbound flows

From: Simon Horman <[email-masked]>
Date: Tue, 28 Oct 2025 10:45:59 +0000

On Sun, Oct 26, 2025 at 08:39:03PM +0530, Tanmay Jagdale wrote:

...

> +static int cn10k_ipsec_setup_nix_rx_hw_resources(struct otx2_nic *pfvf)
> +{
> +	int rbsize, err, pool;
> +
> +	mutex_lock(&pfvf->mbox.lock);
> +
> +	/* Initialize Pool for first pass */
> +	err = cn10k_ipsec_aura_and_pool_init(pfvf, pfvf->ipsec.inb_ipsec_pool);
> +	if (err)

Hi Tanmay,

Not a full review by any means, but this appears to leak mbox.lock.

> +		return err;
> +
> +	/* Initialize first pass RQ and map buffers from pool_id */
> +	err = cn10k_ipsec_ingress_rq_init(pfvf, pfvf->ipsec.inb_ipsec_rq,
> +					  pfvf->ipsec.inb_ipsec_pool);
> +	if (err)
> +		goto free_auras;
> +
> +	/* Initialize SPB pool for second pass */
> +	rbsize = pfvf->rbsize;
> +	pfvf->rbsize = 512;
> +
> +	for (pool = pfvf->ipsec.inb_ipsec_spb_pool;
> +	     pool < pfvf->hw.rx_queues + pfvf->ipsec.inb_ipsec_spb_pool; pool++) {
> +		err = cn10k_ipsec_aura_and_pool_init(pfvf, pool);
> +		if (err)
> +			goto free_auras;
> +	}
> +	pfvf->rbsize = rbsize;
> +
> +	mutex_unlock(&pfvf->mbox.lock);
> +	return 0;
> +
> +free_auras:
> +	cn10k_ipsec_free_aura_ptrs(pfvf);
> +	mutex_unlock(&pfvf->mbox.lock);
> +	otx2_mbox_reset(&pfvf->mbox.mbox, 0);
> +	return err;
> +}

...

-- 
pw-bot: cr