From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id D62348E5F for ; Fri, 27 Apr 2018 21:32:08 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 676D020C89; Fri, 27 Apr 2018 15:32:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 27 Apr 2018 15:32:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=EMw6tyVzbuo+pJhZTxG+/HIg6O Nf5Lbwyl4ybIMO28g=; b=jahD2gnfojheOFPS/L3+fTxov004lf1yHJ2r2Mlt+l SrM7WIx0GA5074ZvpYIGqFxSgKFXa85xF694z4bjWc5zGaDY+VkdX+k/EuzqGEC/ 60L1TCjniylF0sS3AYxX1g+odU1ENIo/ZCjwwaM8LsuZREfANqllDytDJG6TIaNF M= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=EMw6ty Vzbuo+pJhZTxG+/HIg6ONf5Lbwyl4ybIMO28g=; b=mq2P7WSZ7heK7yNt2MNU5b zFoLVCj3kltpmvZ45FUWJiBttXyRxL0Ml5IioGu3jXavpZ2EeQIob9GU+b4eoj76 IgJFYC8jePFKeCfZG9crOu/WhyuORYgJfElglgz/6iAnsmO2jEvEC2UeKGjqzdX1 oH01sY8fJAPBi1ZUS5gqUZutBgM5736FHNu7cPdYx/NWSf19tLg/znoPsh9S+aQM Fy2T6zTeUNRDApqjEyW17lnj77vMZT1Oc9EJTX6DsduVNk34xBiiuTcus+8YQRl4 BN/LO1aCIHj8ky1H7pa8h4nIfPwvMJx9QoW8y8Ap4JZJ4FIwlC1sIYYAWAYV5Pfw == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 7C502E4F05; Fri, 27 Apr 2018 15:32:07 -0400 (EDT) From: Thomas Monjalon To: Shreyansh Jain Cc: dev@dpdk.org, hemant.agrawal@nxp.com, akhil.goyal@nxp.com, anatoly.burakov@intel.com Date: Fri, 27 Apr 2018 21:32:06 +0200 Message-ID: <4285650.f2m7lbzsJD@xps> In-Reply-To: <20180427172058.26850-4-shreyansh.jain@nxp.com> References: <20180427162556.22781-1-shreyansh.jain@nxp.com> <20180427172058.26850-1-shreyansh.jain@nxp.com> <20180427172058.26850-4-shreyansh.jain@nxp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2 3/3] bus/dpaa: optimize physical to virtual address searching X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 19:32:09 -0000 27/04/2018 19:20, Shreyansh Jain: > --- a/drivers/bus/dpaa/rte_dpaa_bus.h > +++ b/drivers/bus/dpaa/rte_dpaa_bus.h > @@ -95,9 +95,34 @@ struct dpaa_portal { > uint64_t tid;/**< Parent Thread id for this portal */ > }; > > -/* TODO - this is costly, need to write a fast coversion routine */ > +/* Various structures representing contiguous memory maps */ > +struct dpaa_memseg { > + TAILQ_ENTRY(dpaa_memseg) next; > + char *vaddr; > + rte_iova_t iova; > + size_t len; > +}; > + > +TAILQ_HEAD(dpaa_memseg_list, dpaa_memseg); > +extern struct dpaa_memseg_list dpaa_memsegs; Same as for DPAA2, fixes are required: --- a/drivers/bus/dpaa/rte_dpaa_bus.h +++ b/drivers/bus/dpaa/rte_dpaa_bus.h @@ -104,7 +104,7 @@ struct dpaa_memseg { }; TAILQ_HEAD(dpaa_memseg_list, dpaa_memseg); -extern struct dpaa_memseg_list dpaa_memsegs; +extern struct dpaa_memseg_list rte_dpaa_memsegs; /* Either iterate over the list of internal memseg references or fallback to * EAL memseg based iova2virt. @@ -116,10 +116,10 @@ static inline void *rte_dpaa_mem_ptov(phys_addr_t paddr) /* Check if the address is already part of the memseg list internally * maintained by the dpaa driver. */ - TAILQ_FOREACH(ms, &dpaa_memsegs, next) { + TAILQ_FOREACH(ms, &rte_dpaa_memsegs, next) { if (paddr >= ms->iova && paddr < ms->iova + ms->len) - return RTE_PTR_ADD(ms->vaddr, (paddr - ms->iova)); + return RTE_PTR_ADD(ms->vaddr, (uintptr_t)(paddr - ms->iova)); } /* If not, Fallback to full memseg list searching */ --- a/drivers/mempool/dpaa/dpaa_mempool.c +++ b/drivers/mempool/dpaa/dpaa_mempool.c @@ -31,8 +31,8 @@ * is to optimize the PA_to_VA searches until a better mechanism (algo) is * available. */ -struct dpaa_memseg_list dpaa_memsegs - = TAILQ_HEAD_INITIALIZER(dpaa_memsegs); +struct dpaa_memseg_list rte_dpaa_memsegs + = TAILQ_HEAD_INITIALIZER(rte_dpaa_memsegs); struct dpaa_bp_info rte_dpaa_bpid_info[DPAA_MAX_BPOOLS]; @@ -318,7 +318,7 @@ dpaa_populate(struct rte_mempool *mp, unsigned int max_objs, /* Head insertions are generally faster than tail insertions as the * buffers pinned are picked from rear end. */ - TAILQ_INSERT_HEAD(&dpaa_memsegs, ms, next); + TAILQ_INSERT_HEAD(&rte_dpaa_memsegs, ms, next); return rte_mempool_op_populate_default(mp, max_objs, vaddr, paddr, len, obj_cb, obj_cb_arg); --- a/drivers/mempool/dpaa/rte_mempool_dpaa_version.map +++ b/drivers/mempool/dpaa/rte_mempool_dpaa_version.map @@ -2,6 +2,7 @@ DPDK_17.11 { global: rte_dpaa_bpid_info; + rte_dpaa_memsegs; local: *; };