From: Tanmay Jagdale <tanmay@marvell.com>
To: Simon Horman <horms@kernel.org>
Cc: <davem@davemloft.net>, <leon@kernel.org>,
<herbert@gondor.apana.org.au>, <sgoutham@marvell.com>,
<bbhushan2@marvell.com>, <linux-crypto@vger.kernel.org>,
<netdev@vger.kernel.org>
Subject: Re: [PATCH net-next v3 12/14] octeontx2-pf: ipsec: Process CPT metapackets
Date: Thu, 17 Jul 2025 20:38:39 +0530 [thread overview]
Message-ID: <aHkR9xKzLmlT7RGF@optiplex> (raw)
In-Reply-To: <20250712133950.GB721198@horms.kernel.org>
Hi Simon,
On 2025-07-12 at 19:09:50, Simon Horman (horms@kernel.org) wrote:
> On Fri, Jul 11, 2025 at 05:43:05PM +0530, Tanmay Jagdale wrote:
> > CPT hardware forwards decrypted IPsec packets to NIX via the X2P bus
> > as metapackets which are of 256 bytes in length. Each metapacket
> > contains CPT_PARSE_HDR_S and initial bytes of the decrypted packet
> > that helps NIX RX in classifying and submitting to CPU. Additionally,
> > CPT also sets BIT(11) of the channel number to indicate that it's a
> > 2nd pass packet from CPT.
> >
> > Since the metapackets are not complete packets, they don't have to go
> > through L3/L4 layer length and checksum verification so these are
> > disabled via the NIX_LF_INLINE_RQ_CFG mailbox during IPsec initialization.
> >
> > The CPT_PARSE_HDR_S contains a WQE pointer to the complete decrypted
> > packet. Add code in the rx NAPI handler to parse the header and extract
> > WQE pointer. Later, use this WQE pointer to construct the skb, set the
> > XFRM packet mode flags to indicate successful decryption before submitting
> > it to the network stack.
> >
> > Signed-off-by: Tanmay Jagdale <tanmay@marvell.com>
> > ---
> > Changes in V3:
> > - Updated cpt_parse_hdr_s structure to use __be64 type
>
> ...
>
> > diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.h b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.h
>
> ...
>
> > @@ -302,6 +303,41 @@ struct cpt_sg_s {
> > u64 rsvd_63_50 : 14;
> > };
> >
> > +/* CPT Parse Header Structure for Inbound packets */
> > +struct cpt_parse_hdr_s {
> > + /* Word 0 */
> > + __be64 pkt_out : 2;
> > + __be64 num_frags : 3;
> > + __be64 pad_len : 3;
> > + __be64 pkt_fmt : 1;
> > + __be64 et_owr : 1;
> > + __be64 reserved_53 : 1;
> > + __be64 reas_sts : 4;
> > + __be64 err_sum : 1;
> > + __be64 match_id : 16;
> > + __be64 cookie : 32;
> > +
> > + /* Word 1 */
> > + __be64 wqe_ptr;
> > +
> > + /* Word 2 */
> > + __be64 fi_offset : 5;
> > + __be64 fi_pad : 3;
> > + __be64 il3_off : 8;
> > + __be64 pf_func : 16;
> > + __be64 res_32_16 : 16;
> > + __be64 frag_age : 16;
> > +
> > + /* Word 3 */
> > + __be64 spi : 32;
> > + __be64 res3_32_16 : 16;
> > + __be64 uc_ccode : 8;
> > + __be64 hw_ccode : 8;
>
> Sparse complains about this and I'm not at all sure
> how __be64 bitfields function on little endian systems.
>
> I'd suggest using u64 members (not bitfields) and a combination of
> FIELD_GET/FIELD_PREP, BITULL/GENMASK_ULL, and cpu_from_be64/be64_from_cpu.
Okay sure. I will switch to FIELD_GET/PREP mechanism in the next version.
With Regards,
Tanmay
>
> > +
> > + /* Word 4 */
> > + __be64 misc;
> > +};
> > +
>
> ...
>
> --
> pw-bot: changes-requested
next prev parent reply other threads:[~2025-07-17 15:08 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-11 12:12 [PATCH net-next v3 00/14] Enable Inbound IPsec offload on Marvell CN10K SoC Tanmay Jagdale
2025-07-11 12:12 ` [PATCH net-next v3 01/14] crypto: octeontx2: Share engine group info with AF driver Tanmay Jagdale
2025-07-11 12:12 ` [PATCH net-next v3 02/14] octeontx2-af: Configure crypto hardware for inline ipsec Tanmay Jagdale
2025-07-11 12:12 ` [PATCH net-next v3 03/14] octeontx2-af: Setup Large Memory Transaction for crypto Tanmay Jagdale
2025-07-11 12:12 ` [PATCH net-next v3 04/14] octeontx2-af: Handle inbound inline ipsec config in AF Tanmay Jagdale
2025-07-11 12:12 ` [PATCH net-next v3 05/14] octeontx2-af: Add support for CPT second pass Tanmay Jagdale
2025-07-11 12:12 ` [PATCH net-next v3 06/14] octeontx2-af: Add support for SPI to SA index translation Tanmay Jagdale
2025-07-16 22:11 ` kernel test robot
2025-07-11 12:13 ` [PATCH net-next v3 07/14] octeontx2-af: Add mbox to alloc/free BPIDs Tanmay Jagdale
2025-07-11 12:13 ` [PATCH net-next v3 08/14] octeontx2-pf: ipsec: Allocate Ingress SA table Tanmay Jagdale
2025-07-11 12:13 ` [PATCH net-next v3 09/14] octeontx2-pf: ipsec: Setup NIX HW resources for inbound flows Tanmay Jagdale
2025-07-11 12:13 ` [PATCH net-next v3 10/14] octeontx2-pf: ipsec: Handle NPA threshold interrupt Tanmay Jagdale
2025-07-11 12:13 ` [PATCH net-next v3 11/14] octeontx2-pf: ipsec: Initialize ingress IPsec Tanmay Jagdale
2025-07-11 12:13 ` [PATCH net-next v3 12/14] octeontx2-pf: ipsec: Process CPT metapackets Tanmay Jagdale
2025-07-12 13:39 ` Simon Horman
2025-07-17 15:08 ` Tanmay Jagdale [this message]
2025-07-11 12:13 ` [PATCH net-next v3 13/14] octeontx2-pf: ipsec: Manage NPC rules and SPI-to-SA table entries Tanmay Jagdale
2025-07-11 12:13 ` [PATCH net-next v3 14/14] octeontx2-pf: ipsec: Add XFRM state and policy hooks for inbound flows Tanmay Jagdale
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=aHkR9xKzLmlT7RGF@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