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 CC678A0C43; Wed, 20 Oct 2021 13:28:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 71010411F3; Wed, 20 Oct 2021 13:28:51 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id B2E4440142 for ; Wed, 20 Oct 2021 13:28:49 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19KBQ9Vr015156; Wed, 20 Oct 2021 04:28:43 -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=4NBtYcoGNTgehHffHIKWrtE8xdEBe+EZhs+5UACiAhc=; b=SpGSY6YkYyXu6FdsiGIgkpWlDYtFppT5ahXUDSR1Tyk9CG2em7f1HTfL4mJtjcmeQd5g Abz+S6YxN0U9OD/lIQEgIMwM/BGDa41yWU3UWHbhBaMk9JDhqQMkGKVk4lZHzNoOvObg I66dM+wA12lAY0uht311K3UJPKShUVwpoTLODBpQJ+Jwz/40BBXyZCisKgIFCucfuf5i 9Ma68G/jdQhHwT4ZP9ppwdUpHbE72/GJ58iP0nXQvAGfOfwTXhnk6DXkxNUVCPMAr2cM mEptOCNi/0Y2iGSsedv3pS5w3DTfBzf9rtRTNg+zKGKVNHhIvO4OEQiOGQz3t/jtL+Gy Xw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com with ESMTP id 3btaa7a4sj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 20 Oct 2021 04:28:42 -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; Wed, 20 Oct 2021 04:28:41 -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; Wed, 20 Oct 2021 04:28:41 -0700 Received: from localhost.localdomain (unknown [10.28.36.185]) by maili.marvell.com (Postfix) with ESMTP id 412A13F707F; Wed, 20 Oct 2021 04:28:35 -0700 (PDT) From: Akhil Goyal To: CC: , , , , , , , , , , , , , , , , , , , Akhil Goyal Date: Wed, 20 Oct 2021 16:57:51 +0530 Message-ID: <20211020112754.1270163-6-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211020112754.1270163-1-gakhil@marvell.com> References: <20211018144201.2028022-1-gakhil@marvell.com> <20211020112754.1270163-1-gakhil@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: 25AcxSewQqRE68SRQf8aqPrqFnA4E5Ni X-Proofpoint-GUID: 25AcxSewQqRE68SRQf8aqPrqFnA4E5Ni X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-20_04,2021-10-20_02,2020-04-07_01 Subject: [dpdk-dev] [PATCH v4 5/8] cryptodev: add PMD device probe finish API 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" Added a rte_cryptodev_pmd_probing_finish API which need to be called by the PMD after the device is initialized completely. This will set the fast path function pointers in the flat array for secondary process. For primary process, these are set in rte_cryptodev_start. Signed-off-by: Akhil Goyal Acked-by: Konstantin Ananyev Acked-by: Fan Zhang --- lib/cryptodev/cryptodev_pmd.c | 16 ++++++++++++++++ lib/cryptodev/cryptodev_pmd.h | 13 +++++++++++++ lib/cryptodev/version.map | 1 + 3 files changed, 30 insertions(+) diff --git a/lib/cryptodev/cryptodev_pmd.c b/lib/cryptodev/cryptodev_pmd.c index fd74543682..739a0b3f34 100644 --- a/lib/cryptodev/cryptodev_pmd.c +++ b/lib/cryptodev/cryptodev_pmd.c @@ -161,6 +161,22 @@ rte_cryptodev_pmd_destroy(struct rte_cryptodev *cryptodev) return 0; } +void +rte_cryptodev_pmd_probing_finish(struct rte_cryptodev *cryptodev) +{ + if (cryptodev == NULL) + return; + /* + * for secondary process, at that point we expect device + * to be already 'usable', so shared data and all function + * pointers for fast-path devops have to be setup properly + * inside rte_cryptodev. + */ + if (rte_eal_process_type() == RTE_PROC_SECONDARY) + cryptodev_fp_ops_set(rte_crypto_fp_ops + + cryptodev->data->dev_id, cryptodev); +} + static uint16_t dummy_crypto_enqueue_burst(__rte_unused void *qp, __rte_unused struct rte_crypto_op **ops, diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h index a71edbb991..9bb1e47ae4 100644 --- a/lib/cryptodev/cryptodev_pmd.h +++ b/lib/cryptodev/cryptodev_pmd.h @@ -509,6 +509,19 @@ __rte_internal uint8_t rte_cryptodev_allocate_driver(struct cryptodev_driver *crypto_drv, const struct rte_driver *drv); +/** + * @internal + * This is the last step of device probing. It must be called after a + * cryptodev is allocated and initialized successfully. + * + * @param dev Pointer to cryptodev struct + * + * @return + * void + */ +__rte_internal +void +rte_cryptodev_pmd_probing_finish(struct rte_cryptodev *dev); #define RTE_PMD_REGISTER_CRYPTO_DRIVER(crypto_drv, drv, driver_id)\ RTE_INIT(init_ ##driver_id)\ diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map index ed62ced221..157dac521d 100644 --- a/lib/cryptodev/version.map +++ b/lib/cryptodev/version.map @@ -123,5 +123,6 @@ INTERNAL { rte_cryptodev_pmd_get_dev; rte_cryptodev_pmd_get_named_dev; rte_cryptodev_pmd_parse_input_args; + rte_cryptodev_pmd_probing_finish; rte_cryptodev_pmd_release_device; }; -- 2.25.1