[dpdk-dev,v4,2/3] ethdev: copy device configuration earlier
Commit Message
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 <pablo.de.lara.guarch@intel.com>
---
lib/librte_ether/rte_ethdev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Comments
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pablo de Lara
> Sent: Thursday, March 24, 2016 3:22 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Subject: [dpdk-dev] [PATCH v4 2/3] ethdev: copy device configuration
> earlier
>
> 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 <pablo.de.lara.guarch@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
@@ -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.