+
+ if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
+ strlen(rte_vdev_device_args(vdev)) == 0) {
+ eth_dev = rte_eth_dev_attach_secondary(name);
+ if (!eth_dev) {
+ ERROR("Failed to probe %s", name);
+ return -1;
+ }
+ eth_dev->dev_ops = &failsafe_ops;
+ eth_dev->device = &vdev->device;
+ eth_dev->rx_pkt_burst = (eth_rx_burst_t)&failsafe_rx_burst;
+ eth_dev->tx_pkt_burst = (eth_tx_burst_t)&failsafe_tx_burst;
+ /*
+ * Failsafe will attempt to probe all of its sub-devices.
+ * Any failure in sub-devices is not a fatal error.
+ * A sub-device can be plugged later.
+ */
+ FOREACH_SUBDEV(sdev, i, eth_dev) {
+ /* skip empty devargs */
+ if (sdev->devargs.name[0] == '\0')
+ continue;
+
+ /* rebuild devargs to be able to get the bus name. */
+ ret = rte_devargs_parse(&devargs,
+ sdev->devargs.name);
+ if (ret != 0) {
+ ERROR("Failed to parse devargs %s",
+ devargs.name);
+ continue;
+ }
+ if (!devargs_already_listed(&devargs)) {
+ ret = rte_dev_probe(devargs.name);
+ if (ret < 0) {
+ ERROR("Failed to probe devargs %s",
+ devargs.name);
+ continue;
+ }
+ }
+ }
+ rte_eth_dev_probing_finish(eth_dev);
+ return 0;
+ }
+