patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] ethdev: fix device state on close
@ 2017-08-16 11:43 Shahaf Shuler
  2017-08-16 12:41 ` Gaëtan Rivet
  0 siblings, 1 reply; 6+ messages in thread
From: Shahaf Shuler @ 2017-08-16 11:43 UTC (permalink / raw)
  To: thomas; +Cc: dev, gaetan.rivet, stable

Currently device state moves between ATTACHED when device was
successfully probed to UNUSED when device is detached or released.

The device state following rte_eth_dev_close() operation is inconsist,
The device is still in ATTACHED state, however it cannot be used
in any way till it will be probed again.

Fixing it by changing the state to UNUSED.

Fixes: d52268a8b24b ("ethdev: expose device states")
Cc: gaetan.rivet@6wind.com
Cc: stable@dpdk.org

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 lib/librte_ether/rte_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 0597641ee..98d9e929c 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -992,6 +992,8 @@ rte_eth_dev_close(uint8_t port_id)
 	dev->data->nb_tx_queues = 0;
 	rte_free(dev->data->tx_queues);
 	dev->data->tx_queues = NULL;
+
+	dev->state = RTE_ETH_DEV_UNUSED;
 }
 
 int
-- 
2.12.0

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

end of thread, other threads:[~2017-08-18  9:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-16 11:43 [dpdk-stable] [PATCH] ethdev: fix device state on close Shahaf Shuler
2017-08-16 12:41 ` Gaëtan Rivet
2017-08-16 14:17   ` Shahaf Shuler
2017-08-16 15:26     ` Gaëtan Rivet
2017-08-17  6:04       ` Shahaf Shuler
2017-08-18  9:52         ` Gaëtan Rivet

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