* Net class driver callback to probe a device. * * This function probe PCI bus device(s) or a single SF on auxiliary bus. * * @param[in] cdev * Pointer to the common mlx5 device. * @param[in, out] mkvlist * Pointer to mlx5 kvargs control, can be NULL if there is no devargs. * * @return * 0 on success, a negative errno value otherwise and rte_errno is set. */
| 2879 | * 0 on success, a negative errno value otherwise and rte_errno is set. |
| 2880 | */ |
| 2881 | int |
| 2882 | mlx5_os_net_probe(struct mlx5_common_device *cdev, |
| 2883 | struct mlx5_kvargs_ctrl *mkvlist) |
| 2884 | { |
| 2885 | int ret; |
| 2886 | |
| 2887 | if (rte_eal_process_type() == RTE_PROC_PRIMARY) |
| 2888 | mlx5_pmd_socket_init(); |
| 2889 | ret = mlx5_init_once(); |
| 2890 | if (ret) { |
| 2891 | DRV_LOG(ERR, "Unable to init PMD global data: %s", |
| 2892 | strerror(rte_errno)); |
| 2893 | return -rte_errno; |
| 2894 | } |
| 2895 | ret = mlx5_probe_again_args_validate(cdev, mkvlist); |
| 2896 | if (ret) { |
| 2897 | DRV_LOG(ERR, "Probe again parameters are not compatible : %s", |
| 2898 | strerror(rte_errno)); |
| 2899 | return -rte_errno; |
| 2900 | } |
| 2901 | if (mlx5_dev_is_pci(cdev->dev)) |
| 2902 | return mlx5_os_pci_probe(cdev, mkvlist); |
| 2903 | else |
| 2904 | return mlx5_os_auxiliary_probe(cdev, mkvlist); |
| 2905 | } |
| 2906 | |
| 2907 | /** |
| 2908 | * Cleanup resources when the last device is closed. |
nothing calls this directly
no test coverage detected