PCI DEV HOOKS */
| 695 | |
| 696 | /* PCI DEV HOOKS */ |
| 697 | static int |
| 698 | dlb2_eventdev_pci_init(struct rte_eventdev *eventdev) |
| 699 | { |
| 700 | int ret = 0; |
| 701 | struct rte_pci_device *pci_dev; |
| 702 | struct dlb2_devargs dlb2_args = { |
| 703 | .socket_id = rte_socket_id(), |
| 704 | .max_num_events = DLB2_MAX_NUM_LDB_CREDITS, |
| 705 | .producer_coremask = NULL, |
| 706 | .num_dir_credits_override = -1, |
| 707 | .qid_depth_thresholds = { {0} }, |
| 708 | .poll_interval = DLB2_POLL_INTERVAL_DEFAULT, |
| 709 | .sw_credit_quanta = DLB2_SW_CREDIT_QUANTA_DEFAULT, |
| 710 | .hw_credit_quanta = DLB2_SW_CREDIT_BATCH_SZ, |
| 711 | .default_depth_thresh = DLB2_DEPTH_THRESH_DEFAULT, |
| 712 | .max_cq_depth = DLB2_DEFAULT_CQ_DEPTH, |
| 713 | .max_enq_depth = DLB2_MAX_ENQUEUE_DEPTH |
| 714 | }; |
| 715 | struct dlb2_eventdev *dlb2; |
| 716 | int q; |
| 717 | const void *probe_args = NULL; |
| 718 | |
| 719 | DLB2_LOG_DBG("Enter with dev_id=%d socket_id=%d", |
| 720 | eventdev->data->dev_id, eventdev->data->socket_id); |
| 721 | |
| 722 | for (q = 0; q < DLB2_MAX_NUM_PORTS_ALL; q++) |
| 723 | dlb2_args.port_cos.cos_id[q] = DLB2_COS_DEFAULT; |
| 724 | |
| 725 | dlb2_pf_iface_fn_ptrs_init(); |
| 726 | |
| 727 | pci_dev = RTE_DEV_TO_PCI(eventdev->dev); |
| 728 | |
| 729 | if (rte_eal_process_type() == RTE_PROC_PRIMARY) { |
| 730 | dlb2 = dlb2_pmd_priv(eventdev); /* rte_zmalloc_socket mem */ |
| 731 | dlb2->version = DLB2_HW_DEVICE_FROM_PCI_ID(pci_dev); |
| 732 | if (dlb2->version == DLB2_HW_V2_5) |
| 733 | dlb2_args.max_num_events = DLB2_MAX_NUM_CREDITS(DLB2_HW_V2_5); |
| 734 | |
| 735 | /* Were we invoked with runtime parameters? */ |
| 736 | if (pci_dev->device.devargs) { |
| 737 | ret = dlb2_parse_params(pci_dev->device.devargs->args, |
| 738 | pci_dev->device.devargs->name, |
| 739 | &dlb2_args, |
| 740 | dlb2->version); |
| 741 | if (ret) { |
| 742 | DLB2_LOG_ERR("PFPMD failed to parse args ret=%d, errno=%d", |
| 743 | ret, rte_errno); |
| 744 | goto dlb2_probe_failed; |
| 745 | } |
| 746 | probe_args = &dlb2_args; |
| 747 | } |
| 748 | |
| 749 | /* Probe the DLB2 PF layer */ |
| 750 | dlb2->qm_instance.pf_dev = dlb2_probe(pci_dev, probe_args); |
| 751 | |
| 752 | if (dlb2->qm_instance.pf_dev == NULL) { |
| 753 | DLB2_LOG_ERR("DLB2 PF Probe failed with error %d", |
| 754 | rte_errno); |
nothing calls this directly
no test coverage detected