From patchwork Tue Sep 7 14:20:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Archana Muniganti X-Patchwork-Id: 98193 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 03E96A0C40; Tue, 7 Sep 2021 16:21:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8D7DB41198; Tue, 7 Sep 2021 16:21:19 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id EA16F41196 for ; Tue, 7 Sep 2021 16:21:17 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 187C16UX025501 for ; Tue, 7 Sep 2021 07:21:17 -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-transfer-encoding : content-type; s=pfpt0220; bh=6dBNYbI/RJUP6yBJGa4VGlWAoI+rjXdJmcQZmjuD74g=; b=IotBIYuxcr/kHCxMrmEkvNEQO9XIxvIb01s4FnYte7Ka40kXjwp0egf3Z1MhNup5jIpC kxwvmqQbA4dAvdQiil0s/ei5c9AcW6XU7VGptWJMHn8SblO6AVagE6oEHNk6e29kuYq/ GktTkhikvWLqUw96GVrf+OENuI+6ldWJIXRXEeP8IktAFDsaDNSqHT2IUYD2vBzrbP1B 8xKkXSxCrjIut+vCz6qoUN20XWLfEWCv47waRRrusrNKj1rJ6HUHuQlDXp9fBlj3M/6B mGPoJ8M1/SkqkhMTC56D0DLsMeAPtu97/IhkyzXSMN/XQfkLwEkfuxqag7iVHgoHyoTK lQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com with ESMTP id 3awty5tmrc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 07 Sep 2021 07:21:17 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 7 Sep 2021 07:21:15 -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.18 via Frontend Transport; Tue, 7 Sep 2021 07:21:15 -0700 Received: from hyd1409.caveonetworks.com.com (unknown [10.29.45.15]) by maili.marvell.com (Postfix) with ESMTP id D08703F7091; Tue, 7 Sep 2021 07:21:12 -0700 (PDT) From: Archana Muniganti To: CC: Archana Muniganti , , , , , , Vamsi Attunuru Date: Tue, 7 Sep 2021 19:50:58 +0530 Message-ID: <20210907142103.18807-2-marchana@marvell.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20210907142103.18807-1-marchana@marvell.com> References: <20210907142103.18807-1-marchana@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: KHxBFiUHTQMCTKKyBZgK0opeWt68lDqL X-Proofpoint-ORIG-GUID: KHxBFiUHTQMCTKKyBZgK0opeWt68lDqL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-09-07_04,2021-09-07_01,2020-04-07_01 Subject: [dpdk-dev] [PATCH v2 1/6] crypto/cnxk: add cn9k security ctx 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 Sender: "dev" Add security ctx in cn9k crypto PMD. Signed-off-by: Archana Muniganti Signed-off-by: Vamsi Attunuru Signed-off-by: Tejasree Kondoj --- drivers/crypto/cnxk/cn9k_cryptodev.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/crypto/cnxk/cn9k_cryptodev.c b/drivers/crypto/cnxk/cn9k_cryptodev.c index 9ff2383d98..db2e085161 100644 --- a/drivers/crypto/cnxk/cn9k_cryptodev.c +++ b/drivers/crypto/cnxk/cn9k_cryptodev.c @@ -14,6 +14,7 @@ #include "cn9k_cryptodev_ops.h" #include "cnxk_cryptodev.h" #include "cnxk_cryptodev_capabilities.h" +#include "cnxk_cryptodev_sec.h" #include "roc_api.h" @@ -77,6 +78,11 @@ cn9k_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, plt_err("Failed to add engine group rc=%d", rc); goto dev_fini; } + + /* Create security context */ + rc = cnxk_crypto_sec_ctx_create(dev); + if (rc) + goto dev_fini; } dev->dev_ops = &cn9k_cpt_ops; @@ -117,6 +123,9 @@ cn9k_cpt_pci_remove(struct rte_pci_device *pci_dev) if (dev == NULL) return -ENODEV; + /* Destroy security context */ + cnxk_crypto_sec_ctx_destroy(dev); + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { vf = dev->data->dev_private; ret = roc_cpt_dev_fini(&vf->cpt);