From: Ferruh Yigit Subject: Re: [PATCH] net/pcap: set queue started and stopped Date: Wed, 18 Jul 2018 15:25:06 +0100 Message-ID: References: <20180709202159.18726-1-gage.eads@intel.com> <67809c9d-9125-5077-6a6b-44b025fad49b@intel.com> <9184057F7FC11744A2107296B6B8EB1E446EDBE7@FMSMSX108.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: "Eads, Gage" , "dev@dpdk.org" Return-path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id A38EE160 for ; Wed, 18 Jul 2018 16:25:12 +0200 (CEST) In-Reply-To: <9184057F7FC11744A2107296B6B8EB1E446EDBE7@FMSMSX108.amr.corp.intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 7/18/2018 3:17 PM, Eads, Gage wrote: > > >> -----Original Message----- >> From: Yigit, Ferruh >> Sent: Wednesday, July 18, 2018 4:14 AM >> To: Eads, Gage ; dev@dpdk.org >> Subject: Re: [PATCH] net/pcap: set queue started and stopped >> >> On 7/9/2018 9:21 PM, Gage Eads wrote: >>> Set the rx and tx queue state appropriately when the queues or device >>> are started or stopped. >> >> Is there a specific reason to enable these dev_ops, if so can you please >> document in commit log? > > Yes, the purpose of the patch is to enable the rte_eth_dev_{rx, tx}_queue_{start, stop} functions for the PCAP PMD. I'll update the message in v2. I guess that part is clear :) I was asking if there is a higher level reason to enable queue start/stop on these PMDs? Is there some specific usecase not working for you when these are not enabled? > >> >>> >>> Signed-off-by: Gage Eads >>> --- >>> drivers/net/pcap/rte_eth_pcap.c | 42 >>> +++++++++++++++++++++++++++++++++++++++++ >>> 1 file changed, 42 insertions(+) >>> >>> diff --git a/drivers/net/pcap/rte_eth_pcap.c >>> b/drivers/net/pcap/rte_eth_pcap.c index 6bd4a7d79..21e466bcd 100644 >>> --- a/drivers/net/pcap/rte_eth_pcap.c >>> +++ b/drivers/net/pcap/rte_eth_pcap.c >>> @@ -430,6 +430,10 @@ eth_dev_start(struct rte_eth_dev *dev) >>> return -1; >>> rx->pcap = tx->pcap; >>> } >>> + >>> + dev->data->tx_queue_state[0] = >> RTE_ETH_QUEUE_STATE_STARTED; >>> + dev->data->rx_queue_state[0] = >> RTE_ETH_QUEUE_STATE_STARTED; >> >> pcap also supports multiple queue, instead of hardcoding the queue 0 it can be >> possible to iterate through dev->data->nb_rx_queues, dev->data- >>> nb_tx_queues. >> >> And I think it is not good to set this in "internals->single_iface" condition, it is >> better to do these assignments just above "status_up" after all queues >> initialized. >> >>> + >>> goto status_up; >>> } >>> >>> @@ -490,6 +494,8 @@ eth_dev_stop(struct rte_eth_dev *dev) >>> pcap_close(tx->pcap); >>> tx->pcap = NULL; >>> rx->pcap = NULL; >>> + dev->data->tx_queue_state[0] = >> RTE_ETH_QUEUE_STATE_STOPPED; >>> + dev->data->rx_queue_state[0] = >> RTE_ETH_QUEUE_STATE_STOPPED; >> >> same here, just above "status_down" is better place and by using >> dev->data->nb_[r/t]x_queues > > Agreed, I will move the started and stopped assignments as you suggested. >