return;
}
- if (rte_dev_probe(identifier) != 0) {
+ if (rte_dev_probe(identifier) < 0) {
TESTPMD_LOG(ERR, "Failed to attach port %s\n", identifier);
return;
}
port_flow_flush(port_id);
}
- if (rte_dev_remove(dev) != 0) {
+ if (rte_dev_remove(dev) < 0) {
TESTPMD_LOG(ERR, "Failed to detach device %s\n", dev->name);
return;
}
}
if (!devargs_already_listed(&devargs)) {
ret = rte_dev_probe(devargs.name);
- if (ret != 0) {
+ if (ret < 0) {
ERROR("Failed to probe devargs %s",
devargs.name);
continue;
ret = rte_eal_hotplug_add(da->bus->name,
da->name,
da->args);
- if (ret) {
+ if (ret < 0) {
ERROR("sub_device %d probe failed %s%s%s", i,
rte_errno ? "(" : "",
rte_errno ? strerror(rte_errno) : "",
FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_PROBED) {
sdev_ret = rte_dev_remove(sdev->dev);
- if (sdev_ret) {
+ if (sdev_ret < 0) {
ERROR("Failed to remove requested device %s (err: %d)",
sdev->dev->name, sdev_ret);
continue;
/* fallthrough */
case DEV_PROBED:
ret = rte_dev_remove(sdev->dev);
- if (ret) {
+ if (ret < 0) {
ERROR("Bus detach failed for sub_device %u",
SUB_ID(sdev));
} else {
ctx->devname, ctx->devargs);
vdev_netvsc_foreach_iface(vdev_netvsc_device_probe, 0, ctx);
ret = rte_eal_hotplug_add("vdev", ctx->devname, ctx->devargs);
- if (ret)
+ if (ret < 0)
goto error;
LIST_INSERT_HEAD(&vdev_netvsc_ctx_list, ctx, entry);
++vdev_netvsc_ctx_count;
*/
ret = dev->bus->plug(dev);
+ if (ret > 0)
+ ret = -ENOTSUP;
+
if (ret && !rte_dev_is_probed(dev)) { /* if hasn't ever succeeded */
RTE_LOG(ERR, EAL, "Driver cannot attach the device (%s)\n",
dev->name);
if (ret) {
RTE_LOG(ERR, EAL, "Driver cannot detach the device (%s)\n",
dev->name);
- return ret;
+ return (ret < 0) ? ret : -ENOENT;
}
return 0;