patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/failsafe: fix tx sub device deactivating
@ 2017-08-15  6:59 Matan Azrad
  2017-08-16  8:46 ` Gaëtan Rivet
  0 siblings, 1 reply; 8+ messages in thread
From: Matan Azrad @ 2017-08-15  6:59 UTC (permalink / raw)
  To: Gaetan Rivet; +Cc: dev, stable

The corrupted code couldn't recognize that all sub devices
were not ready for tx traffic when failsafe PMD was trying
to switch device because of an unreachable condition using.

Hence, the current tx sub device variable was not updated
correctly.

The fix removed the unreachable condition and adds condition
in the right place to handle non tx device ready scenario.

Fixes: ebea83f899d8 ("net/failsafe: add plug-in support")
Fixes: 598fb8aec6f6 ("net/failsafe: support device removal")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Cc: stable@dpdk.org
---
 drivers/net/failsafe/failsafe_private.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Hi Gaetan
I didn't find any real scenario which cause to problematic
behavior because of the previous code.
But it may be.    

diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h
index 0361cf4..dc97aec 100644
--- a/drivers/net/failsafe/failsafe_private.h
+++ b/drivers/net/failsafe/failsafe_private.h
@@ -346,9 +346,10 @@ fs_switch_dev(struct rte_eth_dev *dev,
 			PRIV(dev)->subs_tx = i;
 			break;
 		}
-	} else if (txd && txd->state < req_state) {
-		DEBUG("No device ready, deactivating tx_dev");
-		PRIV(dev)->subs_tx = PRIV(dev)->subs_tail;
+		if (i >= PRIV(dev)->subs_tail || !sdev) {
+			DEBUG("No device ready, deactivating tx_dev");
+			PRIV(dev)->subs_tx = PRIV(dev)->subs_tail;
+		}
 	} else {
 		return;
 	}
-- 
2.7.4

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

end of thread, other threads:[~2017-08-21 12:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-15  6:59 [dpdk-stable] [PATCH] net/failsafe: fix tx sub device deactivating Matan Azrad
2017-08-16  8:46 ` Gaëtan Rivet
2017-08-16  9:02   ` Matan Azrad
2017-08-16 12:51     ` Gaëtan Rivet
2017-08-16 14:19       ` [dpdk-stable] [PATCH v2] " Matan Azrad
2017-08-16 14:39         ` Gaëtan Rivet
2017-08-16 14:53           ` Matan Azrad
2017-08-21 12:56         ` Ferruh Yigit

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).