Add session update support for TLS Signed-off-by: Vidya Sagar Velumuri <vvelum...@marvell.com> --- drivers/crypto/cnxk/cn10k_cryptodev_sec.c | 3 +++ drivers/crypto/cnxk/cn10k_tls.c | 17 +++++++++++++++++ drivers/crypto/cnxk/cn10k_tls.h | 4 ++++ 3 files changed, 24 insertions(+)
diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_sec.c b/drivers/crypto/cnxk/cn10k_cryptodev_sec.c index cb013986c4..775104b765 100644 --- a/drivers/crypto/cnxk/cn10k_cryptodev_sec.c +++ b/drivers/crypto/cnxk/cn10k_cryptodev_sec.c @@ -116,6 +116,9 @@ cn10k_sec_session_update(void *dev, struct rte_security_session *sec_sess, if (cn10k_sec_sess->proto == RTE_SECURITY_PROTOCOL_IPSEC) return cn10k_ipsec_session_update(vf, qp, cn10k_sec_sess, conf); + if (conf->protocol == RTE_SECURITY_PROTOCOL_TLS_RECORD) + return cn10k_tls_record_session_update(vf, qp, cn10k_sec_sess, conf); + return -ENOTSUP; } diff --git a/drivers/crypto/cnxk/cn10k_tls.c b/drivers/crypto/cnxk/cn10k_tls.c index c95fcfdfa7..11279dac46 100644 --- a/drivers/crypto/cnxk/cn10k_tls.c +++ b/drivers/crypto/cnxk/cn10k_tls.c @@ -781,6 +781,23 @@ cn10k_tls_write_sa_create(struct roc_cpt *roc_cpt, struct roc_cpt_lf *lf, return ret; } +int +cn10k_tls_record_session_update(struct cnxk_cpt_vf *vf, struct cnxk_cpt_qp *qp, + struct cn10k_sec_session *sess, + struct rte_security_session_conf *conf) +{ + struct roc_cpt *roc_cpt; + int ret; + + if (conf->tls_record.type == RTE_SECURITY_TLS_SESS_TYPE_READ) + return -ENOTSUP; + + roc_cpt = &vf->cpt; + ret = cn10k_tls_write_sa_create(roc_cpt, &qp->lf, &conf->tls_record, conf->crypto_xform, + (struct cn10k_sec_session *)sess); + return ret; +} + int cn10k_tls_record_session_create(struct cnxk_cpt_vf *vf, struct cnxk_cpt_qp *qp, struct rte_security_tls_record_xform *tls_xfrm, diff --git a/drivers/crypto/cnxk/cn10k_tls.h b/drivers/crypto/cnxk/cn10k_tls.h index 19772655da..9635bdd4c9 100644 --- a/drivers/crypto/cnxk/cn10k_tls.h +++ b/drivers/crypto/cnxk/cn10k_tls.h @@ -25,6 +25,10 @@ struct cn10k_tls_record { }; } __rte_aligned(ROC_ALIGN); +int cn10k_tls_record_session_update(struct cnxk_cpt_vf *vf, struct cnxk_cpt_qp *qp, + struct cn10k_sec_session *sess, + struct rte_security_session_conf *conf); + int cn10k_tls_record_session_create(struct cnxk_cpt_vf *vf, struct cnxk_cpt_qp *qp, struct rte_security_tls_record_xform *tls_xfrm, struct rte_crypto_sym_xform *crypto_xfrm, -- 2.25.1