From: Pablo de Lara Date: Mon, 20 Oct 2014 17:26:35 +0000 (+0100) Subject: ethdev: fix memory corruption with default Rx/Tx configuration X-Git-Tag: spdx-start~10267 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=06cada9fc6f0de50c10a27d55615299d1ac906e0;p=dpdk.git ethdev: fix memory corruption with default Rx/Tx configuration Commit fbde27f1 (get default Rx/Tx configuration from dev info), introduced a bug, which caused memory corruption in dev_info. To get RX/TX configuration, both rx/tx queue setup functions were calling dev_info_get from PMDs, so dev_info structure was not being reseted before being populated. Signed-off-by: Pablo de Lara Acked-by: Thomas Monjalon --- diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 1659340943..6a8b363835 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -999,7 +999,7 @@ rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, * This value must be provided in the private data of the memory pool. * First check that the memory pool has a valid private data. */ - (*dev->dev_ops->dev_infos_get)(dev, &dev_info); + rte_eth_dev_info_get(port_id, &dev_info); if (mp->private_data_size < sizeof(struct rte_pktmbuf_pool_private)) { PMD_DEBUG_TRACE("%s private_data_size %d < %d\n", mp->name, (int) mp->private_data_size, @@ -1067,7 +1067,7 @@ rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP); FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_queue_setup, -ENOTSUP); - (*dev->dev_ops->dev_infos_get)(dev, &dev_info); + rte_eth_dev_info_get(port_id, &dev_info); if (tx_conf == NULL) tx_conf = &dev_info.default_txconf;