Skip to contentSkip to conversation

failsafe: Bug fix for the secondary process RX-TX support

PATCH In review Kumara Parameshwaran 3 participants 3 messages Nov 11, 2021 – Nov 17, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 failsafe: Bug fix for the secondary process RX-TX support

Remove the vdev args check for secondary process which prevents the secondary from attaching to the device created by the primary process via the hotplug framework. This check was removed for other vdevs but was missed for failsafe.

---
 drivers/net/failsafe/failsafe.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/failsafe/failsafe.c +1 -2
index ad6b43538e..3c754a5f66 100644
@@ -340,8 +340,7 @@ rte_pmd_failsafe_probe(struct rte_vdev_device *vdev)
 	INFO("Initializing " FAILSAFE_DRIVER_NAME " for %s",
 			name);
 
-	if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
-	    strlen(rte_vdev_device_args(vdev)) == 0) {
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
 		eth_dev = rte_eth_dev_attach_secondary(name);
 		if (!eth_dev) {
 			ERROR("Failed to probe %s", name);
Signature · 1 line
2.30.1 (Apple Git-130)
#1 lore raw
Quoted 7 lines · Kumara Parameshwaran

Remove the vdev args check for secondary process which prevents the secondary from attaching
to the device created by the primary process via the hotplug framework. This check was removed
for other vdevs but was missed for failsafe.

Hello Kumara,

Thanks for your patch.
If this is a fix, can you provide the fixline with a pointer to the patch it is meant to fix please?

I'm guessing this should be this:

Fixes 4852aa8f6e21 ("drivers/net: enable hotplug on secondary process")

Looking at this patch, I see also

+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return rte_eth_dev_release_port_secondary(eth_dev);
+

Added to the remove callbacks of the ports.
It seems to be omitted from this patch, is there a reason?

Quoted 20 lines
---
 drivers/net/failsafe/failsafe.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/failsafe/failsafe.c +1 -2
index ad6b43538e..3c754a5f66 100644
@@ -340,8 +340,7 @@ rte_pmd_failsafe_probe(struct rte_vdev_device *vdev)
 	INFO("Initializing " FAILSAFE_DRIVER_NAME " for %s",
 			name);
 
-	if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
-	    strlen(rte_vdev_device_args(vdev)) == 0) {
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
 		eth_dev = rte_eth_dev_attach_secondary(name);
 		if (!eth_dev) {
 			ERROR("Failed to probe %s", name);
Signature · 1 line
2.30.1 (Apple Git-130)
Signature · 1 line
Gaetan Rivet
#2 lore raw
Quoted 25 lines · Gaëtan Rivet
Quoted 7 lines · Kumara Parameshwaran

Remove the vdev args check for secondary process which prevents the secondary from attaching
to the device created by the primary process via the hotplug framework. This check was removed
for other vdevs but was missed for failsafe.

Hello Kumara,

Thanks for your patch.
If this is a fix, can you provide the fixline with a pointer to the patch it is meant to fix please?

I'm guessing this should be this:

Fixes 4852aa8f6e21 ("drivers/net: enable hotplug on secondary process")

Looking at this patch, I see also

(quoted diff) +3 -0
+       if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+               return rte_eth_dev_release_port_secondary(eth_dev);
+
Quoted 3 lines

Added to the remove callbacks of the ports.
It seems to be omitted from this patch, is there a reason?

Hi Gaetan,

Above addition is no more required since primary and secondary release functions merged into 'rte_eth_dev_release_port()' one which has process type check inside it.

And failsafe remove path already calls 'rte_eth_dev_release_port()', so it should be OK.

Quoted 21 lines
Quoted 20 lines
---
  drivers/net/failsafe/failsafe.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/failsafe/failsafe.c +1 -2
index ad6b43538e..3c754a5f66 100644
@@ -340,8 +340,7 @@ rte_pmd_failsafe_probe(struct rte_vdev_device *vdev)
  	INFO("Initializing " FAILSAFE_DRIVER_NAME " for %s",
  			name);
 
-	if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
-	    strlen(rte_vdev_device_args(vdev)) == 0) {
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
  		eth_dev = rte_eth_dev_attach_secondary(name);
  		if (!eth_dev) {
  			ERROR("Failed to probe %s", name);
Signature · 1 line
2.30.1 (Apple Git-130)