DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/failsafe: fix reconfiguration
@ 2018-02-11 17:27 Matan Azrad
  2018-02-12 18:42 ` Gaëtan Rivet
  0 siblings, 1 reply; 3+ messages in thread
From: Matan Azrad @ 2018-02-11 17:27 UTC (permalink / raw)
  To: Gaetan Rivet; +Cc: dev, stable

Fail-safe PMD manages the states of its sub-devices gradually:
DEV_UNDEFINED, DEV_PARSED, DEV_PROBED, DEV_ACTIVE, DEV_STARTED.

When the sub-device arguments successfully was parsed, the state is
raised from DEV_UNDEFINED to DEV_PARSED.
When the sub-device successfully was probed, the state is raised from
DEV_PARSED to DEV_PROBED.
When the sub-device successfully was configured by
rte_eth_dev_configure(), the state is raised from DEV_PROBED to
DEV_ACTIVE.
When the sub-device successfully was started by rte_eth_dev_start(), the
state is raised from DEV_ACTIVE to DEV_STARTED.

When the sub-device successfully was stopped by rte_eth_dev_stop(), the
state is degraded from DEV_STARTED to DEV_ACTIVE.
When the sub-device successfully was closed by rte_eth_dev_close(), the
state is degraded from DEV_ACTIVE to DEV_PROBED.
When the sub-device successfully was removed by
rte_eal_hotplug_remove(), the state is degraded from DEV_PROBED to
DEV_UNDEFINED.

Fail-safe dev_configure() operation calls to its sub-devices
dev_configure() operation, but only for sub-devices which are in
DEV_PROBED state, means that sub-devices which are in DEV_ACTIVE state
because the application triggered dev_stop() operation cannot be
reconfigured again by dev_configure() operation which is really
problematic when application wants to reconfigure its ports.
Actually, the application may get success report when some of the
sub-devices are not in the wanted configuration.

The current behavior of fail-safe dev_configure() is correct only for
the first time dev_configure() is triggered by the application or for
sub-device synchronization in plug-in event, but it ignores the option
for reconfiguration from application side.

Allow calling to sub-devices dev_configure() operations also in
DEV_ACTIVE state when the call was triggered by the application.

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

Signed-off-by: Matan Azrad <matan@mellanox.com>
---
Based on previous series, "fix hotplug races".

 drivers/net/failsafe/failsafe_ops.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index fe64c68..057e435 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -110,7 +110,8 @@
 		int lsc_interrupt = 0;
 		int lsc_enabled;
 
-		if (sdev->state != DEV_PROBED)
+		if (sdev->state != DEV_PROBED &&
+		    !(PRIV(dev)->alarm_lock == 0 && sdev->state == DEV_ACTIVE))
 			continue;
 
 		rmv_interrupt = ETH(sdev)->data->dev_flags &
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-13 16:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-11 17:27 [dpdk-dev] [PATCH] net/failsafe: fix reconfiguration Matan Azrad
2018-02-12 18:42 ` Gaëtan Rivet
2018-02-13 16:15   ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).