Since some vdevs like virtio and vhost do not support rxq_info_get and
queue state inquiry, the error return value -ENOTSUP need to be ignored
when queue_stopped cannot get rx queue information and rx queue state.
This patch changes the return value of queue_stopped when
rte_eth_rx_queue_info_get return -ENOTSUP to support vdevs which cannot
provide rx queue information and rx queue state enable power management.
Fixes: 209fd585456c ("power: make ethdev power management thread unsafe")
Cc: stable@dpdk.org
Signed-off-by: Miao Li <miao.li@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
{
struct rte_eth_rxq_info qinfo;
- if (rte_eth_rx_queue_info_get(port_id, queue_id, &qinfo) < 0)
- return -1;
+ int ret = rte_eth_rx_queue_info_get(port_id, queue_id, &qinfo);
+ if (ret < 0) {
+ if (ret == -ENOTSUP)
+ return 1;
+ else
+ return -1;
+ }
return qinfo.queue_state == RTE_ETH_QUEUE_STATE_STOPPED;
}