From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 48F547E89 for ; Mon, 20 Oct 2014 19:19:44 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 20 Oct 2014 10:27:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,757,1406617200"; d="scan'208";a="617361039" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 20 Oct 2014 10:26:37 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s9KHQZHR005698 for ; Mon, 20 Oct 2014 18:26:35 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id s9KHQZrI004546 for ; Mon, 20 Oct 2014 18:26:35 +0100 Received: (from pdelarax@localhost) by sivswdev02.ir.intel.com with id s9KHQZbQ004542 for dev@dpdk.org; Mon, 20 Oct 2014 18:26:35 +0100 From: Pablo de Lara To: dev@dpdk.org Date: Mon, 20 Oct 2014 18:26:35 +0100 Message-Id: <1413825995-4509-1-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] ethdev: Fixed memory corruption in rte_eth_rx_queue_setup and rte_eth_tx_queue_setup X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2014 17:19:44 -0000 Commit fbde27f1 (ethdev: 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 --- lib/librte_ether/rte_ethdev.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 1659340..6a8b363 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; -- 1.7.4.1