[dpdk-dev] Failsafe Secondary Process

kumaraparameshwaran rathinavel kumaraparamesh92 at gmail.com
Wed Aug 11 14:54:24 CEST 2021


Hi All,
In the commit ee27edbe0c10ec8337c4cc4d2935a751d0da605f I see that for the
probe from the secondary process the below check was made, for vdev devices
like tap, af_packet.

+ if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
+           strlen(rte_vdev_device_args(dev)) == 0) {
+               eth_dev = rte_eth_dev_attach_secondary(name);
+               if (!eth_dev) {
+                       RTE_LOG(ERR, PMD, "Failed to probe %s\n", name);
+                       return -1;
+               }
+               /* TODO: request info from primary to set up Rx and Tx */
+               eth_dev->dev_ops = &ops;
+               return 0;
+       }

After that in the commit 4852aa8f6e2125664698afc43b820bd787b02756 the
strlen(rte_vdev_device_args(dev)) check for the secondary was removed so
that the secondary process could attach to the devices created by the
primary and work on it.
-       if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
-           strlen(rte_vdev_device_args(dev)) == 0) {
+       if (rte_eal_process_type() == RTE_PROC_SECONDARY) {


But I see in the rte_pmd_failsafe_probe looks like the strlen check was not
removed. Because of this when i try to use initialise the failsafe device
from secondary which was created by primary, rather than attaching to the
existing device, a new failsafe device is created. Looks like this is a
miss for the failsafe driver or is it intentionally retained?


commit ee27edbe0c10ec8337c4cc4d2935a751d0da605f
Date:   Tue Apr 24 05:51:24 2018 +0000

    drivers/net: share vdev data to secondary process

    dpdk-procinfo, as a secondary process, cannot fetch stats for vdev.

    This patch enables that by attaching the port from the shared data.
    We also fill the eth dev ops, with only some ops works in secondary
    process, for example, stats_get().


commit 4852aa8f6e2125664698afc43b820bd787b02756
Date:   Tue Oct 16 08:16:30 2018 +0800

    drivers/net: enable hotplug on secondary process

    Attach port from secondary should ignore devargs since the private
    device is not necessary to support. Also previously, detach port on
    a secondary process will mess primary process and cause the same
    device can't be attached back again. A secondary process should use
    rte_eth_dev_release_port_secondary to release a port.

Thanks,
Param.


More information about the dev mailing list