[dpdk-dev] [PATCH / RFC ] ethdev: Allow rte_eth_dev_configure with zero RX/TX queues

Simon Kågström simon.kagstrom at netinsight.net
Mon May 16 12:32:52 CEST 2016


On 2016-05-16 12:24, Pattan, Reshma wrote:
>> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index
>> a31018e..5481d45 100644
>> --- a/lib/librte_ether/rte_ethdev.c
>> +++ b/lib/librte_ether/rte_ethdev.c
>> @@ -944,11 +944,6 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t
>> nb_rx_q, uint16_t nb_tx_q,
>>  	 */
>>  	(*dev->dev_ops->dev_infos_get)(dev, &dev_info);
>>
>> -	if (nb_rx_q == 0 && nb_tx_q == 0) {
>> -		RTE_PMD_DEBUG_TRACE("ethdev port_id=%d both rx and tx
>> queue cannot be 0\n", port_id);
>> -		return -EINVAL;
>> -	}
> 
> This was added to allow devices,  at least with one direction (RX/TX)  supported. As, devices with both directions disabled doesn't make  sense right?

Well, not for running them, no. But this is a part of the shutdown
procedure between tests (I should have been more clear I guess).

As far as I can see in the code, rte_eth_dev_configure() is the only
point which actually calls {rx,tx}_queue_release(), so without this
call, we can't get the memory pool full again.


So basically, our test suite looks like

  rte_eth_dev_configure(port, 32, 32); // For example
  <run a test>
  rte_eth_dev_configure(port, 0, 0);
  Check that the mempool is full again

  rte_eth_dev_configure(port, 32, 32);
  <run another test>
  rte_eth_dev_configure(port, 0, 0);
  Check that the mempool is full again
  ...

And without this fix, the mempool check fails since a few of the buffers
are tied up in the RX descriptor ring of the PMD.

// Simon


More information about the dev mailing list