DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nithin Dabilpuram <ndabilpuram@marvell.com>
To: Nithin Dabilpuram <ndabilpuram@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Satha Rao <skoteshwar@marvell.com>,
	Harman Kalra <hkalra@marvell.com>
Cc: <jerinj@marvell.com>, <dev@dpdk.org>,
	Srujana Challa <schalla@marvell.com>
Subject: [PATCH v2 10/10] net/cnxk: define CPT HW result format for PMD API
Date: Tue, 28 May 2024 12:35:22 +0530	[thread overview]
Message-ID: <20240528070522.3857626-10-ndabilpuram@marvell.com> (raw)
In-Reply-To: <20240528070522.3857626-1-ndabilpuram@marvell.com>

From: Srujana Challa <schalla@marvell.com>

Defines CPT HW result format for PMD API,
rte_pmd_cnxk_inl_ipsec_res().

Signed-off-by: Srujana Challa <schalla@marvell.com>
---
 drivers/net/cnxk/cn10k_ethdev_sec.c |  4 +--
 drivers/net/cnxk/rte_pmd_cnxk.h     | 40 +++++++++++++++++++++++++++--
 2 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/drivers/net/cnxk/cn10k_ethdev_sec.c b/drivers/net/cnxk/cn10k_ethdev_sec.c
index eed4c29218..b8b0da5ea9 100644
--- a/drivers/net/cnxk/cn10k_ethdev_sec.c
+++ b/drivers/net/cnxk/cn10k_ethdev_sec.c
@@ -1251,7 +1251,7 @@ rte_pmd_cnxk_hw_sa_write(void *device, struct rte_security_session *sess,
 	return 0;
 }
 
-void *
+union rte_pmd_cnxk_cpt_res_s *
 rte_pmd_cnxk_inl_ipsec_res(struct rte_mbuf *mbuf)
 {
 	const union nix_rx_parse_u *rx;
@@ -1265,7 +1265,7 @@ rte_pmd_cnxk_inl_ipsec_res(struct rte_mbuf *mbuf)
 	rx = (const union nix_rx_parse_u *)(wqe + 8);
 	desc_size = (rx->desc_sizem1 + 1) * 16;
 
-	/* cpt_res_s sits after SG list at 16B aligned address */
+	/* rte_pmd_cnxk_cpt_res_s sits after SG list at 16B aligned address */
 	return (void *)(wqe + 64 + desc_size);
 }
 
diff --git a/drivers/net/cnxk/rte_pmd_cnxk.h b/drivers/net/cnxk/rte_pmd_cnxk.h
index 43f2a7ed9b..88030046db 100644
--- a/drivers/net/cnxk/rte_pmd_cnxk.h
+++ b/drivers/net/cnxk/rte_pmd_cnxk.h
@@ -453,6 +453,42 @@ union rte_pmd_cnxk_ipsec_hw_sa {
 	struct rte_pmd_cnxk_ipsec_outb_sa outb;
 };
 
+/** CPT HW result format */
+union rte_pmd_cnxk_cpt_res_s {
+	/** CN10K CPT result */
+	struct rte_pmd_cpt_cn10k_res_s {
+		/** Completion code */
+		uint64_t compcode : 7;
+		/** Done interrupt */
+		uint64_t doneint : 1;
+		/** Microcode completion code */
+		uint64_t uc_compcode : 8;
+		/** Result length */
+		uint64_t rlen : 16;
+		/** SPI */
+		uint64_t spi : 32;
+
+		/** Extended sequence number */
+		uint64_t esn;
+	} cn10k;
+
+	/** CN9K CPT result */
+	struct rte_pmd_cpt_cn9k_res_s {
+		/** Completion code */
+		uint64_t compcode : 8;
+		/** Microcode completion code */
+		uint64_t uc_compcode : 8;
+		/** Done interrupt */
+		uint64_t doneint : 1;
+		uint64_t reserved_17_63 : 47;
+
+		uint64_t reserved_64_127;
+	} cn9k;
+
+	/** CPT RES */
+	uint64_t u64[2];
+};
+
 /**
  * Read HW SA context from session.
  *
@@ -501,9 +537,9 @@ int rte_pmd_cnxk_hw_sa_write(void *device, struct rte_security_session *sess,
  *   Pointer to packet that was just received and was processed with Inline IPsec.
  *
  * @return
- *   - Pointer to mbuf location where CPT result info is stored on success.
+ *   - Pointer to mbuf location where `union rte_pmd_cnxk_cpt_res_s` is stored on success.
  *   - NULL on failure.
  */
 __rte_experimental
-void *rte_pmd_cnxk_inl_ipsec_res(struct rte_mbuf *mbuf);
+union rte_pmd_cnxk_cpt_res_s *rte_pmd_cnxk_inl_ipsec_res(struct rte_mbuf *mbuf);
 #endif /* _PMD_CNXK_H_ */
-- 
2.25.1


  parent reply	other threads:[~2024-05-28  7:06 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-17  7:44 [PATCH 01/10] common/cnxk: sync VF root weight with kernel Nithin Dabilpuram
2024-05-17  7:44 ` [PATCH 02/10] net/cnxk: set VF default root schedule weight Nithin Dabilpuram
2024-05-17  7:44 ` [PATCH 03/10] net/cnxk: fix extbuf handling for multisegment packet Nithin Dabilpuram
2024-05-17  7:44 ` [PATCH 04/10] common/cnxk: override UDP encap ports with session data Nithin Dabilpuram
2024-05-17  7:44 ` [PATCH 05/10] net/cnxk: update SA userdata and keep original cookie Nithin Dabilpuram
2024-05-17  7:44 ` [PATCH 06/10] net/cnxk: add option to disable custom meta aura Nithin Dabilpuram
2024-05-27 17:29   ` Jerin Jacob
2024-05-17  7:44 ` [PATCH 07/10] net/cnxk: fix issue with outbound security higher pkt burst Nithin Dabilpuram
2024-05-17  7:44 ` [PATCH 08/10] common/cnxk: add API to reset CGX stats Nithin Dabilpuram
2024-05-17  7:44 ` [PATCH 09/10] net/cnxk: clear CGX stats during xstats reset Nithin Dabilpuram
2024-05-27 17:28   ` Jerin Jacob
2024-05-17  7:44 ` [PATCH 10/10] net/cnxk: define CPT HW result format for PMD API Nithin Dabilpuram
2024-05-27 17:27   ` Jerin Jacob
2024-05-28  7:05 ` [PATCH v2 01/10] common/cnxk: sync VF root weight with kernel Nithin Dabilpuram
2024-05-28  7:05   ` [PATCH v2 02/10] net/cnxk: set VF default root schedule weight Nithin Dabilpuram
2024-05-28  7:05   ` [PATCH v2 03/10] net/cnxk: fix extbuf handling for multisegment packet Nithin Dabilpuram
2024-05-28  7:05   ` [PATCH v2 04/10] common/cnxk: override UDP encap ports with session data Nithin Dabilpuram
2024-05-28  7:05   ` [PATCH v2 05/10] net/cnxk: update SA userdata and keep original cookie Nithin Dabilpuram
2024-05-28  7:05   ` [PATCH v2 06/10] net/cnxk: add option to disable custom meta aura Nithin Dabilpuram
2024-05-28  7:05   ` [PATCH v2 07/10] net/cnxk: fix issue with outbound security higher pkt burst Nithin Dabilpuram
2024-05-28  7:05   ` [PATCH v2 08/10] common/cnxk: add API to reset CGX stats Nithin Dabilpuram
2024-05-28  7:05   ` [PATCH v2 09/10] net/cnxk: fix xstats reset Nithin Dabilpuram
2024-05-28  7:05   ` Nithin Dabilpuram [this message]
2024-05-28 16:03     ` [PATCH v2 10/10] net/cnxk: define CPT HW result format for PMD API Jerin Jacob

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=20240528070522.3857626-10-ndabilpuram@marvell.com \
    --to=ndabilpuram@marvell.com \
    --cc=dev@dpdk.org \
    --cc=hkalra@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=schalla@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@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;
as well as URLs for NNTP newsgroup(s).