ethdev: fix possibly incorrect maximum queues

In rte_eth_dev_configure(), device configuration was copied to the dev
struct after get_dev_info() was called to get the max queue information.
In some drivers, though, the max queues can vary depending on the device
configuration - but that information is not available to the driver until
the copy is made.

This patch moves the memcpy of the device configuration into the dev->data
structure before the call to get_dev_info(), thereby making it accessible
to drivers to use when reporting their max queues.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
This commit is contained in:
Pablo de Lara 2016-03-24 15:22:03 +00:00 committed by Thomas Monjalon
parent c2b9607052
commit 5db6b738c5

View File

@ -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.