[dpdk-dev,v6,2/3] net/failsafe: fix removal scope

Message ID 1518369872-12324-3-git-send-email-matan@mellanox.com
State Superseded, archived
Headers show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Matan Azrad Feb. 11, 2018, 5:24 p.m.
Fail-safe PMD uses per sub-device flag called "remove" to indicate the
scope where the sub-device was removed physically and its SW resources
should be released.

This flag is set when fail-safe gets RMV notification about the
physical removal of the sub-device and should be unset when all the
sub-device resources is released.

The previous code wrongly unsets the flag in dev_configure() instead of
where all the SW resources release is completed.

Change the remove flag unsetting to be in the end of SW resources
release.

Fixes: a46f8d5 ("net/failsafe: add fail-safe PMD")
Cc: stable@dpdk.org

Signed-off-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/failsafe/failsafe_ether.c | 1 +
 drivers/net/failsafe/failsafe_ops.c   | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/drivers/net/failsafe/failsafe_ether.c b/drivers/net/failsafe/failsafe_ether.c
index 4c6e938..d820faf 100644
--- a/drivers/net/failsafe/failsafe_ether.c
+++ b/drivers/net/failsafe/failsafe_ether.c
@@ -280,6 +280,7 @@ 
 		/* the end */
 		break;
 	}
+	sdev->remove = 0;
 	failsafe_hotplug_alarm_install(sdev->fs_dev);
 }
 
diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index 7a67e16..f0e48c1 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -131,7 +131,6 @@ 
 			dev->data->dev_conf.intr_conf.lsc = 0;
 		}
 		DEBUG("Configuring sub-device %d", i);
-		sdev->remove = 0;
 		ret = rte_eth_dev_configure(PORT_ID(sdev),
 					dev->data->nb_rx_queues,
 					dev->data->nb_tx_queues,