The common probe function gets as a user argument the classes it should
create, and checks whether the combination is valid.
In case the device already exists, it checks the integration of the
above with the classes that the device has.
However, the function does not check the combination when the device
does not exist and it has to create it.
Check if the combination is valid for all cases.
Fixes:
ad435d320473 ("common/mlx5: add bus-agnostic layer")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
dev->dev = eal_dev;
TAILQ_INSERT_HEAD(&devices_list, dev, next);
new_device = true;
- } else {
- /* Validate combination here. */
- ret = is_valid_class_combination(classes |
- dev->classes_loaded);
- if (ret != 0) {
- DRV_LOG(ERR, "Unsupported mlx5 classes combination.");
- return ret;
- }
+ }
+ /*
+ * Validate combination here.
+ * For new device, the classes_loaded field is 0 and it check only
+ * the classes given as user device arguments.
+ */
+ ret = is_valid_class_combination(classes | dev->classes_loaded);
+ if (ret != 0) {
+ DRV_LOG(ERR, "Unsupported mlx5 classes combination.");
+ goto class_err;
}
ret = drivers_probe(dev, classes);
if (ret)