On 01/15/2018 04:57 AM, Qi Zhang wrote:
According to exist implementation, rte_eth_[rx|tx]_queue_setup will
always return fail if device is already started(rte_eth_dev_start).

This can't satisfied the usage when application want to deferred setup
part of the queues while keep traffic running on those queues already
be setup.

example:
rte_eth_dev_config(nb_rxq = 2, nb_txq =2)
rte_eth_rx_queue_setup(idx = 0 ...)
rte_eth_rx_queue_setup(idx = 0 ...)
rte_eth_dev_start(...) /* [rx|tx]_burst is ready to start on queue 0 */
rte_eth_rx_queue_setup(idx=1 ...) /* fail*/

Basically this is not a general hardware limitation, because for NIC like
i40e, ixgbe, it is not necessary to stop the whole device before configure
a fresh queue or reconfigure an exist queue with traffic on it.

The patch add new eth_dev_ops: [rx|tx]_queue_hot_[setup|release] and
internal logic of rte_eth_[rx|tx]_queue_setup is changed, so application
is allowed to setup queue after device start if the driver is implemented
properly.

I see no point to introduce a new eth_dev_ops. It is possible to simply
allow setup/release operations when the device is started.
If it is desirable to make it controllable and have checks in generic code,
it is possible to have capability bits in dev_info to say that device
supports hot setup/release of Tx/Rx queues.

The typical implementation of [rx|tx]_queue_hot_setup could be:
1. do the same thing in [rx|tx]_queue_setup.
2. perform per queue start logic from [rx|tx]_queue_start.

The typical implementation of [rx|tx]_queue_hot_release could be:
1. perform per queue stop logic from [rx|tx]_queue_stop.
2. do the same thing in [rx|tx]_queue_release.

Signed-off-by: Qi Zhang <qi.z.zh...@intel.com>
---
  lib/librte_ether/rte_ethdev.c | 54 ++++++++++++++++++++++++-------------------
  lib/librte_ether/rte_ethdev.h |  8 +++++++
  2 files changed, 38 insertions(+), 24 deletions(-)

<...>

Reply via email to