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

Function drivers_probe

dpdk/drivers/common/mlx5/mlx5_common.c:917–958  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

915}
916
917static int
918drivers_probe(struct mlx5_common_device *cdev, uint32_t user_classes,
919 struct mlx5_kvargs_ctrl *mkvlist)
920{
921 struct mlx5_class_driver *driver;
922 uint32_t enabled_classes = 0;
923 bool already_loaded;
924 int ret = -EINVAL;
925
926 TAILQ_FOREACH(driver, &drivers_list, next) {
927 if ((driver->drv_class & user_classes) == 0)
928 continue;
929 if (!mlx5_bus_match(driver, cdev->dev))
930 continue;
931 already_loaded = cdev->classes_loaded & driver->drv_class;
932 if (already_loaded && driver->probe_again == 0) {
933 DRV_LOG(ERR, "Device %s is already probed",
934 cdev->dev->name);
935 ret = -EEXIST;
936 goto probe_err;
937 }
938 ret = driver->probe(cdev, mkvlist);
939 if (ret < 0) {
940 DRV_LOG(ERR, "Failed to load driver %s",
941 driver->name);
942 goto probe_err;
943 }
944 enabled_classes |= driver->drv_class;
945 }
946 if (!ret) {
947 cdev->classes_loaded |= enabled_classes;
948 return 0;
949 }
950probe_err:
951 /*
952 * Need to remove only drivers which were not probed before this probe
953 * instance, but have already been probed before this failure.
954 */
955 enabled_classes &= ~cdev->classes_loaded;
956 drivers_remove(cdev, enabled_classes);
957 return ret;
958}
959
960int
961mlx5_common_dev_probe(struct rte_device *eal_dev)

Callers 1

mlx5_common_dev_probeFunction · 0.85

Calls 2

mlx5_bus_matchFunction · 0.85
drivers_removeFunction · 0.85

Tested by

no test coverage detected