From: Tanmay Jagdale <tanmay@marvell.com>
To: Simon Horman <horms@kernel.org>
Cc: <davem@davemloft.net>, <leon@kernel.org>, <sgoutham@marvell.com>,
<bbhushan2@marvell.com>, <herbert@gondor.apana.org.au>,
<linux-crypto@vger.kernel.org>, <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next v2 10/14] octeontx2-pf: ipsec: Handle NPA threshold interrupt
Date: Thu, 10 Jul 2025 14:12:38 +0530 [thread overview]
Message-ID: <aG98_m30GHBGtLIt@optiplex> (raw)
In-Reply-To: <20250620110038.GJ194429@horms.kernel.org>
Hi Simon,
On 2025-06-20 at 16:30:38, Simon Horman (horms@kernel.org) wrote:
> 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@marvell.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,
Hi Simon,
>
> ptr is set but otherwise unused in this function.
> Probably it should be removed.
ACK. ptr is unused and I have removed it for the next version.
>
> 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.
>
With Regards,
Tanmay
> > + 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;
> > }
> >
next prev parent reply other threads:[~2025-07-10 8:43 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-18 11:29 [PATCH net-next v2 00/14] Enable Inbound IPsec offload on Marvell CN10K SoC Tanmay Jagdale
2025-06-18 11:29 ` [PATCH net-next v2 01/14] crypto: octeontx2: Share engine group info with AF driver Tanmay Jagdale
2025-06-18 11:29 ` [PATCH net-next v2 02/14] octeontx2-af: Configure crypto hardware for inline ipsec Tanmay Jagdale
2025-06-18 11:29 ` [PATCH net-next v2 03/14] octeontx2-af: Setup Large Memory Transaction for crypto Tanmay Jagdale
2025-06-18 11:29 ` [PATCH net-next v2 04/14] octeontx2-af: Handle inbound inline ipsec config in AF Tanmay Jagdale
2025-06-18 11:29 ` [PATCH net-next v2 05/14] octeontx2-af: Add support for CPT second pass Tanmay Jagdale
2025-06-20 10:55 ` Simon Horman
2025-06-23 6:48 ` Tanmay Jagdale
2025-06-18 11:30 ` [PATCH net-next v2 06/14] octeontx2-af: Add support for SPI to SA index translation Tanmay Jagdale
2025-06-19 14:37 ` kernel test robot
2025-06-18 11:30 ` [PATCH net-next v2 07/14] octeontx2-af: Add mbox to alloc/free BPIDs Tanmay Jagdale
2025-06-18 11:30 ` [PATCH net-next v2 08/14] octeontx2-pf: ipsec: Allocate Ingress SA table Tanmay Jagdale
2025-06-18 11:30 ` [PATCH net-next v2 09/14] octeontx2-pf: ipsec: Setup NIX HW resources for inbound flows Tanmay Jagdale
2025-06-18 11:30 ` [PATCH net-next v2 10/14] octeontx2-pf: ipsec: Handle NPA threshold interrupt Tanmay Jagdale
2025-06-20 11:00 ` Simon Horman
2025-07-10 8:42 ` Tanmay Jagdale [this message]
2025-06-18 11:30 ` [PATCH net-next v2 11/14] octeontx2-pf: ipsec: Initialize ingress IPsec Tanmay Jagdale
2025-06-18 11:30 ` [PATCH net-next v2 12/14] octeontx2-pf: ipsec: Process CPT metapackets Tanmay Jagdale
2025-06-20 11:06 ` Simon Horman
2025-07-10 8:44 ` Tanmay Jagdale
2025-06-18 11:30 ` [PATCH net-next v2 13/14] octeontx2-pf: ipsec: Manage NPC rules and SPI-to-SA table entries Tanmay Jagdale
2025-06-19 23:19 ` kernel test robot
2025-06-18 11:30 ` [PATCH net-next v2 14/14] octeontx2-pf: ipsec: Add XFRM state and policy hooks for inbound flows Tanmay Jagdale
2025-06-20 11:22 ` Simon Horman
2025-07-10 8:40 ` Tanmay Jagdale
2025-06-25 14:38 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aG98_m30GHBGtLIt@optiplex \
--to=tanmay@marvell.com \
--cc=bbhushan2@marvell.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=horms@kernel.org \
--cc=leon@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sgoutham@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox