From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH v2 3/6] eventdev: implement the northbound APIs Date: Wed, 14 Dec 2016 11:58:37 +0530 Message-ID: <20161214062836.GA21135@localhost.localdomain> References: <1479447902-3700-2-git-send-email-jerin.jacob@caviumnetworks.com> <1480996340-29871-1-git-send-email-jerin.jacob@caviumnetworks.com> <1480996340-29871-4-git-send-email-jerin.jacob@caviumnetworks.com> <20161206171712.GC22224@bricha3-MOBL3.ger.corp.intel.com> <20161207170256.GA4930@svelivela-lt.caveonetworks.com> <20161208095937.GC55440@bricha3-MOBL3.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: , , , , To: Bruce Richardson Return-path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0048.outbound.protection.outlook.com [104.47.42.48]) by dpdk.org (Postfix) with ESMTP id 88F062C4F for ; Wed, 14 Dec 2016 07:29:05 +0100 (CET) Content-Disposition: inline In-Reply-To: <20161208095937.GC55440@bricha3-MOBL3.ger.corp.intel.com> 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 Thu, Dec 08, 2016 at 09:59:37AM +0000, Bruce Richardson wrote: > On Wed, Dec 07, 2016 at 10:32:56PM +0530, Jerin Jacob wrote: > > On Tue, Dec 06, 2016 at 05:17:12PM +0000, Bruce Richardson wrote: > > > On Tue, Dec 06, 2016 at 09:22:17AM +0530, Jerin Jacob wrote: > > > > This patch implements northbound eventdev API interface using > > > > southbond driver interface > > > > > > > > Signed-off-by: Jerin Jacob > > > > --- > > > > + /* Re allocate memory to store queue priority */ > > > > + queues_prio = dev->data->queues_prio; > > > > + queues_prio = rte_realloc(queues_prio, > > > > + sizeof(queues_prio[0]) * nb_queues, > > > > + RTE_CACHE_LINE_SIZE); > > > > + if (queues_prio == NULL) { > > > > + RTE_EDEV_LOG_ERR("failed to realloc queue priority," > > > > + " nb_queues %u", nb_queues); > > > > + return -(ENOMEM); > > > > + } > > > > + dev->data->queues_prio = queues_prio; > > > > + > > > > + if (nb_queues > old_nb_queues) { > > > > + uint8_t new_qs = nb_queues - old_nb_queues; > > > > + > > > > + memset(queues + old_nb_queues, 0, > > > > + sizeof(queues[0]) * new_qs); > > > > + memset(queues_prio + old_nb_queues, 0, > > > > + sizeof(queues_prio[0]) * new_qs); > > > > + } > > > > + } else if (dev->data->queues != NULL && nb_queues == 0) { > > > > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->queue_release, -ENOTSUP); > > > > + > > > > + queues = dev->data->queues; > > > > + for (i = nb_queues; i < old_nb_queues; i++) > > > > + (*dev->dev_ops->queue_release)(queues[i]); > > > > + } > > > > + > > > > + dev->data->nb_queues = nb_queues; > > > > + return 0; > > > > +} > > > > + > > > While the ports array makes sense to have available at the top level of > > > the API and allocated from rte_eventdev.c, I'm not seeing what the value > > > of having the queues allocated at that level is. The only time the queue > > > array is indexed by eventdev layer is when releasing a queue. Therefore, > > > I suggest just saving the number of queues for sanity checking and let > > > the queue array allocation and freeing be handled entirely in the > > > drivers themselves. > > > > I thought it would be useful for other drivers. I agree, If something is not > > common across all the driver lets remove it from common code. > > I will remove it in v3 > > > It's not a big deal for us - just an extra assignment we need to do in > our code path, so if it provides benefit for your driver, leave it in. I We don't use it either. I will remove it in v3 > just found it strange that that array was never really used by the > eventdev APIs, which is why I thought it might be better as internal > only. > > /Bruce