X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=lib%2Flibrte_ether%2Frte_ethdev.c;h=9b28e95aeddae9c3b48a356e036d111b5e838ec8;hb=refs%2Ftags%2Fupstream%2F16.11.8;hp=a698fc00aa38ddc1bf2346b21f12e0fea274f680;hpb=43192222b329b3c984687235b0081c7fbfe484ba;p=deb_dpdk.git diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index a698fc00..9b28e95a 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -1598,6 +1598,16 @@ set_queue_stats_mapping(uint8_t port_id, uint16_t queue_id, uint8_t stat_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->queue_stats_mapping_set, -ENOTSUP); + + if (is_rx && (queue_id >= dev->data->nb_rx_queues)) + return -EINVAL; + + if (!is_rx && (queue_id >= dev->data->nb_tx_queues)) + return -EINVAL; + + if (stat_idx >= RTE_ETHDEV_QUEUE_STAT_CNTRS) + return -EINVAL; + return (*dev->dev_ops->queue_stats_mapping_set) (dev, queue_id, stat_idx, is_rx); }