ethdev: check if queues are allocated before getting info
authorFerruh Yigit <ferruh.yigit@intel.com>
Thu, 1 Oct 2020 18:14:02 +0000 (19:14 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 8 Oct 2020 17:58:11 +0000 (19:58 +0200)
commit7ae5c75f374c058bd0d74f5f7f50591286bfd925
tree6e04736aef1175be2ccf5a35127ad2b439b55437
parenteffb1d0b9527815a7cd5422bce5defbc0884cea0
ethdev: check if queues are allocated before getting info

A crash is detected when '--txpkts=#' parameter provided to the testpmd,
this is because queue information is requested before queues have been
allocated.

Adding check to queue info APIs
('rte_eth_rx_queue_info_get()' & 'rte_eth_tx_queue_info_get')
to protect against similar cases.

Fixes: ba2fb4f022fc ("ethdev: check if queue setup when getting queue info")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
lib/librte_ethdev/rte_ethdev.c