From patchwork Fri Jul 31 13:51:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Dwivedi X-Patchwork-Id: 75106 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EFB20A052B; Fri, 31 Jul 2020 15:52:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CACA21C00D; Fri, 31 Jul 2020 15:52:36 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 1320811A2 for ; Fri, 31 Jul 2020 15:52:34 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06VDkB6V000398; Fri, 31 Jul 2020 06:52:34 -0700 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-type; s=pfpt0818; bh=/zlskoz+tTwwVTqpChTH1dMD2jrTs68QNtwBD1DAqCo=; b=gEgJX6MndwTGbiBhQuCfcFC+Z+zHf3Rz5slu+6WB7s8oB7l8zU3aKcXKjGbOmHO6T1JG 1tpCLNAkClW/1uC4YiFPNH9Z26rl+VNDkbn19zvG8kSkUmav4MnwIuaHJ0SQt3Fp8LtB cLdU92GUVPyuzo/11zCGQUpjza80fwLkupb7NHhYuKkyLpbmyeqIyVy5kMTNZPZ/s9E0 johLfUT3fgf4d4SVKeEaazYVSRn0Z2bZKH9Ldton/VvgAjjJW0IlfEx5p9phaGt0T00+ qbt2mWkT3RLcQ1jppvf/D0icj2w2vEaACxLaLvFIGadMrQyK8zBTuavMRHV3Se38pjxu qw== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 32gj3rav36-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 31 Jul 2020 06:52:34 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 31 Jul 2020 06:52:32 -0700 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.2 via Frontend Transport; Fri, 31 Jul 2020 06:52:33 -0700 Received: from hyd1349.t110.caveonetworks.com (unknown [10.29.45.13]) by maili.marvell.com (Postfix) with ESMTP id 075533F703F; Fri, 31 Jul 2020 06:52:30 -0700 (PDT) From: Ankur Dwivedi To: CC: , , , , , Ankur Dwivedi Date: Fri, 31 Jul 2020 19:21:53 +0530 Message-ID: <1596203513-21124-2-git-send-email-adwivedi@marvell.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1596203513-21124-1-git-send-email-adwivedi@marvell.com> References: <1596203513-21124-1-git-send-email-adwivedi@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-31_04:2020-07-31, 2020-07-31 signatures=0 Subject: [dpdk-dev] [PATCH 2/2] crypto/octeontx2: add cpt kernel driver version check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Tejasree Kondoj This patch checks if cpt pmd is compatible with kernel cpt driver. Signed-off-by: Ankur Dwivedi Signed-off-by: Tejasree Kondoj --- drivers/crypto/octeontx2/otx2_cryptodev.h | 1 + drivers/crypto/octeontx2/otx2_cryptodev_mbox.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/drivers/crypto/octeontx2/otx2_cryptodev.h b/drivers/crypto/octeontx2/otx2_cryptodev.h index a00f3d6..fba7222 100644 --- a/drivers/crypto/octeontx2/otx2_cryptodev.h +++ b/drivers/crypto/octeontx2/otx2_cryptodev.h @@ -15,6 +15,7 @@ #define OTX2_CPT_MAX_LFS 64 #define OTX2_CPT_MAX_QUEUES_PER_VF 64 +#define OTX2_CPT_PMD_VERSION 3 /** * Device private data diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_mbox.c b/drivers/crypto/octeontx2/otx2_cryptodev_mbox.c index 6028439..75e610d 100644 --- a/drivers/crypto/octeontx2/otx2_cryptodev_mbox.c +++ b/drivers/crypto/octeontx2/otx2_cryptodev_mbox.c @@ -29,6 +29,13 @@ if (ret) return -EIO; + if (rsp->cpt_pf_drv_version != OTX2_CPT_PMD_VERSION) { + otx2_err("Incompatible CPT PMD version" + "(Kernel: 0x%04x DPDK: 0x%04x)", + rsp->cpt_pf_drv_version, OTX2_CPT_PMD_VERSION); + return -EPIPE; + } + memcpy(hw_caps, rsp->eng_caps, sizeof(union cpt_eng_caps) * CPT_MAX_ENG_TYPES);