ethdev: check queue state before starting or stopping
authorPablo de Lara <pablo.de.lara.guarch@intel.com>
Wed, 16 Sep 2015 21:51:24 +0000 (22:51 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 4 Nov 2015 16:52:14 +0000 (17:52 +0100)
commit6b6861c171823dc5c3f2b3bbabc79e53066efb53
tree1109829b68b0aa53247b56c856b4d735066f5504
parent14c400c2ea92c5b937ecf72a53cb0496c675112c
ethdev: check queue state before starting or stopping

Following the same approach taken with dev_started field
in rte_eth_dev_data structure, this patch adds two new fields
in it, rx_queue_state and tx_queue_state arrays, which track
which queues have been started and which not.

This is important to avoid trying to start/stop twice a queue,
which will result in undefined behaviour
(which may cause RX/TX disruption).

Mind that only the PMDs which have queue_start/stop functions
have been changed to update this field, as the functions will
check the queue state before switching it.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
drivers/net/cxgbe/cxgbe_ethdev.c
drivers/net/enic/enic_ethdev.c
drivers/net/fm10k/fm10k_ethdev.c
drivers/net/i40e/i40e_ethdev_vf.c
drivers/net/i40e/i40e_rxtx.c
drivers/net/ixgbe/ixgbe_rxtx.c
lib/librte_ether/rte_ethdev.c
lib/librte_ether/rte_ethdev.h