From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ernst.netinsight.se (ernst.netinsight.se [194.16.221.21]) by dpdk.org (Postfix) with SMTP id AAAAA8DB3 for ; Mon, 16 May 2016 11:33:56 +0200 (CEST) Received: from miho (unverified [10.100.1.152]) by ernst.netinsight.se (EMWAC SMTPRS 0.83) with SMTP id ; Mon, 16 May 2016 11:34:12 +0200 Date: Mon, 16 May 2016 11:33:49 +0200 From: Simon Kagstrom To: dev@dpdk.org, thomas.monjalon@6wind.com, reshma.pattan@intel.com Message-ID: <20160516113349.7d2a992f@miho> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.27; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] [PATCH / RFC ] ethdev: Allow rte_eth_dev_configure with zero RX/TX queues 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: Mon, 16 May 2016 09:33:56 -0000 This allows releasing RX/TX queue memory. --- We're using DPDK 16.04 and have a test suite which performs a sequence of separate tests of the type allocate mempool rte_eth_dev_configure(port, n_rxq, n_txq, ...) setup rx/tx queues rte_eth_dev_start(port) stop rx/tx queues rte_eth_dev_stop(port) -> rte_eth_dev_configure(port, 0, 0, ...) check that there are no leaks from the mempool The crucial point is the marked line above. This is done so that the rx_queue_release/tx_queue_release callbacks in the PMD is called, so that mbufs allocated by the driver is released. Without this patch, this explicitly isn't allowed. Is there a particular reason why it shouldn't? It was introduced in d505ba80a165a9735f3d9d3c6ab68a7bd85f271b "ethdev: support unidirectional configuration" lib/librte_ether/rte_ethdev.c | 5 ----- 1 file changed, 5 deletions(-) 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; - } - if (nb_rx_q > dev_info.max_rx_queues) { RTE_PMD_DEBUG_TRACE("ethdev port_id=%d nb_rx_queues=%d > %d\n", port_id, nb_rx_q, dev_info.max_rx_queues); -- 1.9.1