X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fcrypto%2Focteontx2%2Fotx2_cryptodev.c;h=e0a559b663b56b75c4cc8545680ec4b4362ea52d;hb=e863fe3a13da89787fdf3b5c590101a3c0f10af6;hp=02d2fd83bdcfcbfa5b32324c4e39ea69d7008cc2;hpb=ae9000ada946b54d29b33e84dc7d06cd2ab221c4;p=dpdk.git diff --git a/drivers/crypto/octeontx2/otx2_cryptodev.c b/drivers/crypto/octeontx2/otx2_cryptodev.c index 02d2fd83bd..e0a559b663 100644 --- a/drivers/crypto/octeontx2/otx2_cryptodev.c +++ b/drivers/crypto/octeontx2/otx2_cryptodev.c @@ -70,36 +70,39 @@ otx2_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, otx2_dev = &vf->otx2_dev; - /* Initialize the base otx2_dev object */ - ret = otx2_dev_init(pci_dev, otx2_dev); - if (ret) { - CPT_LOG_ERR("Could not initialize otx2_dev"); - goto pmd_destroy; - } - - /* Get number of queues available on the device */ - ret = otx2_cpt_available_queues_get(dev, &nb_queues); - if (ret) { - CPT_LOG_ERR("Could not determine the number of queues available"); - goto otx2_dev_fini; - } - - /* Don't exceed the limits set per VF */ - nb_queues = RTE_MIN(nb_queues, OTX2_CPT_MAX_QUEUES_PER_VF); - - if (nb_queues == 0) { - CPT_LOG_ERR("No free queues available on the device"); - goto otx2_dev_fini; - } - - vf->max_queues = nb_queues; - - CPT_LOG_INFO("Max queues supported by device: %d", vf->max_queues); - - ret = otx2_cpt_hardware_caps_get(dev, vf->hw_caps); - if (ret) { - CPT_LOG_ERR("Could not determine hardware capabilities"); - goto otx2_dev_fini; + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + /* Initialize the base otx2_dev object */ + ret = otx2_dev_init(pci_dev, otx2_dev); + if (ret) { + CPT_LOG_ERR("Could not initialize otx2_dev"); + goto pmd_destroy; + } + + /* Get number of queues available on the device */ + ret = otx2_cpt_available_queues_get(dev, &nb_queues); + if (ret) { + CPT_LOG_ERR("Could not determine the number of queues available"); + goto otx2_dev_fini; + } + + /* Don't exceed the limits set per VF */ + nb_queues = RTE_MIN(nb_queues, OTX2_CPT_MAX_QUEUES_PER_VF); + + if (nb_queues == 0) { + CPT_LOG_ERR("No free queues available on the device"); + goto otx2_dev_fini; + } + + vf->max_queues = nb_queues; + + CPT_LOG_INFO("Max queues supported by device: %d", + vf->max_queues); + + ret = otx2_cpt_hardware_caps_get(dev, vf->hw_caps); + if (ret) { + CPT_LOG_ERR("Could not determine hardware capabilities"); + goto otx2_dev_fini; + } } otx2_crypto_capabilities_init(vf->hw_caps); @@ -114,6 +117,7 @@ otx2_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, RTE_CRYPTODEV_FF_HW_ACCELERATED | RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | RTE_CRYPTODEV_FF_IN_PLACE_SGL | + RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT | RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT | RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT | RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO | @@ -121,10 +125,14 @@ otx2_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, RTE_CRYPTODEV_FF_SYM_SESSIONLESS | RTE_CRYPTODEV_FF_SECURITY; + if (rte_eal_process_type() == RTE_PROC_SECONDARY) + otx2_cpt_set_enqdeq_fns(dev); + return 0; otx2_dev_fini: - otx2_dev_fini(pci_dev, otx2_dev); + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + otx2_dev_fini(pci_dev, otx2_dev); pmd_destroy: rte_cryptodev_pmd_destroy(dev); exit: