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 CCB7D41D5B; Fri, 24 Feb 2023 06:49:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 092BB42B7E; Fri, 24 Feb 2023 06:48:37 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 2EE9842D0C for ; Fri, 24 Feb 2023 06:48:35 +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 31O3LIBJ005076 for ; Thu, 23 Feb 2023 21:48:34 -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=jFvLKltUt9RfLoC0oMWv4uPGryjMDQVaP1yVlXx9lUI=; b=iCa5z9u5+6EgsdLWINXPBeOHNRgZ8abGlij3NkVPyYYV1MMQ+mJbzdVheEXcTt7Kjxb9 B2xtRDozZW46eQ3g2cv0H/bMuhAVXvdW+lFVeahRGdjeR0VQU6eNa79R/F4Dv1iVazeh wXaYwkl4KXG5bHD5qhuFw1k/CSEEuiFKgyHjvHknaeTacgLp2wV/s37AFJ0HPO97vX5Y VnBoH8/AzKio8MIo7gS09JEqkpToen4KW0Zfq64gGhC82pwPqO+MYJh9wOivag270Hjv uzEORZssebL82nruG21n+aI8QHu6/RjF3U6GnapySKOFLGr5Fo2nlY8JxD7V72VuqPrd UA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3nxfkwa3ca-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 23 Feb 2023 21:48:34 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) 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:32 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Thu, 23 Feb 2023 21:48:32 -0800 Received: from hyd1554.marvell.com (unknown [10.29.57.11]) by maili.marvell.com (Postfix) with ESMTP id E457A3F7070; Thu, 23 Feb 2023 21:48:30 -0800 (PST) From: Tejasree Kondoj To: Akhil Goyal CC: Anoob Joseph , Gowrishankar Muthukrishnan , Subject: [PATCH 08/11] common/cnxk: replace CPT revision check with caps Date: Fri, 24 Feb 2023 11:18:10 +0530 Message-ID: <20230224054813.2855914-9-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: TjZNsCqDH95SatHbIzNuM4izOzWssAiG X-Proofpoint-ORIG-GUID: TjZNsCqDH95SatHbIzNuM4izOzWssAiG 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 Replace SG version revision check with capabilities populated from microcode. Signed-off-by: Tejasree Kondoj --- drivers/common/cnxk/hw/cpt.h | 3 ++- drivers/crypto/cnxk/cn10k_cryptodev_ops.c | 2 +- drivers/event/cnxk/cn10k_eventdev.c | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/common/cnxk/hw/cpt.h b/drivers/common/cnxk/hw/cpt.h index 44ff8b08b2..82ea076e4c 100644 --- a/drivers/common/cnxk/hw/cpt.h +++ b/drivers/common/cnxk/hw/cpt.h @@ -75,7 +75,8 @@ union cpt_eng_caps { uint64_t __io mmul : 1; uint64_t __io reserved_15_33 : 19; uint64_t __io pdcp_chain : 1; - uint64_t __io reserved_35_63 : 29; + uint64_t __io sg_ver2 : 1; + uint64_t __io reserved_36_63 : 28; }; }; diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c index d1a43eaf13..9f6fd4e411 100644 --- a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c +++ b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c @@ -1045,7 +1045,7 @@ cn10k_cpt_dequeue_burst(void *qptr, struct rte_crypto_op **ops, uint16_t nb_ops) void cn10k_cpt_set_enqdeq_fns(struct rte_cryptodev *dev, struct cnxk_cpt_vf *vf) { - if (vf->cpt.cpt_revision > ROC_CPT_REVISION_ID_106XX) + if (vf->cpt.hw_caps[CPT_ENG_TYPE_SE].sg_ver2 && vf->cpt.hw_caps[CPT_ENG_TYPE_IE].sg_ver2) dev->enqueue_burst = cn10k_cpt_sg_ver2_enqueue_burst; else dev->enqueue_burst = cn10k_cpt_sg_ver1_enqueue_burst; diff --git a/drivers/event/cnxk/cn10k_eventdev.c b/drivers/event/cnxk/cn10k_eventdev.c index 8e74edff55..ee0428adc8 100644 --- a/drivers/event/cnxk/cn10k_eventdev.c +++ b/drivers/event/cnxk/cn10k_eventdev.c @@ -602,7 +602,8 @@ cn10k_sso_fp_fns_set(struct rte_eventdev *event_dev) } } - if ((cpt != NULL) && (cpt->cpt_revision > ROC_CPT_REVISION_ID_106XX)) + if ((cpt != NULL) && cpt->hw_caps[CPT_ENG_TYPE_SE].sg_ver2 && + cpt->hw_caps[CPT_ENG_TYPE_IE].sg_ver2) event_dev->ca_enqueue = cn10k_cpt_sg_ver2_crypto_adapter_enqueue; else event_dev->ca_enqueue = cn10k_cpt_sg_ver1_crypto_adapter_enqueue; -- 2.25.1