From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pablo de Lara Subject: [PATCH v4 2/3] ethdev: copy device configuration earlier Date: Thu, 24 Mar 2016 15:22:03 +0000 Message-ID: <1458832924-1489-3-git-send-email-pablo.de.lara.guarch@intel.com> References: <1458832675-666-1-git-send-email-pablo.de.lara.guarch@intel.com> <1458832924-1489-1-git-send-email-pablo.de.lara.guarch@intel.com> Cc: wenzhuo.lu@intel.com, bruce.richardson@intel.com, Pablo de Lara To: dev@dpdk.org Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 5217B2C1A for ; Thu, 24 Mar 2016 16:21:58 +0100 (CET) In-Reply-To: <1458832924-1489-1-git-send-email-pablo.de.lara.guarch@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In rte_eth_dev_configure(), device configuration was copied after requesting the device information, to check the maximum number of RX/TX queues. Since this number may change depending on the device configuration, the memcpy of it has to be performed before requesting the device information. Signed-off-by: Pablo de Lara --- lib/librte_ether/rte_ethdev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 8721a6b..b941b0d 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -901,6 +901,9 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, return -EBUSY; } + /* Copy the dev_conf parameter into the dev structure */ + memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data->dev_conf)); + /* * Check that the numbers of RX and TX queues are not greater * than the maximum number of RX and TX queues supported by the @@ -925,9 +928,6 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, return -EINVAL; } - /* Copy the dev_conf parameter into the dev structure */ - memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data->dev_conf)); - /* * If link state interrupt is enabled, check that the * device supports it. -- 2.5.5