add asymmetric support in crypto_octeontx2 PMD
cover add asymmetric support in crypto_octeontx2 PMD
This series adds asymmetric crypto support in 'crypto_octeontx2' PMD.
Features supported: RSA & modular exponentiation
This series has dependency on the follwing,
1. http://patches.dpdk.org/project/dpdk/list/?series=6176
2. http://patches.dpdk.org/project/dpdk/list/?series=6337
Anoob Joseph (1):
doc: add documentation for OCTEON TX2 crypto asym support
Kanaka Durga Kotamarthy (3):
crypto/octeontx2: add RSA and modexp asym capabilities crypto/octeontx2: allocate memory for asymmetric operation crypto/octeontx2: add asymmetric session operations
Sunila Sahu (2):
crypto/octeontx2: add asymmetric in enqueue/dequeue ops app/test: register octeontx2 PMD to asym testsuite
app/test/test_cryptodev_asym.c | 18 ++ doc/guides/cryptodevs/features/octeontx2.ini | 9 + doc/guides/cryptodevs/octeontx2.rst | 13 + drivers/crypto/octeontx2/otx2_cryptodev.c | 4 +- .../crypto/octeontx2/otx2_cryptodev_capabilities.c | 39 ++- drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 280 ++++++++++++++++++++- drivers/crypto/octeontx2/otx2_cryptodev_ops.h | 1 + 7 files changed, 349 insertions(+), 15 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/6 crypto/octeontx2: add RSA and modexp asym capabilities
From: Kanaka Durga Kotamarthy <[email protected]>
Adding RSA and modexp capabilities supported by octeontx2 crypto PMD
--- drivers/crypto/octeontx2/otx2_cryptodev.c | 3 +- .../crypto/octeontx2/otx2_cryptodev_capabilities.c | 39 ++++++++++++++++++++-- 2 files changed, 39 insertions(+), 3 deletions(-)
drivers/crypto/octeontx2/otx2_cryptodev.c +2 -1
@@ -102,7 +102,8 @@ otx2_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING |RTE_CRYPTODEV_FF_IN_PLACE_SGL |RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT | -RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT ; +RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT | +RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO ;return 0 ;
drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c +37 -2
@@ -6,7 +6,8 @@#include "otx2_cryptodev_capabilities.h" -static const struct rte_cryptodev_capabilities otx2_cpt_sym_capabilities[] = { +static const struct +rte_cryptodev_capabilities otx2_cpt_capabilities[] = {/* Symmetric capabilities */ {/* NULL (AUTH) */ .op =RTE_CRYPTO_OP_TYPE_SYMMETRIC ,
@@ -594,11 +595,45 @@ static const struct rte_cryptodev_capabilities otx2_cpt_sym_capabilities[] = { }, } },/* End of symmetric capabilities */ + +/* Asymmetric capabilities */ + {/* RSA */ + .op = RTE_CRYPTO_OP_TYPE_ASYMMETRIC, + {.asym = { + .xform_capa = { + .xform_type =RTE_CRYPTO_ASYM_XFORM_RSA , + .op_types = ((1 << RTE_CRYPTO_ASYM_OP_SIGN) | + (1 <<RTE_CRYPTO_ASYM_OP_VERIFY ) | + (1 <<RTE_CRYPTO_ASYM_OP_ENCRYPT ) | + (1 <<RTE_CRYPTO_ASYM_OP_DECRYPT )), + {.modlen = { + .min =17 , + .max = 1024, + .increment = 1 + }, } + } + }, } + }, + { /* MOD_EXP */ + .op =RTE_CRYPTO_OP_TYPE_ASYMMETRIC , + {.asym = { + .xform_capa = { + .xform_type =RTE_CRYPTO_ASYM_XFORM_MODEX , + .op_types = 0, + {.modlen = { + .min =17 , + .max = 1024, + .increment = 1 + }, } + } + }, } + }, +/* End of asymmetric capabilities */ RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST () };const struct rte_cryptodev_capabilities *otx2_cpt_capabilities_get (void ) { -return otx2_cpt_sym_capabilities; +return otx2_cpt_capabilities; }
Signature · 1 line
2.7.4
PATCH 2/6 crypto/octeontx2: allocate memory for asymmetric operation
In reply to Anoob JosephFrom: Kanaka Durga Kotamarthy <[email protected]>
This patch determines metabuf length needed to perform asymmetric crypto operation.
--- drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 37 +++++++++++++++++++-------- 1 file changed, 26 insertions(+), 11 deletions(-)
drivers/crypto/octeontx2/otx2_cryptodev_ops.c +26 -11
@@ -38,24 +38,39 @@ otx2_cpt_metabuf_mempool_create(const struct rte_cryptodev *dev, int nb_elements) {char mempool_name[RTE_MEMPOOL_NAMESIZE ]; -int sg_mlen, lb_mlen, max_mlen, ret;struct cpt_qp_meta_info *meta_info;struct rte_mempool *pool; +int ret, max_mlen; +int asym_mlen =0 ; +int lb_mlen =0 ; +int sg_mlen =0 ; -/* Get meta len for scatter gather mode */ - sg_mlen =cpt_pmd_ops_helper_get_mlen_sg_mode (); +if (dev->feature_flags &RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO ) { -/* Extra 32B saved for future considerations */ - sg_mlen +=4 *sizeof (uint64_t ); +/* Get meta len for scatter gather mode */ + sg_mlen =cpt_pmd_ops_helper_get_mlen_sg_mode (); -/* Get meta len for linear buffer (direct) mode */ - lb_mlen =cpt_pmd_ops_helper_get_mlen_direct_mode (); +/* Extra 32B saved for future considerations */ + sg_mlen +=4 *sizeof (uint64_t ); -/* Extra 32B saved for future considerations */ - lb_mlen +=4 *sizeof (uint64_t ); +/* Get meta len for linear buffer (direct) mode */ + lb_mlen =cpt_pmd_ops_helper_get_mlen_direct_mode (); -/* Check max requirement for meta buffer */ - max_mlen =RTE_MAX (lb_mlen, sg_mlen); +/* Extra 32B saved for future considerations */ + lb_mlen +=4 *sizeof (uint64_t ); + } + +if (dev->feature_flags &RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO ) { + +/* Get meta len required for asymmetric operations */ + asym_mlen =cpt_pmd_ops_helper_asym_get_mlen (); + } + +/* +* Check max requirement for meta buffer to +* support crypto op of any type (sym/asym). +*/ + max_mlen =RTE_MAX (RTE_MAX (lb_mlen, sg_mlen), asym_mlen);/* Allocate mempool */
Signature · 1 line
2.7.4
PATCH 3/6 crypto/octeontx2: add asymmetric session operations
In reply to Anoob JosephFrom: Kanaka Durga Kotamarthy <[email protected]>
This patch adds asymmetric session setup and free routines.
--- drivers/crypto/octeontx2/otx2_cryptodev.c | 3 +- drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 67 +++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-)
drivers/crypto/octeontx2/otx2_cryptodev.c +2 -1
@@ -103,7 +103,8 @@ otx2_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,RTE_CRYPTODEV_FF_IN_PLACE_SGL |RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT |RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT | -RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO ; +RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO | +RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT ;return 0 ;
drivers/crypto/octeontx2/otx2_cryptodev_ops.c +67 -0
83 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 4/6 crypto/octeontx2: add asymmetric in enqueue/dequeue ops
In reply to Anoob JosephFrom: Sunila Sahu <[email protected]>
This patch adds asymmetric support in enqueue/dequeue ops.
--- drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 176 +++++++++++++++++++++++++- drivers/crypto/octeontx2/otx2_cryptodev_ops.h | 1 + 2 files changed, 176 insertions(+), 1 deletion(-)
drivers/crypto/octeontx2/otx2_cryptodev_ops.c +175 -1
@@ -393,6 +393,78 @@ otx2_cpt_enqueue_req(const struct otx2_cpt_qp *qp,return 0 ; } +static __rte_always_inline int32_t __hot +otx2_cpt_enqueue_asym (struct otx2_cpt_qp *qp, +struct rte_crypto_op *op, +struct pending_queue *pend_q) +{ +struct cpt_qp_meta_info *minfo = &qp->meta_info; +struct rte_crypto_asym_op *asym_op = op->asym; +struct asym_op_params params = {0 }; +struct cpt_asym_sess_misc *sess; +vq_cmd_word3_t *w3; +uintptr_t *cop; +void *mdata; +int ret; + +if (unlikely (rte_mempool_get (minfo->pool, &mdata) <0 )) { +CPT_LOG_ERR ("Could not allocate meta buffer for request" ); +return -ENOMEM ; + } + + sess =get_asym_session_private_data (asym_op->session, + otx2_cryptodev_driver_id); + +/* Store IO address of the mdata to meta_buf */ + params.meta_buf =rte_mempool_virt2iova (mdata); + + cop = mdata; + cop[0 ] = (uintptr_t )mdata; + cop[1 ] = (uintptr_t )op; + cop[2 ] = cop[3 ] =0ULL ; + + params.req =RTE_PTR_ADD (cop,4 *sizeof (uintptr_t )); + params.req->op = cop; + +/* Adjust meta_buf to point to end of cpt_request_info structure */ + params.meta_buf += (4 *sizeof (uintptr_t )) + +sizeof (struct cpt_request_info ); +switch (sess->xfrm_type) { +case RTE_CRYPTO_ASYM_XFORM_MODEX : + ret =cpt_modex_prep (¶ms, &sess->mod_ctx); +if (unlikely (ret)) + goto req_fail; +break ; +case RTE_CRYPTO_ASYM_XFORM_RSA : + ret =cpt_enqueue_rsa_op (op, ¶ms, sess); +if (unlikely (ret)) + goto req_fail; +break ; +default : + op->status =RTE_CRYPTO_OP_STATUS_INVALID_ARGS ; + ret = -EINVAL ; + goto req_fail; + } + +/* Set engine group of AE */ + w3 = (vq_cmd_word3_t *)¶ms.req->ist.ei3; + w3->s.grp =OTX2_CPT_EGRP_AE ; + + ret =otx2_cpt_enqueue_req (qp, pend_q, params.req); + +if (unlikely (ret)) { +CPT_LOG_DP_ERR ("Could not enqueue crypto req" ); + goto req_fail; + } + +return 0 ; + +req_fail: +free_op_meta (mdata, minfo->pool); + +return ret; +} + static __rte_always_inline int __hototx2_cpt_enqueue_sym (struct otx2_cpt_qp *qp,struct rte_crypto_op *op,struct pending_queue *pend_q)
@@ -488,7 +560,9 @@ otx2_cpt_enqueue_burst(void *qptr, struct rte_crypto_op **ops, uint16_t nb_ops)for (count =0 ; count < nb_ops; count++) { op = ops[count]; -if (op->sess_type ==RTE_CRYPTO_OP_WITH_SESSION ) +if (op->type ==RTE_CRYPTO_OP_TYPE_ASYMMETRIC ) + ret =otx2_cpt_enqueue_asym (qp, op, pend_q); +else if (op->sess_type ==RTE_CRYPTO_OP_WITH_SESSION ) ret =otx2_cpt_enqueue_sym (qp, op, pend_q);else if (op->sess_type ==RTE_CRYPTO_OP_SESSIONLESS ) ret =otx2_cpt_enqueue_sym_sessless (qp, op, pend_q);
@@ -502,6 +576,92 @@ otx2_cpt_enqueue_burst(void *qptr, struct rte_crypto_op **ops, uint16_t nb_ops)return count; } +static __rte_always_inline void +otx2_cpt_asym_rsa_op (struct rte_crypto_op *cop,struct cpt_request_info *req, +struct rte_crypto_rsa_xform *rsa_ctx) +{ +struct rte_crypto_rsa_op_param *rsa = &cop->asym->rsa; + +switch (rsa->op_type) { +case RTE_CRYPTO_ASYM_OP_ENCRYPT : + rsa->cipher.length = rsa_ctx->n.length; +memcpy (rsa->cipher.data, req->rptr, rsa->cipher.length); +break ; +case RTE_CRYPTO_ASYM_OP_DECRYPT : +if (rsa->pad ==RTE_CRYPTO_RSA_PADDING_NONE ) { + rsa->message.length = rsa_ctx->n.length; +memcpy (rsa->message.data, req->rptr, + rsa->message.length); + }else { +/* Get length of decrypted output */ + rsa->message.length =rte_cpu_to_be_16 + (*((uint16_t *)req->rptr)); +/* +* Offset output data pointer by length field +* (2 bytes) and copy decrypted data. +*/ +memcpy (rsa->message.data, req->rptr +2 , + rsa->message.length); + } +break ; +case RTE_CRYPTO_ASYM_OP_SIGN : + rsa->sign.length = rsa_ctx->n.length; +memcpy (rsa->sign.data, req->rptr, rsa->sign.length); +break ; +case RTE_CRYPTO_ASYM_OP_VERIFY : +if (rsa->pad ==RTE_CRYPTO_RSA_PADDING_NONE ) { + rsa->sign.length = rsa_ctx->n.length; +memcpy (rsa->sign.data, req->rptr, rsa->sign.length); + }else { +/* Get length of signed output */ + rsa->sign.length =rte_cpu_to_be_16 + (*((uint16_t *)req->rptr)); +/* +* Offset output data pointer by length field +* (2 bytes) and copy signed data. +*/ +memcpy (rsa->sign.data, req->rptr +2 , + rsa->sign.length); + } +if (memcmp (rsa->sign.data, rsa->message.data, + rsa->message.length)) { +CPT_LOG_DP_ERR ("RSA verification failed" ); + cop->status =RTE_CRYPTO_OP_STATUS_ERROR ; + } +break ; +default : +CPT_LOG_DP_DEBUG ("Invalid RSA operation type" ); + cop->status =RTE_CRYPTO_OP_STATUS_INVALID_ARGS ; +break ; + } +} + +static void +otx2_cpt_asym_post_process (struct rte_crypto_op *cop, +struct cpt_request_info *req) +{ +struct rte_crypto_asym_op *op = cop->asym; +struct cpt_asym_sess_misc *sess; + + sess =get_asym_session_private_data (op->session, + otx2_cryptodev_driver_id); + +switch (sess->xfrm_type) { +case RTE_CRYPTO_ASYM_XFORM_RSA : +otx2_cpt_asym_rsa_op (cop, req, &sess->rsa_ctx); +break ; +case RTE_CRYPTO_ASYM_XFORM_MODEX : + op->modex.result.length = sess->mod_ctx.modulus.length; +memcpy (op->modex.result.data, req->rptr, + op->modex.result.length); +break ; +default : +CPT_LOG_DP_DEBUG ("Invalid crypto xform type" ); + cop->status =RTE_CRYPTO_OP_STATUS_INVALID_ARGS ; +break ; + } +} +static inline void otx2_cpt_dequeue_post_process (struct otx2_cpt_qp *qp,struct rte_crypto_op *cop,uintptr_t *rsp,uint8_t cc)
@@ -528,6 +688,20 @@ otx2_cpt_dequeue_post_process(struct otx2_cpt_qp *qp, struct rte_crypto_op *cop, cop->sym->session =NULL ; } } + +if (cop->type ==RTE_CRYPTO_OP_TYPE_ASYMMETRIC ) { +if (likely (cc ==NO_ERR )) { + cop->status =RTE_CRYPTO_OP_STATUS_SUCCESS ; +/* +* Pass cpt_req_info stored in metabuf during +* enqueue. +*/ + rsp =RTE_PTR_ADD (rsp,4 *sizeof (uintptr_t )); +otx2_cpt_asym_post_process (cop, + (struct cpt_request_info *)rsp); + }else + cop->status =RTE_CRYPTO_OP_STATUS_ERROR ; + } }static __rte_always_inline uint8_t
drivers/crypto/octeontx2/otx2_cryptodev_ops.h +1 -0
@@ -13,6 +13,7 @@enum otx2_cpt_egrp {OTX2_CPT_EGRP_SE =0 ,OTX2_CPT_EGRP_SE_IE =1 , +OTX2_CPT_EGRP_AE =2 };struct rte_cryptodev_ops otx2_cpt_ops;
Signature · 1 line
2.7.4
PATCH 5/6 app/test: register octeontx2 PMD to asym testsuite
In reply to Anoob JosephFrom: Sunila Sahu <[email protected]>
This patch updates asymmetric crypto unit-test application to validate asymmetric crypto operation supported by octeontx2 PMD.
--- app/test/test_cryptodev_asym.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
app/test/test_cryptodev_asym.c +18 -0
@@ -1851,6 +1851,21 @@ test_cryptodev_octeontx_asym(void)return unit_test_suite_runner (&cryptodev_octeontx_asym_testsuite); } +static int +test_cryptodev_octeontx2_asym (void ) +{ + gbl_driver_id =rte_cryptodev_driver_id_get ( +RTE_STR (CRYPTODEV_NAME_OCTEONTX2_PMD )); +if (gbl_driver_id ==-1 ) { +RTE_LOG (ERR ,USER1 ,"OCTEONTX2 PMD must be loaded. Check if " +"CONFIG_RTE_LIBRTE_PMD_OCTEONTX2_CRYPTO is " +"enabled in config file to run this " +"testsuite.\n" ); +return TEST_FAILED ; + } +return unit_test_suite_runner (&cryptodev_octeontx_asym_testsuite); +} +REGISTER_TEST_COMMAND (cryptodev_openssl_asym_autotest, test_cryptodev_openssl_asym);
@@ -1858,3 +1873,6 @@ REGISTER_TEST_COMMAND(cryptodev_qat_asym_autotest, test_cryptodev_qat_asym);REGISTER_TEST_COMMAND (cryptodev_octeontx_asym_autotest, test_cryptodev_octeontx_asym); + +REGISTER_TEST_COMMAND (cryptodev_octeontx2_asym_autotest, + test_cryptodev_octeontx2_asym);
Signature · 1 line
2.7.4
PATCH 6/6 doc: add documentation for OCTEON TX2 crypto asym support
In reply to Anoob JosephAdding documentation for asymmetric features supported by crypto_octeontx2 PMD.
--- doc/guides/cryptodevs/features/octeontx2.ini | 9 +++++++++ doc/guides/cryptodevs/octeontx2.rst | 13 +++++++++++++ 2 files changed, 22 insertions(+)
doc/guides/cryptodevs/features/octeontx2.ini +9 -0
@@ -5,11 +5,13 @@ ; [Features] Symmetric crypto = Y +Asymmetric crypto = Y Sym operation chaining = Y HW Accelerated = Y In Place SGL = Y OOP SGL In LB Out = Y OOP SGL In SGL Out = Y +RSA PRIV OP KEY QT = Y ; ; Supported crypto algorithms of 'octeontx2' crypto driver.
@@ -60,3 +62,10 @@ ZUC EIA3 = Y AES GCM (128) = Y AES GCM (192) = Y AES GCM (256) = Y + +; +; Supported Asymmetric algorithms of the 'octeontx2' crypto driver. +; +[Asymmetric] +RSA = Y +Modular Exponentiation = Y
doc/guides/cryptodevs/octeontx2.rst +13 -0
@@ -53,6 +53,11 @@ AEAD algorithms: * ``RTE_CRYPTO_AEAD_AES_GCM`` +Asymmetric algorithms: + +* ``RTE_CRYPTO_ASYM_XFORM_RSA`` +* ``RTE_CRYPTO_ASYM_XFORM_MODEX`` + Installation ------------
@@ -140,3 +145,11 @@ application: ./test RTE>>cryptodev_octeontx2_autotest + +The asymmetric crypto operations on OCTEON TX2 crypto PMD may be verified by running the test +application: + +.. code-block:: console + + ./test + RTE>>cryptodev_octeontx2_asym_autotest
Signature · 1 line
2.7.4
Quoted 45 lines
-----Original Message-----
From: Anoob Joseph <[email protected]>
Sent: Monday, September 9, 2019 8:57 PM
To: Akhil Goyal <[email protected]>; Pablo de Lara <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Anoob Joseph <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Fiona Trahe <[email protected]>; Kanaka Durga Kotamarthy <[email protected]>; Shally Verma <[email protected]>; Sunila Sahu <[email protected]>; [email protected]
Subject: [PATCH 0/6] add asymmetric support incrypto_octeontx2PMDThis series adds asymmetric crypto support in '
crypto_octeontx2' PMD.Features supported: RSA & modular exponentiation
This series has dependency on the follwing, 1.
http://patches.dpdk.org/project/dpdk/list/?series=6176
2. http://patches.dpdk.org/project/dpdk/list/?series=6337Anoob Joseph (1):
doc: add documentation for OCTEON TX2 crypto asym supportKanaka Durga Kotamarthy (3):
crypto/octeontx2: add RSA and modexp asym capabilitiescrypto/octeontx2: allocate memory for asymmetric operationcrypto/octeontx2: add asymmetric session operationsSunila Sahu (2):
crypto/octeontx2: add asymmetric in enqueue/dequeue ops app/test: register octeontx2 PMD to asym testsuiteapp/test/test_cryptodev_asym.c | 18 ++ doc/guides/cryptodevs/features/octeontx2.ini | 9 + doc/guides/cryptodevs/octeontx2.rst | 13 + drivers/crypto/octeontx2/otx2_cryptodev.c | 4 +- .../crypto/octeontx2/otx2_cryptodev_capabilities.c | 39 ++- drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 280 ++++++++++++++++++++- drivers/crypto/octeontx2/otx2_cryptodev_ops.h | 1 + 7 files changed, 349 insertions(+), 15 deletions(-)
Quoted 2 lines
--
2.7.4
Series Ack-by: Shally Verma <[email protected]>
Re: [dpdk-dev] [PATCH 6/6] doc: add documentation for OCTEON TX2 crypto asym support
In reply to Anoob JosephQuoted 17 lines
-----Original Message-----
From: Anoob Joseph <[email protected]>
Sent: Monday, September 9, 2019 8:57 PM
To: Akhil Goyal <[email protected]>; Pablo de Lara <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Anoob Joseph <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Fiona Trahe <[email protected]>; Kanaka Durga Kotamarthy <[email protected]>; Shally Verma <[email protected]>; Sunila Sahu <[email protected]>; [email protected]
Subject: [PATCH 6/6] doc: add documentation for OCTEON TX2 crypto asym supportAdding documentation for asymmetric features supported by
crypto_octeontx2PMD.
Quoted 6 lines
Signed-off-by Anoob Joseph <[email protected]>Signed-off-by Kanaka Durga Kotamarthy <[email protected]>Signed-off-by Sunila Sahu <[email protected]>--- doc/guides/cryptodevs/features/octeontx2.ini | 9 +++++++++ doc/guides/cryptodevs/octeontx2.rst | 13 +++++++++++++
Please update the release notes.
Re: [dpdk-dev] [PATCH 6/6] doc: add documentation for OCTEON TX2 crypto asym support
Hi Jerin,
Please see inline.
Thanks,
Anoob
Quoted 31 lines
-----Original Message-----
From: Jerin Jacob Kollanukkaran <[email protected]>
Sent: Tuesday, September 10, 2019 9:43 AM
To: Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Pablo de Lara <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Anoob Joseph <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Fiona Trahe <[email protected]>; Kanaka Durga Kotamarthy <[email protected]>; Shally Verma <[email protected]>; Sunila Sahu <[email protected]>; [email protected]
Subject: RE: [PATCH 6/6] doc: add documentation for OCTEON TX2 crypto asym supportQuoted 11 lines
-----Original Message-----
From: Anoob Joseph <[email protected]>
Sent: Monday, September 9, 2019 8:57 PM
To: Akhil Goyal <[email protected]>; Pablo de Lara <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Anoob Joseph <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Fiona Trahe <[email protected]>; Kanaka Durga Kotamarthy <[email protected]>; Shally Verma <[email protected]>; Sunila Sahu <[email protected]>;Quoted 6 lines
Subject: [PATCH 6/6] doc: add documentation for OCTEON TX2 crypto asym support
Adding documentation for asymmetric features supported by
crypto_octeontx2PMD.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Anoob Joseph <[email protected]>Signed-off-by Kanaka Durga Kotamarthy <[email protected]>Signed-off-by Sunila Sahu <[email protected]>--- doc/guides/cryptodevs/features/octeontx2.ini | 9 +++++++++ doc/guides/cryptodevs/octeontx2.rst | 13 +++++++++++++Please update the release notes.
[Anoob] Will update in v2.
Re: [dpdk-dev] [PATCH 6/6] doc: add documentation for OCTEON TX2 crypto asym support
In reply to Jerin Jacob Kollanukkaran10/09/2019 06:13, Jerin Jacob Kollanukkaran:
Quoted 4 lines
From: Anoob Joseph <[email protected]>
Quoted 3 lines
Adding documentation for asymmetric features supported by
crypto_octeontx2PMD.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Anoob Joseph <[email protected]>Signed-off-by Kanaka Durga Kotamarthy <[email protected]>Signed-off-by Sunila Sahu <[email protected]>--- doc/guides/cryptodevs/features/octeontx2.ini | 9 +++++++++ doc/guides/cryptodevs/octeontx2.rst | 13 +++++++++++++Please update the release notes.
Please avoid doing a separate patch for documentation. It could be updated while adding the feature, in the same patch.
Re: [dpdk-dev] [PATCH 6/6] doc: add documentation for OCTEON TX2 crypto asym support
Hi Thomas,
Please see inline.
Thanks,
Anoob
Quoted 25 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, September 10, 2019 12:00 PM
To: Jerin Jacob Kollanukkaran <[email protected]>; Anoob Joseph <[email protected]>
Cc: Akhil Goyal <[email protected]>; Pablo de Lara <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Fiona Trahe <[email protected]>; Kanaka Durga Kotamarthy <[email protected]>; Shally Verma <[email protected]>; Sunila Sahu <[email protected]>; [email protected]
Subject: Re: [PATCH 6/6] doc: add documentation for OCTEON TX2 crypto asym support10/09/2019 06:13, Jerin Jacob Kollanukkaran:
Quoted 11 lines
From: Anoob Joseph <[email protected]>
Quoted 9 lines
Adding documentation for asymmetric features supported by
crypto_octeontx2PMD.Signed-off-by Anoob Joseph <[email protected]>Signed-off-by Kanaka Durga Kotamarthy <[email protected]>Signed-off-by Sunila Sahu <[email protected]>--- doc/guides/cryptodevs/features/octeontx2.ini | 9 +++++++++ doc/guides/cryptodevs/octeontx2.rst | 13 +++++++++++++
Quoted 4 lines
Quoted 1 line
Please update the release notes.
Please avoid doing a separate patch for documentation. It could be updated while adding the feature, in the same patch.
[Anoob] To which patch should I squash this change? Here are my options,
1. The patch which adds ASYM in capabilities. Issue: the doc update updates about autotest, which won't be available until the final patch is merged.
2. Test patch which adds the autotest for the PMD. Issue: Additions to the doc would be done by a patch which adds test.
Which one should I use?
Re: [dpdk-dev] [PATCH 6/6] doc: add documentation for OCTEON TX2 crypto asym support
Hi Anoob,
Quoted 38 lines
Hi Thomas,
Please see inline.
Thanks,
AnoobQuoted 25 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, September 10, 2019 12:00 PM
To: Jerin Jacob Kollanukkaran <[email protected]>; Anoob Joseph <[email protected]>
Cc: Akhil Goyal <[email protected]>; Pablo de Lara <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Fiona Trahe <[email protected]>; Kanaka Durga Kotamarthy <[email protected]>; Shally Verma <[email protected]>; Sunila Sahu <[email protected]>; [email protected]
Subject: Re: [PATCH 6/6] doc: add documentation for OCTEON TX2 crypto asym support10/09/2019 06:13, Jerin Jacob Kollanukkaran:
Quoted 11 lines
From: Anoob Joseph <[email protected]>
Quoted 9 lines
Adding documentation for asymmetric features supported by
crypto_octeontx2PMD.Signed-off-by Anoob Joseph <[email protected]>Signed-off-by Kanaka Durga Kotamarthy <[email protected]>Signed-off-by Sunila Sahu <[email protected]>--- doc/guides/cryptodevs/features/octeontx2.ini | 9 +++++++++ doc/guides/cryptodevs/octeontx2.rst | 13 +++++++++++++Quoted 4 lines
Quoted 1 line
Please update the release notes.
Please avoid doing a separate patch for documentation. It could be updated while adding the feature, in the same patch.
Quoted 8 lines
[Anoob] To which patch should I squash this change? Here are my options,
1. The patch which adds ASYM in capabilities. Issue: the doc update updates about autotest, which won't be available until the final patch is merged.
2. Test patch which adds the autotest for the PMD. Issue: Additions to the doc would be done by a patch which adds test.Which one should I use?
As per the convention followed these days, documentation should be the part of the Patch which support it.
If you have supported many features in your patchset, you should add that piece of documentation which is supported in each of the patches in the patchset.
Release notes should be added in the patch which completes the whole feature.
-Akhil
Re: [dpdk-dev] [PATCH 6/6] doc: add documentation for OCTEON TX2 crypto asym support
In reply to Anoob Joseph10/09/2019 13:33, Anoob Joseph:
Quoted 18 lines
From: Thomas Monjalon <[email protected]>
Quoted 12 lines
10/09/2019 06:13, Jerin Jacob Kollanukkaran:
Quoted 11 lines
From: Anoob Joseph <[email protected]>
Quoted 9 lines
Adding documentation for asymmetric features supported by
crypto_octeontx2PMD.Signed-off-by Anoob Joseph <[email protected]>Signed-off-by Kanaka Durga Kotamarthy <[email protected]>Signed-off-by Sunila Sahu <[email protected]>--- doc/guides/cryptodevs/features/octeontx2.ini | 9 +++++++++ doc/guides/cryptodevs/octeontx2.rst | 13 +++++++++++++Quoted 4 lines
Quoted 1 line
Please update the release notes.
Please avoid doing a separate patch for documentation. It could be updated while adding the feature, in the same patch.
Quoted 6 lines
[Anoob] To which patch should I squash this change? Here are my options,
1. The patch which adds ASYM in capabilities. Issue: the doc update updates about autotest, which won't be available until the final patch is merged.
2. Test patch which adds the autotest for the PMD. Issue: Additions to the doc would be done by a patch which adds test.Which one should I use?
You should split the doc patch and squash in both relevant patches. This is exactly why I prefer to have doc squashed:
When I will look at the autotest patch, I will find the doc for this test. Same for the feature patch.
It is also better for git history: if you git blame on doc, you will find the commit implementing what is documented.
Thanks
Re: [dpdk-dev] [PATCH 6/6] doc: add documentation for OCTEON TX2 crypto asym support
In reply to Akhil GoyalHi Akhil,
Quoted 71 lines
-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Tuesday, September 10, 2019 5:10 PM
To: Anoob Joseph <[email protected]>; Thomas Monjalon <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>
Cc: Pablo de Lara <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Fiona Trahe <[email protected]>; Kanaka Durga Kotamarthy <[email protected]>; Shally Verma <[email protected]>; Sunila Sahu <[email protected]>; [email protected]
Subject: RE: [PATCH 6/6] doc: add documentation for OCTEON TX2 crypto asym supportHi Anoob,
Quoted 18 lines
Hi Thomas,
Please see inline.
Thanks,
AnoobQuoted 10 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, September 10, 2019 12:00 PM
To: Jerin Jacob Kollanukkaran <[email protected]>; Anoob Joseph <[email protected]>
Cc: Akhil Goyal <[email protected]>; Pablo de Lara <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Fiona Trahe <[email protected]>; Kanaka Durga Kotamarthy <[email protected]>; Shally Verma <[email protected]>; Sunila Sahu <[email protected]>;Quoted 10 lines
Quoted 10 lines
Subject: Re: [PATCH 6/6] doc: add documentation for OCTEON TX2 crypto asym support
10/09/2019 06:13, Jerin Jacob Kollanukkaran:
Quoted 6 lines
From: Anoob Joseph <[email protected]>
Quoted 5 lines
Adding documentation for asymmetric features supported by
crypto_octeontx2PMD.Signed-off-by Anoob Joseph <[email protected]>Signed-off-by Kanaka Durga KotamarthyQuoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
Signed-off-by Sunila Sahu <[email protected]>--- doc/guides/cryptodevs/features/octeontx2.ini | 9 +++++++++ doc/guides/cryptodevs/octeontx2.rst | 13 +++++++++++++Please update the release notes.
Quoted 8 lines
Quoted 2 lines
Please avoid doing a separate patch for documentation. It could be updated while adding the feature, in the same patch.
[Anoob] To which patch should I squash this change? Here are my options,
1. The patch which adds ASYM in capabilities. Issue: the doc update updates about autotest, which won't be available until the final patch is
merged.
Quoted 4 lines
2. Test patch which adds the autotest for the PMD. Issue: Additions to the doc would be done by a patch which adds test.
Which one should I use?
As per the convention followed these days, documentation should be the part of the Patch which support it.
If you have supported many features in your patchset, you should add that piece of documentation which is supported in each of the patches in the patchset.
Quoted 4 lines
Release notes should be added in the patch which completes the whole feature.
-Akhil
Will do so when sending v2.
Thanks,
Anoob
Re: [dpdk-dev] [PATCH 4/6] crypto/octeontx2: add asymmetric in enqueue/dequeue ops
In reply to Anoob JosephHi Anoob,
Quoted 14 lines
static
__rte_always_inlineint__hototx2_cpt_enqueue_sym(structotx2_cpt_qp*qp, structrte_crypto_op*op,drivers/crypto/octeontx2/otx2_cryptodev_ops.c +3
-1struct pending_queue *pend_q)@@ -488,7 +560,9 @@ otx2_cpt_enqueue_burst(void *qptr, struct rte_crypto_op **ops, uint16_t nb_ops) for (count = 0; count < nb_ops; count++) { op = ops[count]; -if (op->sess_type ==RTE_CRYPTO_OP_WITH_SESSION ) +if (op->type ==RTE_CRYPTO_OP_TYPE_ASYMMETRIC ) + ret =otx2_cpt_enqueue_asym (qp, op, pend_q); +else if (op->sess_type ==RTE_CRYPTO_OP_WITH_SESSION ) ret =otx2_cpt_enqueue_sym (qp, op, pend_q);else if (op->sess_type ==RTE_CRYPTO_OP_SESSIONLESS )
Quoted 1 line
ret =
otx2_cpt_enqueue_sym_sessless(qp, op, pend_q);
Do you support session less in asym case? If not, can we add a check here.
Re: [dpdk-dev] [PATCH 5/6] app/test: register octeontx2 PMD to asym testsuite
In reply to Anoob JosephQuoted 42 lines
From: Sunila Sahu <[email protected]>
This patch updates asymmetric crypto unit-test application to validate asymmetric crypto operation supported by octeontx2 PMD.
Signed-off-by Anoob Joseph <[email protected]>Signed-off-by Kanaka Durga Kotamarthy <[email protected]>Signed-off-by Sunila Sahu <[email protected]>--- app/test/test_cryptodev_asym.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)app/test/test_cryptodev_asym.c +7
-0@@ -1851,6 +1851,21 @@ test_cryptodev_octeontx_asym(void)return unit_test_suite_runner (&cryptodev_octeontx_asym_testsuite); } +static int +test_cryptodev_octeontx2_asym (void ) +{ + gbl_driver_id =rte_cryptodev_driver_id_get ( +RTE_STR (CRYPTODEV_NAME_OCTEONTX2_PMD )); +if (gbl_driver_id ==-1 ) { + RTE_LOG(ERR, USER1, "OCTEONTX2 PMD must be loaded.Check if "
+
"CONFIG_RTE_LIBRTE_PMD_OCTEONTX2_CRYPTOis "app/test/test_cryptodev_asym.c +7
-0+"enabled in config file to run this " + "testsuite.\n"); +return TEST_FAILED ; + } +return unit_test_suite_runner (&cryptodev_octeontx_asym_testsuite); +} +REGISTER_TEST_COMMAND (cryptodev_openssl_asym_autotest, test_cryptodev_openssl_asym);
app/test/test_cryptodev_asym.c REGISTER_TEST_COMMAND(cryptodev_qat_asym_autotest, test_cryptodev_qat_asym); · line 1875
Quoted 5 lines
app/test/test_cryptodev_asym.c +0
-0@@ -1858,3 +1873,6 @@REGISTER_TEST_COMMAND (cryptodev_qat_asym_autotest, test_cryptodev_qat_asym);REGISTER_TEST_COMMAND (cryptodev_octeontx_asym_autotest, test_cryptodev_octeontx_asym);
It looks a typo but it is intentional. Better to add a comment here and in the description That you are reusing the octeontx test suite.
Quoted 5 lines
app/test/test_cryptodev_asym.c +3
-1+ +REGISTER_TEST_COMMAND (cryptodev_octeontx2_asym_autotest, + test_cryptodev_octeontx2_asym); --2.7.4
Re: [dpdk-dev] [PATCH 5/6] app/test: register octeontx2 PMD to asym testsuite
Hi Akhil,
Please see inline.
Thanks,
Anoob
Quoted 58 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Akhil Goyal
Sent: Tuesday, October 1, 2019 7:44 PM
To: Anoob Joseph <[email protected]>; Pablo de Lara <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Sunila Sahu <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Fiona Trahe <[email protected]>; Kanaka Durga Kotamarthy <[email protected]>; Shally Verma <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH 5/6] app/test: register octeontx2 PMD to asym testsuiteQuoted 45 lines
From: Sunila Sahu <[email protected]>
This patch updates asymmetric crypto unit-test application to validate asymmetric crypto operation supported by octeontx2 PMD.
Signed-off-by Anoob Joseph <[email protected]>Signed-off-by Kanaka Durga Kotamarthy <[email protected]>Signed-off-by Sunila Sahu <[email protected]>--- app/test/test_cryptodev_asym.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)(quoted diff) +0
-0
b/app/test/test_cryptodev_asym.cindex 241c384..edbd34e 100644app/test/test_cryptodev_asym.c +7
-0@@ -1851,6 +1851,21 @@ test_cryptodev_octeontx_asym(void)return unit_test_suite_runner (&cryptodev_octeontx_asym_testsuite); } +static int +test_cryptodev_octeontx2_asym (void ) +{ + gbl_driver_id =rte_cryptodev_driver_id_get ( +RTE_STR (CRYPTODEV_NAME_OCTEONTX2_PMD )); +if (gbl_driver_id ==-1 ) { + RTE_LOG(ERR, USER1, "OCTEONTX2 PMD must be loaded.Check if "
+
"CONFIG_RTE_LIBRTE_PMD_OCTEONTX2_CRYPTOis "app/test/test_cryptodev_asym.c +7
-0+"enabled in config file to run this " + "testsuite.\n"); +return TEST_FAILED ; + } +return unit_test_suite_runner (&cryptodev_octeontx_asym_testsuite); +} +REGISTER_TEST_COMMAND (cryptodev_openssl_asym_autotest, test_cryptodev_openssl_asym);@@ -1858,3 +1873,6 @@REGISTER_TEST_COMMAND (cryptodev_qat_asym_autotest, test_cryptodev_qat_asym);
Quoted 5 lines
Quoted 2 lines
REGISTER_TEST_COMMAND(cryptodev_octeontx_asym_autotest,
test_cryptodev_octeontx_asym);It looks a typo but it is intentional. Better to add a comment here and in the description That you are reusing the octeontx test suite.
[Anoob] Will make this change in v2.
Quoted 6 lines
Quoted 6 lines
app/test/test_cryptodev_asym.c +3
-1+ +REGISTER_TEST_COMMAND (cryptodev_octeontx2_asym_autotest, + test_cryptodev_octeontx2_asym); --2.7.4
Re: [dpdk-dev] [PATCH 4/6] crypto/octeontx2: add asymmetric in enqueue/dequeue ops
In reply to Akhil GoyalHi Akhil,
PMD doesn't support sessionless with ASYM yet. Will make the suggested change in v2.
Thanks,
Anoob
Quoted 34 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Akhil Goyal
Sent: Tuesday, October 1, 2019 7:42 PM
To: Anoob Joseph <[email protected]>; Pablo de Lara <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Sunila Sahu <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Fiona Trahe <[email protected]>; Kanaka Durga Kotamarthy <[email protected]>; Shally Verma <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH 4/6]crypto/octeontx2: add asymmetric in enqueue/dequeue opsHi Anoob,
Quoted 14 lines
static
__rte_always_inlineint__hototx2_cpt_enqueue_sym(structotx2_cpt_qp*qp, structrte_crypto_op*op,drivers/crypto/octeontx2/otx2_cryptodev_ops.c +3
-1struct pending_queue *pend_q)@@ -488,7 +560,9 @@ otx2_cpt_enqueue_burst(void *qptr, struct rte_crypto_op **ops, uint16_t nb_ops) for (count = 0; count < nb_ops; count++) { op = ops[count]; -if (op->sess_type ==RTE_CRYPTO_OP_WITH_SESSION ) +if (op->type ==RTE_CRYPTO_OP_TYPE_ASYMMETRIC ) + ret =otx2_cpt_enqueue_asym (qp, op, pend_q); +else if (op->sess_type ==RTE_CRYPTO_OP_WITH_SESSION ) ret =otx2_cpt_enqueue_sym (qp, op, pend_q);else if (op->sess_type ==RTE_CRYPTO_OP_SESSIONLESS )Quoted 1 line
ret =
otx2_cpt_enqueue_sym_sessless(qp, op, pend_q);Do you support session less in asym case? If not, can we add a check here.