From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id E6DCC29D6 for ; Tue, 23 Feb 2016 16:58:56 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 23 Feb 2016 07:58:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,489,1449561600"; d="scan'208";a="892780524" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.83]) ([10.237.220.83]) by orsmga001.jf.intel.com with ESMTP; 23 Feb 2016 07:58:52 -0800 To: Bruce Richardson References: <1454087782-15085-1-git-send-email-ferruh.yigit@intel.com> <1455794803-20383-1-git-send-email-ferruh.yigit@intel.com> <1455794803-20383-3-git-send-email-ferruh.yigit@intel.com> <20160223152654.GC17644@bricha3-MOBL3> From: Ferruh Yigit X-Enigmail-Draft-Status: N1110 Message-ID: <56CC81BA.10303@intel.com> Date: Tue, 23 Feb 2016 15:58:50 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160223152654.GC17644@bricha3-MOBL3> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, =?UTF-8?Q?Nicol=c3=a1s_Pernas_Maradei?= Subject: Re: [dpdk-dev] [PATCH v2 2/3] ring: remove duplicate fields in internal data struct 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: Tue, 23 Feb 2016 15:58:57 -0000 On 2/23/2016 3:26 PM, Bruce Richardson wrote: > On Thu, Feb 18, 2016 at 11:26:42AM +0000, Ferruh Yigit wrote: >> 1- Remove duplicate nb_rx/tx_queues fields from internals >> >> Signed-off-by: Ferruh Yigit >> --- >> drivers/net/ring/rte_eth_ring.c | 57 ++++++++++++++++++----------------------- >> 1 file changed, 25 insertions(+), 32 deletions(-) >> >> diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c >> index d92b088..fd87999 100644 >> --- a/drivers/net/ring/rte_eth_ring.c >> +++ b/drivers/net/ring/rte_eth_ring.c >> @@ -59,9 +59,6 @@ struct ring_queue { >> }; >> >> struct pmd_internals { >> - unsigned nb_rx_queues; >> - unsigned nb_tx_queues; >> - >> struct ring_queue rx_ring_queues[RTE_PMD_RING_MAX_RX_RINGS]; >> struct ring_queue tx_ring_queues[RTE_PMD_RING_MAX_TX_RINGS]; >> >> @@ -138,7 +135,7 @@ eth_dev_set_link_up(struct rte_eth_dev *dev) >> } >> >> static int >> -eth_rx_queue_setup(struct rte_eth_dev *dev,uint16_t rx_queue_id, >> +eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id, >> uint16_t nb_rx_desc __rte_unused, >> unsigned int socket_id __rte_unused, >> const struct rte_eth_rxconf *rx_conf __rte_unused, >> @@ -165,40 +162,39 @@ static void >> eth_dev_info(struct rte_eth_dev *dev, >> struct rte_eth_dev_info *dev_info) >> { >> - struct pmd_internals *internals = dev->data->dev_private; >> dev_info->driver_name = drivername; >> dev_info->max_mac_addrs = 1; >> dev_info->max_rx_pktlen = (uint32_t)-1; >> - dev_info->max_rx_queues = (uint16_t)internals->nb_rx_queues; >> - dev_info->max_tx_queues = (uint16_t)internals->nb_tx_queues; >> + dev_info->max_rx_queues = dev->data->nb_rx_queues; >> + dev_info->max_tx_queues = dev->data->nb_tx_queues; > > I'm still not convined this is correct. What happens if a ring PMD is created > with 16 queues (i.e. backed by 16 rings), and then the user uses > rte_eth_dev_configure to only actually use 4 queues. Right, since user explicitly set 4 queues. > The fact that the internal > array still has 16 queues will be lost, Not lost exactly, app can re-configure with rte_eth_dev_configure() to use 16 queses back and it will work fine. > and the device will only ever report > 4 as the max number it can support. I think this is same for all PMDs, and data->nb_xx_queues reports the number of the configured queues, not max number; and indeed for ring PMD max queue number is hardcoded in the config file. I guess you what you refer is "number of queues used in first configuration", is there a use case to save this value? And if there is does it make sense to application save it instead of PMD, because for your sample case application creates ring with rte_eth_from_ring() API, so app already knows the initial configured queue number. Thanks, ferruh