From patchwork Fri Feb 24 09:40:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejasree Kondoj X-Patchwork-Id: 124513 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C355241D5F; Fri, 24 Feb 2023 10:41:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E869A42D0C; Fri, 24 Feb 2023 10:40:36 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 269C842B8C for ; Fri, 24 Feb 2023 10:40:34 +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 31O6nQHg032730 for ; Fri, 24 Feb 2023 01:40:33 -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=KTVB993sX+P4Xk3h6AnBUsKrupDi0AFQ6BdK4nwjwGJ5WwUg4o9rgwWXCeY9FnMyVQ8Z FUr/YuhcbCzBrYx+VbyNdDJ584h6rl4rsAjN8By+CE21SahH2YHfxeOxyoO9uSqLYrc5 023+Y+YQsBLoKZZN2LiuCeW9Cl9pLD1xU3SBHLdFRuTCRmYOF3U1iiFP5EN7EwbuYYBP WBLqQ91le9yUj/D8dmT/mj7WU0u8FOdsFlKu1NhTJTZ7gtJbXCUm+YWe+9cz+FYYk+rC CCRW6ozQmrHhn+oWv1tTU0jaRJyj3VU8/R1gbMIbqiLSg7GC/SMDWQpJ9NBAbb+BBq1C bg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3nxfkwb2hh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 24 Feb 2023 01:40: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; Fri, 24 Feb 2023 01:40: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; Fri, 24 Feb 2023 01:40:30 -0800 Received: from hyd1554.marvell.com (unknown [10.29.57.11]) by maili.marvell.com (Postfix) with ESMTP id 5E8983F706B; Fri, 24 Feb 2023 01:40:29 -0800 (PST) From: Tejasree Kondoj To: Akhil Goyal CC: Anoob Joseph , Gowrishankar Muthukrishnan , Subject: [PATCH v2 07/11] common/cnxk: add errata function for CPT set ctx Date: Fri, 24 Feb 2023 15:10:10 +0530 Message-ID: <20230224094014.3246764-8-ktejasree@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230224094014.3246764-1-ktejasree@marvell.com> References: <20230224094014.3246764-1-ktejasree@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: wTo08LqyO1CgTByqCpWH6MXkCCNqs_Ke X-Proofpoint-ORIG-GUID: wTo08LqyO1CgTByqCpWH6MXkCCNqs_Ke 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_05,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;