DPDK patches and discussions
 help / color / mirror / Atom feed
From: Akhil Goyal <gakhil@marvell.com>
To: <dev@dpdk.org>
Cc: <anoobj@marvell.com>, <thomas@monjalon.net>,
	<ferruh.yigit@intel.com>, <andrew.rybchenko@oktetlabs.ru>,
	<jerinj@marvell.com>, <ndabilpuram@marvell.com>,
	<vvelumuri@marvell.com>
Subject: [PATCH v3 1/2] common/cnxk: configure reassembly specific params
Date: Wed, 23 Feb 2022 17:58:33 +0530	[thread overview]
Message-ID: <20220223122834.2571860-2-gakhil@marvell.com> (raw)
In-Reply-To: <20220223122834.2571860-1-gakhil@marvell.com>

From: Vidya Sagar Velumuri <vvelumuri@marvell.com>

When reassembly is enabled by application, set corresponding
flags in SA during creation.

Provide roc API to configure reassembly unit with active and zombie limits
and step size

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
---
 drivers/common/cnxk/cnxk_security.c | 10 ++++++++++
 drivers/common/cnxk/roc_nix_inl.c   | 23 +++++++++++++++++++++++
 drivers/common/cnxk/roc_nix_inl.h   |  7 +++++++
 drivers/common/cnxk/version.map     |  1 +
 4 files changed, 41 insertions(+)

diff --git a/drivers/common/cnxk/cnxk_security.c b/drivers/common/cnxk/cnxk_security.c
index d6006d3176..ec808c0033 100644
--- a/drivers/common/cnxk/cnxk_security.c
+++ b/drivers/common/cnxk/cnxk_security.c
@@ -339,6 +339,16 @@ cnxk_ot_ipsec_inb_sa_fill(struct roc_ot_ipsec_inb_sa *sa,
 	if (rc)
 		return rc;
 
+	/* Default options for pkt_out and pkt_fmt are with
+	 * second pass meta and no defrag.
+	 */
+	sa->w0.s.pkt_format = ROC_IE_OT_SA_PKT_FMT_META;
+	sa->w0.s.pkt_output = ROC_IE_OT_SA_PKT_OUTPUT_NO_FRAG;
+	sa->w0.s.pkind = ROC_IE_OT_CPT_PKIND;
+
+	if (ipsec_xfrm->options.ip_reassembly_en)
+		sa->w0.s.pkt_output = ROC_IE_OT_SA_PKT_OUTPUT_HW_BASED_DEFRAG;
+
 	/* ESN */
 	sa->w2.s.esn_en = !!ipsec_xfrm->options.esn;
 	if (ipsec_xfrm->options.udp_encap) {
diff --git a/drivers/common/cnxk/roc_nix_inl.c b/drivers/common/cnxk/roc_nix_inl.c
index 7bf89a44c1..9db97b65df 100644
--- a/drivers/common/cnxk/roc_nix_inl.c
+++ b/drivers/common/cnxk/roc_nix_inl.c
@@ -231,6 +231,29 @@ roc_nix_inl_inb_sa_get(struct roc_nix *roc_nix, bool inb_inl_dev, uint32_t spi)
 	return (sa_base + ((spi & mask) * sz));
 }
 
+int
+roc_nix_reassembly_configure(uint32_t max_wait_time, uint16_t max_frags)
+{
+	struct idev_cfg *idev = idev_get_cfg();
+	struct roc_cpt *roc_cpt;
+	struct roc_cpt_rxc_time_cfg cfg;
+
+	(void)max_frags;
+	roc_cpt = idev->cpt;
+	if (!roc_cpt) {
+		plt_err("Cannot support inline inbound, cryptodev not probed");
+		return -ENOTSUP;
+	}
+
+	cfg.step = (max_wait_time * 1000 / ROC_NIX_INL_REAS_ACTIVE_LIMIT);
+	cfg.zombie_limit = ROC_NIX_INL_REAS_ZOMBIE_LIMIT;
+	cfg.zombie_thres = ROC_NIX_INL_REAS_ZOMBIE_THRESHOLD;
+	cfg.active_limit = ROC_NIX_INL_REAS_ACTIVE_LIMIT;
+	cfg.active_thres = ROC_NIX_INL_REAS_ACTIVE_THRESHOLD;
+
+	return roc_cpt_rxc_time_cfg(roc_cpt, &cfg);
+}
+
 int
 roc_nix_inl_inb_init(struct roc_nix *roc_nix)
 {
diff --git a/drivers/common/cnxk/roc_nix_inl.h b/drivers/common/cnxk/roc_nix_inl.h
index 5eb1a81471..45d349acf4 100644
--- a/drivers/common/cnxk/roc_nix_inl.h
+++ b/drivers/common/cnxk/roc_nix_inl.h
@@ -43,6 +43,11 @@
 /* Alignment of SA Base */
 #define ROC_NIX_INL_SA_BASE_ALIGN BIT_ULL(16)
 
+#define ROC_NIX_INL_REAS_ACTIVE_LIMIT	  0xFFF
+#define ROC_NIX_INL_REAS_ACTIVE_THRESHOLD 10
+#define ROC_NIX_INL_REAS_ZOMBIE_LIMIT	  0xFFF
+#define ROC_NIX_INL_REAS_ZOMBIE_THRESHOLD 10
+
 static inline struct roc_onf_ipsec_inb_sa *
 roc_nix_inl_onf_ipsec_inb_sa(uintptr_t base, uint64_t idx)
 {
@@ -152,6 +157,8 @@ struct roc_nix_rq *__roc_api roc_nix_inl_dev_rq(void);
 int __roc_api roc_nix_inl_inb_tag_update(struct roc_nix *roc_nix,
 					 uint32_t tag_const, uint8_t tt);
 uint64_t __roc_api roc_nix_inl_dev_rq_limit_get(void);
+int __roc_api roc_nix_reassembly_configure(uint32_t max_wait_time,
+					uint16_t max_frags);
 
 /* NIX Inline Outbound API */
 int __roc_api roc_nix_inl_outb_init(struct roc_nix *roc_nix);
diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map
index dbede4aeed..2e8da4c2a7 100644
--- a/drivers/common/cnxk/version.map
+++ b/drivers/common/cnxk/version.map
@@ -206,6 +206,7 @@ INTERNAL {
 	roc_nix_ptp_tx_ena_dis;
 	roc_nix_queues_ctx_dump;
 	roc_nix_ras_intr_ena_dis;
+	roc_nix_reassembly_configure;
 	roc_nix_register_cq_irqs;
 	roc_nix_register_queue_irqs;
 	roc_nix_rq_dump;
-- 
2.25.1


  reply	other threads:[~2022-02-23 12:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-03 16:01 [PATCH 0/5] net/cnxk: support IP reassembly offload Akhil Goyal
2022-01-03 16:01 ` [PATCH 1/5] common/cnxk: configure reassembly specific params Akhil Goyal
2022-01-03 16:01 ` [PATCH 2/5] net/cnxk: reassembly support Akhil Goyal
2022-01-03 16:01 ` [PATCH 3/5] net/cnxk: support IP reassembly mbuf dynfield Akhil Goyal
2022-01-03 16:01 ` [PATCH 4/5] net/cnxk: add dev args for min-max spi Akhil Goyal
2022-01-03 16:01 ` [PATCH 5/5] net/cnxk: add option to override outbound inline sa iv Akhil Goyal
2022-01-20 16:53 ` [PATCH v2 0/4] net/cnxk: support IP reassembly offload Akhil Goyal
2022-01-20 16:53   ` [PATCH v2 1/4] common/cnxk: configure reassembly specific params Akhil Goyal
2022-01-20 16:53   ` [PATCH v2 2/4] net/cnxk: support IP reassembly Akhil Goyal
2022-01-20 16:53   ` [PATCH v2 3/4] net/cnxk: add dev args for min-max spi Akhil Goyal
2022-01-20 16:53   ` [PATCH v2 4/4] net/cnxk: add option to override outbound inline sa iv Akhil Goyal
2022-02-23 12:28   ` [PATCH v3 0/2] net/cnxk: support IP reassembly offload Akhil Goyal
2022-02-23 12:28     ` Akhil Goyal [this message]
2022-02-23 16:51       ` [PATCH v3 1/2] common/cnxk: configure reassembly specific params Jerin Jacob
2022-02-23 12:28     ` [PATCH v3 2/2] net/cnxk: support IP reassembly Akhil Goyal
2022-02-23 16:57       ` Jerin Jacob
2022-02-24 17:28     ` [PATCH v4 0/2] net/cnxk: support IP reassembly offload Akhil Goyal
2022-02-24 17:28       ` [PATCH v4 1/2] common/cnxk: configure reassembly specific params Akhil Goyal
2022-02-24 17:28       ` [PATCH v4 2/2] net/cnxk: support IP reassembly Akhil Goyal
2022-02-24 17:41         ` Jerin Jacob
2022-02-24 18:28       ` [PATCH v5 0/2] net/cnxk: support IP reassembly offload Akhil Goyal
2022-02-24 18:29         ` [PATCH v5 1/2] common/cnxk: configure reassembly specific params Akhil Goyal
2022-02-24 18:29         ` [PATCH v5 2/2] net/cnxk: support IP reassembly Akhil Goyal
2022-02-24 20:40         ` [PATCH v5 0/2] net/cnxk: support IP reassembly offload 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=20220223122834.2571860-2-gakhil@marvell.com \
    --to=gakhil@marvell.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jerinj@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=thomas@monjalon.net \
    --cc=vvelumuri@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).