The common drivers_probe function calls in a loop to all probe functions
for classes requested by the user. After it manages to probe them all,
it updates this on the device in the "classes_loaded" field.
If one of them fails, all those probed to it are remove using the
drivers_remove function. However, this function only releases the
classes in the "classes_loaded" field on the given device and misses the
newly probed classes.
This patch removes the condition from the release function, and ensures
that the caller function sends a more accurate parameter.
Fixes: 8a41f4deccc3 ("common/mlx5: introduce layer for multiple class drivers")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
unsigned int i = 0;
int ret = 0;
- enabled_classes &= cdev->classes_loaded;
while (enabled_classes) {
driver = driver_get(RTE_BIT64(i));
if (driver != NULL) {
cdev->classes_loaded |= enabled_classes;
return 0;
probe_err:
- /* Only unload drivers which are enabled which were enabled
- * in this probe instance.
+ /*
+ * Need to remove only drivers which were not probed before this probe
+ * instance, but have already been probed before this failure.
*/
+ enabled_classes &= ~cdev->classes_loaded;
drivers_remove(cdev, enabled_classes);
return ret;
}