MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cryptodev_dpaa_sec_probe

Function cryptodev_dpaa_sec_probe

dpdk/drivers/crypto/dpaa_sec/dpaa_sec.c:3721–3794  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3719}
3720
3721static int
3722cryptodev_dpaa_sec_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,
3723 struct rte_dpaa_device *dpaa_dev)
3724{
3725 struct rte_cryptodev *cryptodev;
3726 char cryptodev_name[RTE_CRYPTODEV_NAME_MAX_LEN];
3727
3728 int retval;
3729
3730 if (rte_eal_process_type() != RTE_PROC_PRIMARY)
3731 return 0;
3732
3733 snprintf(cryptodev_name, sizeof(cryptodev_name), "%s", dpaa_dev->name);
3734
3735 cryptodev = rte_cryptodev_pmd_allocate(cryptodev_name, rte_socket_id());
3736 if (cryptodev == NULL)
3737 return -ENOMEM;
3738
3739 cryptodev->data->dev_private = rte_zmalloc_socket(
3740 "cryptodev private structure",
3741 sizeof(struct dpaa_sec_dev_private),
3742 RTE_CACHE_LINE_SIZE,
3743 rte_socket_id());
3744
3745 if (cryptodev->data->dev_private == NULL)
3746 rte_panic("Cannot allocate memzone for private "
3747 "device data");
3748
3749 dpaa_dev->crypto_dev = cryptodev;
3750 cryptodev->device = &dpaa_dev->device;
3751
3752 /* init user callbacks */
3753 TAILQ_INIT(&(cryptodev->link_intr_cbs));
3754
3755 /* if sec device version is not configured */
3756 if (!rta_get_sec_era()) {
3757 const struct device_node *caam_node;
3758
3759 for_each_compatible_node(caam_node, NULL, "fsl,sec-v4.0") {
3760 const uint32_t *prop = of_get_property(caam_node,
3761 "fsl,sec-era",
3762 NULL);
3763 if (prop) {
3764 rta_set_sec_era(
3765 INTL_SEC_ERA(rte_cpu_to_be_32(*prop)));
3766 break;
3767 }
3768 }
3769 }
3770
3771 if (unlikely(!DPAA_PER_LCORE_PORTAL)) {
3772 retval = rte_dpaa_portal_init((void *)1);
3773 if (retval) {
3774 DPAA_SEC_ERR("Unable to initialize portal");
3775 goto out;
3776 }
3777 }
3778

Callers

nothing calls this directly

Calls 13

rte_eal_process_typeFunction · 0.85
snprintfFunction · 0.85
rte_socket_idFunction · 0.85
rte_zmalloc_socketFunction · 0.85
rta_get_sec_eraFunction · 0.85
of_get_propertyFunction · 0.85
rta_set_sec_eraFunction · 0.85
rte_dpaa_portal_initFunction · 0.85
dpaa_sec_dev_initFunction · 0.85
rte_freeFunction · 0.85

Tested by

no test coverage detected