Hello DPDK community,
We are looking into an issue where we pass an invalid command line argument to a vdev, and we print out an error message but don’t exit. This is an issue with all of the command line options that we handle in dlb2_parse_params(). In a
nutshell, it looks like when we encounter an error in parsing, the error code is propagated to event_dlb2_vdev_probe() (event_dlb2_pci_probe() for PF), which is called by EAL during device probe in rte_bus_probe(). The problem is that rte_bus_probe() calls
the .probe function for each device but doesn’t exit on error:
if (vbus) {
ret = vbus->probe();
if (ret)
RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n", vbus->name);
}
return 0;
We want to exit if the command line arguments can’t be parsed, so we have a couple of options:
if (vbus) {
ret = vbus->probe();
if (ret) {
RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n", vbus->name);
return ret;
}
}
return 0;
Any preference, or other ideas? Option 1 is simple and contained in our code, but does call rte_exit() from library code. I’m not sure if that’s really an issue because we do want to exit if the DLB-specific options are malformed. Option
2 is simple and seems like a better option, but requires changes outside of DLB, so may be more difficult to upstream? (There may be reasons why the error is ignored for some devices). Let me know what you think.
Thanks you for your comments,
Tim McDaniel