* [dpdk-dev] [PATCH 1/2] crypto/dpaa2_sec: increase supported anti replay win sz
@ 2020-09-03 17:07 akhil.goyal
2020-09-03 17:07 ` [dpdk-dev] [PATCH 2/2] crypto/dpaa2_sec: change descriptor sharing for ERA10 akhil.goyal
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: akhil.goyal @ 2020-09-03 17:07 UTC (permalink / raw)
To: dev; +Cc: hemant.agrawal, Akhil Goyal, Yi Liu
From: Akhil Goyal <akhil.goyal@nxp.com>
In case of LX2160 or SEC ERA >= 10, max anti replay window
size supported is 1024. For all other versions of SEC, the
maximum value is capped at 128 even if application gives
more than that.
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Signed-off-by: Yi Liu <yi.liu@nxp.com>
---
drivers/common/dpaax/caamflib/desc/ipsec.h | 48 +++++++++++++++++++--
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 14 ++++++
2 files changed, 59 insertions(+), 3 deletions(-)
diff --git a/drivers/common/dpaax/caamflib/desc/ipsec.h b/drivers/common/dpaax/caamflib/desc/ipsec.h
index cf6fa4252..83dd93f58 100644
--- a/drivers/common/dpaax/caamflib/desc/ipsec.h
+++ b/drivers/common/dpaax/caamflib/desc/ipsec.h
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
*
* Copyright 2008-2016 Freescale Semiconductor Inc.
- * Copyright 2016,2019 NXP
+ * Copyright 2016,2019-2020 NXP
*
*/
@@ -119,8 +119,15 @@
/* IPSec ESP Decap PDB options */
+/**
+ * PDBOPTS_ESP_ARS_MASK_ERA10 - antireplay window mask
+ * for SEC_ERA >= 10
+ */
+#define PDBOPTS_ESP_ARS_MASK_ERA10 0xc8
+
/**
* PDBOPTS_ESP_ARS_MASK - antireplay window mask
+ * for SEC_ERA < 10
*/
#define PDBOPTS_ESP_ARS_MASK 0xc0
@@ -141,6 +148,27 @@
*/
#define PDBOPTS_ESP_ARS128 0x80
+/**
+ * PDBOPTS_ESP_ARS256 - 256-entry antireplay window
+ *
+ * Valid only for IPsec new mode.
+ */
+#define PDBOPTS_ESP_ARS256 0x08
+
+/**
+ * PDBOPTS_ESP_ARS512 - 512-entry antireplay window
+ *
+ * Valid only for IPsec new mode.
+ */
+#define PDBOPTS_ESP_ARS512 0x48
+
+/**
+ * PDBOPTS_ESP_ARS1024 - 1024-entry antireplay window
+ *
+ * Valid only for IPsec new mode.
+ */
+#define PDBOPTS_ESP_ARS1024 0x88
+
/**
* PDBOPTS_ESP_ARS32 - 32-entry antireplay window
*/
@@ -439,7 +467,7 @@ struct ipsec_decap_pdb {
};
uint32_t seq_num_ext_hi;
uint32_t seq_num;
- uint32_t anti_replay[4];
+ uint32_t anti_replay[32];
};
static inline unsigned int
@@ -449,6 +477,7 @@ __rta_copy_ipsec_decap_pdb(struct program *program,
{
unsigned int start_pc = program->current_pc;
unsigned int i, ars;
+ uint8_t mask;
__rta_out32(program, pdb->options);
@@ -486,7 +515,20 @@ __rta_copy_ipsec_decap_pdb(struct program *program,
__rta_out32(program, pdb->seq_num_ext_hi);
__rta_out32(program, pdb->seq_num);
- switch (pdb->options & PDBOPTS_ESP_ARS_MASK) {
+ if (rta_sec_era < RTA_SEC_ERA_10)
+ mask = PDBOPTS_ESP_ARS_MASK;
+ else
+ mask = PDBOPTS_ESP_ARS_MASK_ERA10;
+ switch (pdb->options & mask) {
+ case PDBOPTS_ESP_ARS1024:
+ ars = 32;
+ break;
+ case PDBOPTS_ESP_ARS512:
+ ars = 16;
+ break;
+ case PDBOPTS_ESP_ARS256:
+ ars = 8;
+ break;
case PDBOPTS_ESP_ARS128:
ars = 4;
break;
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 195c7d894..27c28804f 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -2996,6 +2996,10 @@ dpaa2_sec_set_ipsec_session(struct rte_cryptodev *dev,
uint32_t win_sz;
win_sz = rte_align32pow2(ipsec_xform->replay_win_sz);
+ if (rta_sec_era < RTA_SEC_ERA_10 && win_sz > 128) {
+ DPAA2_SEC_INFO("Max Anti replay Win sz = 128");
+ win_sz = 128;
+ }
switch (win_sz) {
case 1:
case 2:
@@ -3008,6 +3012,16 @@ dpaa2_sec_set_ipsec_session(struct rte_cryptodev *dev,
case 64:
decap_pdb.options |= PDBOPTS_ESP_ARS64;
break;
+ case 256:
+ decap_pdb.options |= PDBOPTS_ESP_ARS256;
+ break;
+ case 512:
+ decap_pdb.options |= PDBOPTS_ESP_ARS512;
+ break;
+ case 1024:
+ decap_pdb.options |= PDBOPTS_ESP_ARS1024;
+ break;
+ case 128:
default:
decap_pdb.options |= PDBOPTS_ESP_ARS128;
}
--
2.17.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH 2/2] crypto/dpaa2_sec: change descriptor sharing for ERA10
2020-09-03 17:07 [dpdk-dev] [PATCH 1/2] crypto/dpaa2_sec: increase supported anti replay win sz akhil.goyal
@ 2020-09-03 17:07 ` akhil.goyal
2020-09-14 14:05 ` Hemant Agrawal
2020-09-14 14:03 ` [dpdk-dev] [PATCH 1/2] crypto/dpaa2_sec: increase supported anti replay win sz Hemant Agrawal
2020-10-09 19:27 ` Akhil Goyal
2 siblings, 1 reply; 5+ messages in thread
From: akhil.goyal @ 2020-09-03 17:07 UTC (permalink / raw)
To: dev; +Cc: hemant.agrawal, Akhil Goyal
From: Akhil Goyal <akhil.goyal@nxp.com>
In case of LX2160 or SEC ERA 10, share wait has performance
optimizations wrt to ok-to-share signal which allows multiple
DECOs to work together even in case of single queue and single SA.
Hence updated the descriptor sharing only in case of ERA10.
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 27c28804f..2ed3c9bc4 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -2963,7 +2963,8 @@ dpaa2_sec_set_ipsec_session(struct rte_cryptodev *dev,
}
bufsize = cnstr_shdsc_ipsec_new_encap(priv->flc_desc[0].desc,
- 1, 0, SHR_SERIAL, &encap_pdb,
+ 1, 0, (rta_sec_era >= RTA_SEC_ERA_10) ?
+ SHR_WAIT : SHR_SERIAL, &encap_pdb,
hdr, &cipherdata, &authdata);
} else if (ipsec_xform->direction ==
RTE_SECURITY_IPSEC_SA_DIR_INGRESS) {
@@ -3028,7 +3029,8 @@ dpaa2_sec_set_ipsec_session(struct rte_cryptodev *dev,
}
session->dir = DIR_DEC;
bufsize = cnstr_shdsc_ipsec_new_decap(priv->flc_desc[0].desc,
- 1, 0, SHR_SERIAL,
+ 1, 0, (rta_sec_era >= RTA_SEC_ERA_10) ?
+ SHR_WAIT : SHR_SERIAL,
&decap_pdb, &cipherdata, &authdata);
} else
goto out;
--
2.17.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] crypto/dpaa2_sec: increase supported anti replay win sz
2020-09-03 17:07 [dpdk-dev] [PATCH 1/2] crypto/dpaa2_sec: increase supported anti replay win sz akhil.goyal
2020-09-03 17:07 ` [dpdk-dev] [PATCH 2/2] crypto/dpaa2_sec: change descriptor sharing for ERA10 akhil.goyal
@ 2020-09-14 14:03 ` Hemant Agrawal
2020-10-09 19:27 ` Akhil Goyal
2 siblings, 0 replies; 5+ messages in thread
From: Hemant Agrawal @ 2020-09-14 14:03 UTC (permalink / raw)
To: akhil.goyal, dev; +Cc: hemant.agrawal, Yi Liu
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH 2/2] crypto/dpaa2_sec: change descriptor sharing for ERA10
2020-09-03 17:07 ` [dpdk-dev] [PATCH 2/2] crypto/dpaa2_sec: change descriptor sharing for ERA10 akhil.goyal
@ 2020-09-14 14:05 ` Hemant Agrawal
0 siblings, 0 replies; 5+ messages in thread
From: Hemant Agrawal @ 2020-09-14 14:05 UTC (permalink / raw)
To: akhil.goyal, dev; +Cc: hemant.agrawal
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] crypto/dpaa2_sec: increase supported anti replay win sz
2020-09-03 17:07 [dpdk-dev] [PATCH 1/2] crypto/dpaa2_sec: increase supported anti replay win sz akhil.goyal
2020-09-03 17:07 ` [dpdk-dev] [PATCH 2/2] crypto/dpaa2_sec: change descriptor sharing for ERA10 akhil.goyal
2020-09-14 14:03 ` [dpdk-dev] [PATCH 1/2] crypto/dpaa2_sec: increase supported anti replay win sz Hemant Agrawal
@ 2020-10-09 19:27 ` Akhil Goyal
2 siblings, 0 replies; 5+ messages in thread
From: Akhil Goyal @ 2020-10-09 19:27 UTC (permalink / raw)
To: Akhil Goyal, dev; +Cc: Hemant Agrawal, Yi Liu
> From: Akhil Goyal <akhil.goyal@nxp.com>
>
> In case of LX2160 or SEC ERA >= 10, max anti replay window
> size supported is 1024. For all other versions of SEC, the
> maximum value is capped at 128 even if application gives
> more than that.
>
> Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
> Signed-off-by: Yi Liu <yi.liu@nxp.com>
> ---
Series applied to dpdk-next-crypto
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-10-09 19:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-03 17:07 [dpdk-dev] [PATCH 1/2] crypto/dpaa2_sec: increase supported anti replay win sz akhil.goyal
2020-09-03 17:07 ` [dpdk-dev] [PATCH 2/2] crypto/dpaa2_sec: change descriptor sharing for ERA10 akhil.goyal
2020-09-14 14:05 ` Hemant Agrawal
2020-09-14 14:03 ` [dpdk-dev] [PATCH 1/2] crypto/dpaa2_sec: increase supported anti replay win sz Hemant Agrawal
2020-10-09 19:27 ` Akhil Goyal
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).