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 8DD98A0C43; Wed, 20 Oct 2021 13:28:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7777D411F7; Wed, 20 Oct 2021 13:28:58 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id C242A40142 for ; Wed, 20 Oct 2021 13:28:56 +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 19KBCiPr015069; Wed, 20 Oct 2021 04:28:50 -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=ri9+pmORzPv8yITvVwgusYotQduvkGpR/3OplXB9+Es=; b=g2Td1F5ivumRd30ya8S3NROfHc74Ph72K2n7xlWpGxXuwYb7CD72a9lhd4X8deCzDhN7 HZ1hke3CVgTBbVVkl2DXCXUzFmKGIThJ8/laYZq2Yj95bB0pyJGBkqzWrD1Rs9cvP8h3 RsbiRwJ3kluSBVsmp6ibnuP7FzsFPZpTpf0J17ncqjknTI/+JN8XW9AKZyNWVwQ0ixfG dninFj96gzPQ1zKUKeQGoy58t3ops+dLWQZcod75wJZL5a5HFDMmLBFsJfIh2sWmJZwk SQbApYsQ4Z7YhyRLpil60wiLaQFwlijwP8rP4LrZp+gesi6hdZBRdZdYMkCoKhRNVFbQ Aw== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com with ESMTP id 3btaa7a4t9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 20 Oct 2021 04:28:50 -0700 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.18; Wed, 20 Oct 2021 04:28:48 -0700 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.18 via Frontend Transport; Wed, 20 Oct 2021 04:28:48 -0700 Received: from localhost.localdomain (unknown [10.28.36.185]) by maili.marvell.com (Postfix) with ESMTP id D19323F7082; Wed, 20 Oct 2021 04:28:41 -0700 (PDT) From: Akhil Goyal To: CC: , , , , , , , , , , , , , , , , , , , Akhil Goyal Date: Wed, 20 Oct 2021 16:57:52 +0530 Message-ID: <20211020112754.1270163-7-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: eHj5SWapwsNU_jMw7lzc61KXqHVjLnD0 X-Proofpoint-GUID: eHj5SWapwsNU_jMw7lzc61KXqHVjLnD0 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 6/8] drivers/crypto: invoke probing finish function 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" Invoke event_dev_probing_finish() function at the end of probing, this function sets the function pointers in the fp_ops flat array in case of secondary process. For primary process, fp_ops is updated in rte_cryptodev_start(). Signed-off-by: Akhil Goyal Acked-by: Konstantin Ananyev Acked-by: Fan Zhang Acked-by: Matan Azrad --- drivers/crypto/armv8/rte_armv8_pmd.c | 2 ++ drivers/crypto/bcmfs/bcmfs_sym_pmd.c | 2 ++ drivers/crypto/caam_jr/caam_jr.c | 2 ++ drivers/crypto/ccp/rte_ccp_pmd.c | 2 ++ drivers/crypto/cnxk/cn10k_cryptodev.c | 2 ++ drivers/crypto/cnxk/cn9k_cryptodev.c | 2 ++ drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 4 +++- drivers/crypto/dpaa_sec/dpaa_sec.c | 4 +++- drivers/crypto/ipsec_mb/ipsec_mb_private.c | 2 ++ drivers/crypto/mlx5/mlx5_crypto.c | 3 +++ drivers/crypto/mvsam/rte_mrvl_pmd.c | 2 ++ drivers/crypto/nitrox/nitrox_sym.c | 3 +++ drivers/crypto/null/null_crypto_pmd.c | 2 ++ drivers/crypto/octeontx/otx_cryptodev.c | 4 +++- drivers/crypto/octeontx2/otx2_cryptodev.c | 2 ++ drivers/crypto/openssl/rte_openssl_pmd.c | 2 ++ drivers/crypto/qat/qat_asym_pmd.c | 3 +++ drivers/crypto/qat/qat_sym_pmd.c | 2 ++ drivers/crypto/scheduler/scheduler_pmd.c | 2 ++ drivers/crypto/virtio/virtio_cryptodev.c | 2 ++ 20 files changed, 46 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c index 36a1a9bb4f..32127a874c 100644 --- a/drivers/crypto/armv8/rte_armv8_pmd.c +++ b/drivers/crypto/armv8/rte_armv8_pmd.c @@ -802,6 +802,8 @@ cryptodev_armv8_crypto_create(const char *name, internals->max_nb_qpairs = init_params->max_nb_queue_pairs; + rte_cryptodev_pmd_probing_finish(dev); + return 0; init_error: diff --git a/drivers/crypto/bcmfs/bcmfs_sym_pmd.c b/drivers/crypto/bcmfs/bcmfs_sym_pmd.c index d1dd22823e..bc7fb67218 100644 --- a/drivers/crypto/bcmfs/bcmfs_sym_pmd.c +++ b/drivers/crypto/bcmfs/bcmfs_sym_pmd.c @@ -394,6 +394,8 @@ bcmfs_sym_dev_create(struct bcmfs_device *fsdev) internals->sym_dev_id = cryptodev->data->dev_id; internals->fsdev_capabilities = bcmfs_sym_get_capabilities(); + rte_cryptodev_pmd_probing_finish(cryptodev); + BCMFS_LOG(DEBUG, "Created bcmfs-sym device %s as cryptodev instance %d", cryptodev->data->name, internals->sym_dev_id); return 0; diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c index 258750afe7..8c56610ac8 100644 --- a/drivers/crypto/caam_jr/caam_jr.c +++ b/drivers/crypto/caam_jr/caam_jr.c @@ -2368,6 +2368,8 @@ caam_jr_dev_init(const char *name, security_instance->sess_cnt = 0; dev->security_ctx = security_instance; + rte_cryptodev_pmd_probing_finish(dev); + RTE_LOG(INFO, PMD, "%s cryptodev init\n", dev->data->name); return 0; diff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c index a54d81de46..a35a8cd775 100644 --- a/drivers/crypto/ccp/rte_ccp_pmd.c +++ b/drivers/crypto/ccp/rte_ccp_pmd.c @@ -271,6 +271,8 @@ cryptodev_ccp_create(const char *name, internals->auth_opt = init_params->auth_opt; internals->crypto_num_dev = cryptodev_cnt; + rte_cryptodev_pmd_probing_finish(dev); + return 0; init_error: diff --git a/drivers/crypto/cnxk/cn10k_cryptodev.c b/drivers/crypto/cnxk/cn10k_cryptodev.c index 869d322d9b..1e0a7b91c9 100644 --- a/drivers/crypto/cnxk/cn10k_cryptodev.c +++ b/drivers/crypto/cnxk/cn10k_cryptodev.c @@ -102,6 +102,8 @@ cn10k_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, cn10k_cpt_set_enqdeq_fns(dev); cn10k_sec_ops_override(); + rte_cryptodev_pmd_probing_finish(dev); + return 0; dev_fini: diff --git a/drivers/crypto/cnxk/cn9k_cryptodev.c b/drivers/crypto/cnxk/cn9k_cryptodev.c index 54df06eec0..54cd77e575 100644 --- a/drivers/crypto/cnxk/cn9k_cryptodev.c +++ b/drivers/crypto/cnxk/cn9k_cryptodev.c @@ -102,6 +102,8 @@ cn9k_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, cn9k_cpt_set_enqdeq_fns(dev); cn9k_sec_ops_override(); + rte_cryptodev_pmd_probing_finish(dev); + return 0; dev_fini: diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 4eb3615250..cb2ad435bf 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -4032,8 +4032,10 @@ cryptodev_dpaa2_sec_probe(struct rte_dpaa2_driver *dpaa2_drv __rte_unused, /* Invoke PMD device initialization function */ retval = dpaa2_sec_dev_init(cryptodev); - if (retval == 0) + if (retval == 0) { + rte_cryptodev_pmd_probing_finish(cryptodev); return 0; + } if (rte_eal_process_type() == RTE_PROC_PRIMARY) rte_free(cryptodev->data->dev_private); diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index c7ef1c7b0f..454b9c4785 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -3594,8 +3594,10 @@ cryptodev_dpaa_sec_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused, /* Invoke PMD device initialization function */ retval = dpaa_sec_dev_init(cryptodev); - if (retval == 0) + if (retval == 0) { + rte_cryptodev_pmd_probing_finish(cryptodev); return 0; + } retval = -ENXIO; out: diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_private.c b/drivers/crypto/ipsec_mb/ipsec_mb_private.c index d896fa20b4..aab42c360c 100644 --- a/drivers/crypto/ipsec_mb/ipsec_mb_private.c +++ b/drivers/crypto/ipsec_mb/ipsec_mb_private.c @@ -134,6 +134,8 @@ ipsec_mb_create(struct rte_vdev_device *vdev, break; } + rte_cryptodev_pmd_probing_finish(dev); + IPSEC_MB_LOG(INFO, "IPSec Multi-buffer library version used: %s\n", imb_get_version_str()); diff --git a/drivers/crypto/mlx5/mlx5_crypto.c b/drivers/crypto/mlx5/mlx5_crypto.c index 6a2f8b6ac6..14b6783e13 100644 --- a/drivers/crypto/mlx5/mlx5_crypto.c +++ b/drivers/crypto/mlx5/mlx5_crypto.c @@ -1061,6 +1061,9 @@ mlx5_crypto_dev_probe(struct rte_device *dev) pthread_mutex_lock(&priv_list_lock); TAILQ_INSERT_TAIL(&mlx5_crypto_priv_list, priv, next); pthread_mutex_unlock(&priv_list_lock); + + rte_cryptodev_pmd_probing_finish(crypto_dev); + return 0; } diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd.c b/drivers/crypto/mvsam/rte_mrvl_pmd.c index a72642a772..04efd9aaa8 100644 --- a/drivers/crypto/mvsam/rte_mrvl_pmd.c +++ b/drivers/crypto/mvsam/rte_mrvl_pmd.c @@ -1114,6 +1114,8 @@ cryptodev_mrvl_crypto_create(const char *name, if (ret) goto init_error; + rte_cryptodev_pmd_probing_finish(dev); + return 0; init_error: diff --git a/drivers/crypto/nitrox/nitrox_sym.c b/drivers/crypto/nitrox/nitrox_sym.c index f8b7edcd69..cb5393d2f1 100644 --- a/drivers/crypto/nitrox/nitrox_sym.c +++ b/drivers/crypto/nitrox/nitrox_sym.c @@ -783,6 +783,9 @@ nitrox_sym_pmd_create(struct nitrox_device *ndev) ndev->sym_dev = cdev->data->dev_private; ndev->sym_dev->cdev = cdev; ndev->sym_dev->ndev = ndev; + + rte_cryptodev_pmd_probing_finish(cdev); + NITROX_LOG(DEBUG, "Created cryptodev '%s', dev_id %d, drv_id %d\n", cdev->data->name, cdev->data->dev_id, nitrox_sym_drv_id); return 0; diff --git a/drivers/crypto/null/null_crypto_pmd.c b/drivers/crypto/null/null_crypto_pmd.c index f9935d52cc..9ecb434fd0 100644 --- a/drivers/crypto/null/null_crypto_pmd.c +++ b/drivers/crypto/null/null_crypto_pmd.c @@ -184,6 +184,8 @@ cryptodev_null_create(const char *name, internals->max_nb_qpairs = init_params->max_nb_queue_pairs; + rte_cryptodev_pmd_probing_finish(dev); + return 0; } diff --git a/drivers/crypto/octeontx/otx_cryptodev.c b/drivers/crypto/octeontx/otx_cryptodev.c index c294f86d79..05b78329d6 100644 --- a/drivers/crypto/octeontx/otx_cryptodev.c +++ b/drivers/crypto/octeontx/otx_cryptodev.c @@ -56,8 +56,10 @@ otx_cpt_pci_probe(struct rte_pci_driver *pci_drv, /* Invoke PMD device initialization function */ retval = otx_cpt_dev_create(cryptodev); - if (retval == 0) + if (retval == 0) { + rte_cryptodev_pmd_probing_finish(cryptodev); return 0; + } CPT_LOG_ERR("[DRV %s]: Failed to create device " "(vendor_id: 0x%x device_id: 0x%x", diff --git a/drivers/crypto/octeontx2/otx2_cryptodev.c b/drivers/crypto/octeontx2/otx2_cryptodev.c index 85b1f00263..fc7ad05366 100644 --- a/drivers/crypto/octeontx2/otx2_cryptodev.c +++ b/drivers/crypto/octeontx2/otx2_cryptodev.c @@ -135,6 +135,8 @@ otx2_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, if (rte_eal_process_type() == RTE_PROC_SECONDARY) otx2_cpt_set_enqdeq_fns(dev); + rte_cryptodev_pmd_probing_finish(dev); + return 0; otx2_dev_fini: diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c index 13c6ea8724..5794ed8159 100644 --- a/drivers/crypto/openssl/rte_openssl_pmd.c +++ b/drivers/crypto/openssl/rte_openssl_pmd.c @@ -2213,6 +2213,8 @@ cryptodev_openssl_create(const char *name, internals->max_nb_qpairs = init_params->max_nb_queue_pairs; + rte_cryptodev_pmd_probing_finish(dev); + return 0; init_error: diff --git a/drivers/crypto/qat/qat_asym_pmd.c b/drivers/crypto/qat/qat_asym_pmd.c index e91bb0d317..0944d27a4d 100644 --- a/drivers/crypto/qat/qat_asym_pmd.c +++ b/drivers/crypto/qat/qat_asym_pmd.c @@ -343,6 +343,9 @@ qat_asym_dev_create(struct qat_pci_device *qat_pci_dev, } qat_pci_dev->asym_dev = internals; + + rte_cryptodev_pmd_probing_finish(cryptodev); + QAT_LOG(DEBUG, "Created QAT ASYM device %s as cryptodev instance %d", cryptodev->data->name, internals->asym_dev_id); return 0; diff --git a/drivers/crypto/qat/qat_sym_pmd.c b/drivers/crypto/qat/qat_sym_pmd.c index efda921c05..d4f087733f 100644 --- a/drivers/crypto/qat/qat_sym_pmd.c +++ b/drivers/crypto/qat/qat_sym_pmd.c @@ -500,6 +500,8 @@ qat_sym_dev_create(struct qat_pci_device *qat_pci_dev, QAT_LOG(DEBUG, "Created QAT SYM device %s as cryptodev instance %d", cryptodev->data->name, internals->sym_dev_id); + rte_cryptodev_pmd_probing_finish(cryptodev); + return 0; error: diff --git a/drivers/crypto/scheduler/scheduler_pmd.c b/drivers/crypto/scheduler/scheduler_pmd.c index 560c26af50..dd198080bf 100644 --- a/drivers/crypto/scheduler/scheduler_pmd.c +++ b/drivers/crypto/scheduler/scheduler_pmd.c @@ -229,6 +229,8 @@ cryptodev_scheduler_create(const char *name, return -ENOMEM; } + rte_cryptodev_pmd_probing_finish(dev); + return 0; } diff --git a/drivers/crypto/virtio/virtio_cryptodev.c b/drivers/crypto/virtio/virtio_cryptodev.c index 8faa39df4a..ed64866758 100644 --- a/drivers/crypto/virtio/virtio_cryptodev.c +++ b/drivers/crypto/virtio/virtio_cryptodev.c @@ -754,6 +754,8 @@ crypto_virtio_create(const char *name, struct rte_pci_device *pci_dev, VIRTIO_CRYPTO_PMD_GUEST_FEATURES) < 0) return -1; + rte_cryptodev_pmd_probing_finish(cryptodev); + return 0; } -- 2.25.1