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: <20250620110038.GJ194429@horms.kernel.org>
Date: Fri, 20 Jun 2025 12:00:38 +0100
From: Simon Horman <horms@...nel.org>
To: Tanmay Jagdale <tanmay@...vell.com>
Cc: davem@...emloft.net, leon@...nel.org, sgoutham@...vell.com,
	bbhushan2@...vell.com, herbert@...dor.apana.org.au,
	linux-crypto@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH net-next v2 10/14] octeontx2-pf: ipsec: Handle NPA
 threshold interrupt

On Wed, Jun 18, 2025 at 05:00:04PM +0530, Tanmay Jagdale wrote:
> The NPA Aura pool that is dedicated for 1st pass inline IPsec flows
> raises an interrupt when the buffers of that aura_id drop below a
> threshold value.
> 
> Add the following changes to handle this interrupt
> - Increase the number of MSIX vectors requested for the PF/VF to
>   include NPA vector.
> - Create a workqueue (refill_npa_inline_ipsecq) to allocate and
>   refill buffers to the pool.
> - When the interrupt is raised, schedule the workqueue entry,
>   cn10k_ipsec_npa_refill_inb_ipsecq(), where the current count of
>   consumed buffers is determined via NPA_LF_AURA_OP_CNT and then
>   replenished.
> 
> Signed-off-by: Tanmay Jagdale <tanmay@...vell.com>
> ---
> Changes in V2:
> - Fixed sparse warnings
> 
> V1 Link: https://lore.kernel.org/netdev/20250502132005.611698-12-tanmay@marvell.com/
> 
>  .../marvell/octeontx2/nic/cn10k_ipsec.c       | 94 ++++++++++++++++++-
>  .../marvell/octeontx2/nic/cn10k_ipsec.h       |  1 +
>  .../ethernet/marvell/octeontx2/nic/otx2_pf.c  |  4 +
>  .../ethernet/marvell/octeontx2/nic/otx2_reg.h |  2 +
>  .../ethernet/marvell/octeontx2/nic/otx2_vf.c  |  4 +
>  5 files changed, 104 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.c b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.c

...

>  static int cn10k_inb_cpt_init(struct net_device *netdev)
>  {
>  	struct otx2_nic *pfvf = netdev_priv(netdev);
> -	int ret = 0;
> +	int ret = 0, vec;
> +	char *irq_name;
> +	void *ptr;
> +	u64 val;
>  
>  	ret = cn10k_ipsec_setup_nix_rx_hw_resources(pfvf);
>  	if (ret) {
> @@ -528,6 +587,34 @@ static int cn10k_inb_cpt_init(struct net_device *netdev)
>  		return ret;
>  	}
>  
> +	/* Work entry for refilling the NPA queue for ingress inline IPSec */
> +	INIT_WORK(&pfvf->ipsec.refill_npa_inline_ipsecq,
> +		  cn10k_ipsec_npa_refill_inb_ipsecq);
> +
> +	/* Register NPA interrupt */
> +	vec = pfvf->hw.npa_msixoff;
> +	irq_name = &pfvf->hw.irq_name[vec * NAME_SIZE];
> +	snprintf(irq_name, NAME_SIZE, "%s-npa-qint", pfvf->netdev->name);
> +
> +	ret = request_irq(pci_irq_vector(pfvf->pdev, vec),
> +			  cn10k_ipsec_npa_inb_ipsecq_intr_handler, 0,
> +			  irq_name, pfvf);
> +	if (ret) {
> +		dev_err(pfvf->dev,
> +			"RVUPF%d: IRQ registration failed for NPA QINT\n",
> +			rvu_get_pf(pfvf->pdev, pfvf->pcifunc));
> +		return ret;
> +	}
> +
> +	/* Enable NPA threshold interrupt */
> +	ptr = otx2_get_regaddr(pfvf, NPA_LF_AURA_OP_INT);

Hi Tanmay,

ptr is set but otherwise unused in this function.
Probably it should be removed.

Flagged by clang and gcc with -Wunused-but-set-variable

Also, Sparse warns that the return type of otx2_get_regaddr()
is  void __iomem *, but ptr does not have an __iomem annotation.

> +	val = BIT_ULL(43) | BIT_ULL(17);
> +	otx2_write64(pfvf, NPA_LF_AURA_OP_INT,
> +		     ((u64)pfvf->ipsec.inb_ipsec_pool << 44) | val);
> +
> +	/* Enable interrupt */
> +	otx2_write64(pfvf, NPA_LF_QINTX_ENA_W1S(0), BIT_ULL(0));
> +
>  	return ret;
>  }
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ