From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 24 Mar 2016 08:21:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,385,1455004800"; d="scan'208";a="930974920" Received: from sie-lab-214-036.ir.intel.com (HELO sie-lab-214-36.ir.intel.com) ([10.237.214.36]) by fmsmga001.fm.intel.com with ESMTP; 24 Mar 2016 08:21:56 -0700 From: Pablo de Lara To: dev@dpdk.org Cc: wenzhuo.lu@intel.com, bruce.richardson@intel.com, Pablo de Lara Date: Thu, 24 Mar 2016 15:22:03 +0000 Message-Id: <1458832924-1489-3-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1458832924-1489-1-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> Subject: [dpdk-dev] [PATCH v4 2/3] ethdev: copy device configuration earlier 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: Thu, 24 Mar 2016 15:21:58 -0000 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