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

Function rte_dpaa_bus_probe

dpdk/drivers/bus/dpaa/dpaa_bus.c:624–717  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

622}
623
624static int
625rte_dpaa_bus_probe(void)
626{
627 int ret = -1;
628 struct rte_dpaa_device *dev;
629 struct rte_dpaa_driver *drv;
630 FILE *svr_file = NULL;
631 unsigned int svr_ver;
632 int probe_all = rte_dpaa_bus.bus.conf.scan_mode != RTE_BUS_SCAN_ALLOWLIST;
633 static int process_once;
634
635 /* If DPAA bus is not present nothing needs to be done */
636 if (!rte_dpaa_bus.detected)
637 return 0;
638
639 /* Device list creation is only done once */
640 if (!process_once) {
641 rte_dpaa_bus_dev_build();
642 /* One time load of Qman/Bman drivers */
643 ret = qman_global_init();
644 if (ret) {
645 DPAA_BUS_ERR("QMAN initialization failed: %d",
646 ret);
647 return ret;
648 }
649 ret = bman_global_init();
650 if (ret) {
651 DPAA_BUS_ERR("BMAN initialization failed: %d",
652 ret);
653 return ret;
654 }
655 }
656 process_once = 1;
657
658 /* If no device present on DPAA bus nothing needs to be done */
659 if (TAILQ_EMPTY(&rte_dpaa_bus.device_list))
660 return 0;
661
662 /* Register DPAA mempool ops only if any DPAA device has
663 * been detected.
664 */
665 rte_mbuf_set_platform_mempool_ops(DPAA_MEMPOOL_OPS_NAME);
666
667 svr_file = fopen(DPAA_SOC_ID_FILE, "r");
668 if (svr_file) {
669 if (fscanf(svr_file, "svr:%x", &svr_ver) > 0)
670 dpaa_svr_family = svr_ver & SVR_MASK;
671 fclose(svr_file);
672 }
673
674 TAILQ_FOREACH(dev, &rte_dpaa_bus.device_list, next) {
675 if (dev->device_type == FSL_DPAA_ETH) {
676 ret = rte_dpaa_setup_intr(dev->intr_handle);
677 if (ret)
678 DPAA_BUS_ERR("Error setting up interrupt.\n");
679 }
680 }
681

Callers

nothing calls this directly

Calls 8

rte_dpaa_bus_dev_buildFunction · 0.85
qman_global_initFunction · 0.85
bman_global_initFunction · 0.85
rte_dpaa_setup_intrFunction · 0.85
rte_dpaa_device_matchFunction · 0.85
rte_dev_is_probedFunction · 0.85

Tested by

no test coverage detected