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>
return -EINVAL;
}
- if (dev->data->rx_queues[queue_id] == NULL) {
+ if (dev->data->rx_queues == NULL ||
+ dev->data->rx_queues[queue_id] == NULL) {
RTE_ETHDEV_LOG(ERR,
"Rx queue %"PRIu16" of device with port_id=%"
PRIu16" has not been setup\n",
return -EINVAL;
}
- if (dev->data->tx_queues[queue_id] == NULL) {
+ if (dev->data->tx_queues == NULL ||
+ dev->data->tx_queues[queue_id] == NULL) {
RTE_ETHDEV_LOG(ERR,
"Tx queue %"PRIu16" of device with port_id=%"
PRIu16" has not been setup\n",