summaryrefslogtreecommitdiffstats
path: root/lib/librte_ether
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2018-08-29 18:59:44 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2018-08-29 19:00:12 +0100
commit8e6d9d118f6105a3627b64a7949e1fb0b145879e (patch)
tree6494692bc19c7dd9cae2b16cf6e0ed7e90aa1da8 /lib/librte_ether
parent43192222b329b3c984687235b0081c7fbfe484ba (diff)
New upstream version 16.11.8upstream/16.11.8
Change-Id: I3d0a7da377a86fe41f3516c5a3c458746abc33fb Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'lib/librte_ether')
-rw-r--r--lib/librte_ether/rte_ethdev.c10
-rw-r--r--lib/librte_ether/rte_ethdev.h5
2 files changed, 12 insertions, 3 deletions
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);
}
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index da33b9d5..981e0577 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1742,7 +1742,6 @@ struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
* to that slot for the driver to use.
*
* @param name Unique identifier name for each Ethernet device
- * @param type Device type of this Ethernet device
* @return
* - Slot in the rte_dev_devices array for a new device;
*/
@@ -2325,7 +2324,7 @@ void rte_eth_xstats_reset(uint8_t port_id);
* @param stat_idx
* The per-queue packet statistics functionality number that the transmit
* queue is to be assigned.
- * The value must be in the range [0, RTE_MAX_ETHPORT_QUEUE_STATS_MAPS - 1].
+ * The value must be in the range [0, RTE_ETHDEV_QUEUE_STAT_CNTRS - 1].
* @return
* Zero if successful. Non-zero otherwise.
*/
@@ -2345,7 +2344,7 @@ int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id,
* @param stat_idx
* The per-queue packet statistics functionality number that the receive
* queue is to be assigned.
- * The value must be in the range [0, RTE_MAX_ETHPORT_QUEUE_STATS_MAPS - 1].
+ * The value must be in the range [0, RTE_ETHDEV_QUEUE_STAT_CNTRS - 1].
* @return
* Zero if successful. Non-zero otherwise.
*/