From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9698641D5B; Fri, 24 Feb 2023 06:49:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E98A742B8B; Fri, 24 Feb 2023 06:48:34 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 4C96442C76 for ; Fri, 24 Feb 2023 06:48:33 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31O3OslI010844 for ; Thu, 23 Feb 2023 21:48:32 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=KSc7HV8qJW44s9pLOSpQGTVuFJm1LgkBU/0hfWuLS2s=; b=Vi91AuyCoH4wR3NTQnJmcOTncq+/XM4rdfmcTFqpBNMNanRiy7MytHWDDRT0D+e1VxP6 UWfBZOG89QIT7a34dTD1qz6q+9rg3Qp4atLe8cAqi8g2n9ot9iL+vtNIvaXXQHz7CznR p8C+/5MQXK8vqRkguesWp7xj25I3+0BAX7pHXXlGlvva11eEGJBT6e5SnnsJY5B3+bkC gwCHVaGasEPKx1hQKQyxxrFXCYj9ubbYDeE99Xcld60qBSZNzUJa2m7e2r7ldKfUhNEO auwD54W9SF7jtxNvDVPE91eZgId8HF36YL0TpzJGVqJoAJYmNDd0dss+vIcOoylF1feY ew== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3nxfkwa3c1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 23 Feb 2023 21:48:32 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 23 Feb 2023 21:48:30 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Thu, 23 Feb 2023 21:48:30 -0800 Received: from hyd1554.marvell.com (unknown [10.29.57.11]) by maili.marvell.com (Postfix) with ESMTP id DED883F706F; Thu, 23 Feb 2023 21:48:28 -0800 (PST) From: Tejasree Kondoj To: Akhil Goyal CC: Anoob Joseph , Gowrishankar Muthukrishnan , Subject: [PATCH 07/11] common/cnxk: add errata function for CPT set ctx Date: Fri, 24 Feb 2023 11:18:09 +0530 Message-ID: <20230224054813.2855914-8-ktejasree@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230224054813.2855914-1-ktejasree@marvell.com> References: <20230224054813.2855914-1-ktejasree@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: yNvloIm9z9WxDomqd_QaVx-msliodfRz X-Proofpoint-ORIG-GUID: yNvloIm9z9WxDomqd_QaVx-msliodfRz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-24_02,2023-02-23_01,2023-02-09_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Adding function in errata header file for CPT ctx_val and replace CPT revision_id checks with function call. Signed-off-by: Tejasree Kondoj --- drivers/common/cnxk/roc_errata.h | 9 +++++++++ drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 13 ++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/common/cnxk/roc_errata.h b/drivers/common/cnxk/roc_errata.h index 36e6db467a..9954b7da32 100644 --- a/drivers/common/cnxk/roc_errata.h +++ b/drivers/common/cnxk/roc_errata.h @@ -4,6 +4,8 @@ #ifndef _ROC_ERRATA_H_ #define _ROC_ERRATA_H_ +#include "roc_model.h" + /* Errata IPBUNIXRX-40129 */ static inline bool roc_errata_nix_has_no_drop_re(void) @@ -98,4 +100,11 @@ roc_errata_nix_sdp_send_has_mtu_size_16k(void) roc_model_is_cn96_a0() || roc_model_is_cn96_b0()); } +/* Errata IPBUCPT-38753 */ +static inline bool +roc_errata_cpt_hang_on_mixed_ctx_val(void) +{ + return roc_model_is_cn10ka_a0() || roc_model_is_cn10ka_a1(); +} + #endif /* _ROC_ERRATA_H_ */ diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c index 67bd7e3243..adc1c7652b 100644 --- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c +++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c @@ -8,6 +8,7 @@ #include "roc_ae_fpm_tables.h" #include "roc_cpt.h" +#include "roc_errata.h" #include "roc_ie_on.h" #include "cnxk_ae.h" @@ -636,7 +637,7 @@ cnxk_cpt_inst_w7_get(struct cnxk_se_sess *sess, struct roc_cpt *roc_cpt) inst_w7.s.cptr = (uint64_t)&sess->roc_se_ctx.se_ctx; - if (roc_cpt->cpt_revision == ROC_CPT_REVISION_ID_106XX) + if (roc_errata_cpt_hang_on_mixed_ctx_val()) inst_w7.s.ctx_val = 1; else inst_w7.s.cptr += 8; @@ -709,7 +710,7 @@ sym_session_configure(struct roc_cpt *roc_cpt, struct rte_crypto_sym_xform *xfor sess_priv->cpt_inst_w7 = cnxk_cpt_inst_w7_get(sess_priv, roc_cpt); - if (roc_cpt->cpt_revision == ROC_CPT_REVISION_ID_106XX) + if (roc_errata_cpt_hang_on_mixed_ctx_val()) roc_se_ctx_init(&sess_priv->roc_se_ctx); return 0; @@ -735,7 +736,8 @@ sym_session_clear(struct rte_cryptodev_sym_session *sess, bool is_session_less) struct cnxk_se_sess *sess_priv = (struct cnxk_se_sess *)sess; /* Trigger CTX flush + invalidate to remove from CTX_CACHE */ - roc_cpt_lf_ctx_flush(sess_priv->lf, &sess_priv->roc_se_ctx.se_ctx, true); + if (roc_errata_cpt_hang_on_mixed_ctx_val()) + roc_cpt_lf_ctx_flush(sess_priv->lf, &sess_priv->roc_se_ctx.se_ctx, true); if (sess_priv->roc_se_ctx.auth_key != NULL) plt_free(sess_priv->roc_se_ctx.auth_key); @@ -763,7 +765,8 @@ cnxk_ae_session_clear(struct rte_cryptodev *dev, struct rte_cryptodev_asym_sessi struct cnxk_ae_sess *priv = (struct cnxk_ae_sess *)sess; /* Trigger CTX flush + invalidate to remove from CTX_CACHE */ - roc_cpt_lf_ctx_flush(priv->lf, &priv->hw_ctx, true); + if (roc_errata_cpt_hang_on_mixed_ctx_val()) + roc_cpt_lf_ctx_flush(priv->lf, &priv->hw_ctx, true); /* Free resources allocated in session_cfg */ cnxk_ae_free_session_parameters(priv); @@ -792,7 +795,7 @@ cnxk_ae_session_cfg(struct rte_cryptodev *dev, struct rte_crypto_asym_xform *xfo w7.u64 = 0; w7.s.egrp = roc_cpt->eng_grp[CPT_ENG_TYPE_AE]; - if (vf->cpt.cpt_revision == ROC_CPT_REVISION_ID_106XX) { + if (roc_errata_cpt_hang_on_mixed_ctx_val()) { hwc = &priv->hw_ctx; hwc->w0.s.aop_valid = 1; hwc->w0.s.ctx_hdr_size = 0; -- 2.25.1