net/octeontx2: add security in Tx
[dpdk.git] / drivers / net / failsafe / failsafe.c
index 8f7d911..8af31d7 100644 (file)
@@ -253,8 +253,8 @@ fs_eth_dev_create(struct rte_vdev_device *vdev)
                 */
                FOREACH_SUBDEV(sdev, i, dev)
                        if (sdev->state >= DEV_PROBED) {
-                               ether_addr_copy(&ETH(sdev)->data->mac_addrs[0],
-                                               mac);
+                               rte_ether_addr_copy(
+                                       &ETH(sdev)->data->mac_addrs[0], mac);
                                break;
                        }
                /*
@@ -265,7 +265,7 @@ fs_eth_dev_create(struct rte_vdev_device *vdev)
                 * probed slaves.
                 */
                if (i == priv->subs_tail)
-                       eth_random_addr(&mac->addr_bytes[0]);
+                       rte_eth_random_addr(&mac->addr_bytes[0]);
        }
        INFO("MAC address is %02x:%02x:%02x:%02x:%02x:%02x",
                mac->addr_bytes[0], mac->addr_bytes[1],
@@ -364,6 +364,10 @@ rte_pmd_failsafe_probe(struct rte_vdev_device *vdev)
                 * 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);
@@ -374,7 +378,7 @@ rte_pmd_failsafe_probe(struct rte_vdev_device *vdev)
                        }
                        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;