From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matan Azrad Subject: [PATCH v5 2/3] net/failsafe: fix removal scope Date: Thu, 8 Feb 2018 16:34:12 +0000 Message-ID: <1518107653-15466-3-git-send-email-matan@mellanox.com> References: <1518092427-4333-1-git-send-email-matan@mellanox.com> <1518107653-15466-1-git-send-email-matan@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain Cc: dev@dpdk.org, stable@dpdk.org To: Gaetan Rivet Return-path: In-Reply-To: <1518107653-15466-1-git-send-email-matan@mellanox.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fail-safe PMD uses per sub-device flag called "remove" to indicate the scope where the sub-device isn't synchronized with the fail-safe state. This flag is set when fail-safe gets RMV notification about the physical removal of the sub-device and should be unset when the sub-device completes all the configurations cause it to arrive to the fail-safe state. The previous code wrongly unsets the flag after calling to the sub-device PMD dev_configure() operation and before all the configurations were done. Change the remove flag unsetting to be only after the sub-device successes to arrive to the fail-safe state. Fixes: a46f8d5 ("net/failsafe: add fail-safe PMD") Cc: stable@dpdk.org Signed-off-by: Matan Azrad --- drivers/net/failsafe/failsafe_ether.c | 2 ++ drivers/net/failsafe/failsafe_ops.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/failsafe/failsafe_ether.c b/drivers/net/failsafe/failsafe_ether.c index 4c6e938..ca42376 100644 --- a/drivers/net/failsafe/failsafe_ether.c +++ b/drivers/net/failsafe/failsafe_ether.c @@ -377,6 +377,8 @@ i); goto err_remove; } + if (PRIV(dev)->state < DEV_STARTED) + sdev->remove = 0; } } /* diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c index 7a67e16..a7c2dba 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, @@ -197,6 +196,7 @@ return ret; } sdev->state = DEV_STARTED; + sdev->remove = 0; } if (PRIV(dev)->state < DEV_STARTED) PRIV(dev)->state = DEV_STARTED; -- 1.8.3.1