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 6CC9E7CE1 for ; Fri, 27 Apr 2018 21:24:22 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 02DE520DBC; Fri, 27 Apr 2018 15:24:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 27 Apr 2018 15:24:22 -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=SKypxuojDngpul5ujChs2PO1zj whesboj7J8Rx6wFXE=; b=lh33PVdoqtE9TDltvxxQxa6DGYawKBFVVUAqVRmZsh 7JZKBo/eQS/zZ9I5+yzAL9Ql5/VFyXWiEljgkZ1pZ9nf/szGxtjO0x8IaITniZ2w +IlLs9WzugBzn4/WpQ+REJ8sRVmqKqd34mUr7JkkSYpEwqqw8noSDa0Rc0ABYasm A= 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=SKypxu ojDngpul5ujChs2PO1zjwhesboj7J8Rx6wFXE=; b=kBpu3zj61ipNdfHRDDedg5 HnKvDt0NOuts+cEVQpM1qVyFm2yI0/CBfQKOWEli82mUtPYQLV78QOKv53LX7IGA p5l/ABLVoCD0v+8T0+W2e6tphqp11J0KSG7SxxCbEB/yh+Ug54ZWLS/QS01hY8QD lidbsxqlO1pVxIAmdymPYqY+HuPy+so447w/FRtkfhx6pKWrltKsW4HtjevfXO7c Xh0Ot0nDGnSVA8xg43lCDBNdSpzSAbwRuKO/cnq4GxrkSSfQ0Qjyz/qkzhPPitCF /fpWm+gOGPfdyXlXO/RQ2HOPxE+HVdoP0GqhjinNOz2zZ/s2di5hzUc78x8hdJrw == 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 2856CE4F05; Fri, 27 Apr 2018 15:24:21 -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:24:19 +0200 Message-ID: <2860578.1zL41RiOr7@xps> In-Reply-To: <8268731.ksAW2z75G4@xps> References: <20180427162556.22781-1-shreyansh.jain@nxp.com> <20180427172058.26850-3-shreyansh.jain@nxp.com> <8268731.ksAW2z75G4@xps> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2 2/3] bus/fslmc: 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:24:22 -0000 27/04/2018 20:49, Thomas Monjalon: > 27/04/2018 19:20, Shreyansh Jain: > > --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h > > +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h > > @@ -254,15 +254,38 @@ enum qbman_fd_format { > > */ > > #define DPAA2_EQ_RESP_ALWAYS 1 > > > > +/* Various structures representing contiguous memory maps */ > > +struct dpaa2_memseg { > > + TAILQ_ENTRY(dpaa2_memseg) next; > > + char *vaddr; > > + rte_iova_t iova; > > + size_t len; > > +}; > > + > > +TAILQ_HEAD(dpaa2_memseg_list, dpaa2_memseg); > > +extern struct dpaa2_memseg_list dpaa2_memsegs; > > Shared compilation is broken without following patch: > > --- a/drivers/bus/fslmc/rte_bus_fslmc_version.map > +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map > @@ -105,5 +105,6 @@ DPDK_18.05 { > global: > > dpaa2_affine_qbman_ethrx_swp; > + dpaa2_memsegs; > > } DPDK_18.02; Right fix is: --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -263,7 +263,7 @@ struct dpaa2_memseg { }; TAILQ_HEAD(dpaa2_memseg_list, dpaa2_memseg); -extern struct dpaa2_memseg_list dpaa2_memsegs; +extern struct dpaa2_memseg_list rte_dpaa2_memsegs; #ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA extern uint8_t dpaa2_virt_mode; @@ -279,10 +279,10 @@ static void *dpaa2_mem_ptov(phys_addr_t paddr) /* Check if the address is already part of the memseg list internally * maintained by the dpaa2 driver. */ - TAILQ_FOREACH(ms, &dpaa2_memsegs, next) { + TAILQ_FOREACH(ms, &rte_dpaa2_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/event/dpaa2/Makefile +++ b/drivers/event/dpaa2/Makefile @@ -18,7 +18,8 @@ CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/portal CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa2 CFLAGS += -I$(RTE_SDK)/drivers/event/dpaa2 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal -LDLIBS += -lrte_eal -lrte_eventdev -lrte_bus_fslmc -lrte_pmd_dpaa2 +LDLIBS += -lrte_eal -lrte_eventdev +LDLIBS += -lrte_bus_fslmc -lrte_mempool_dpaa2 -lrte_pmd_dpaa2 LDLIBS += -lrte_bus_vdev CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2 CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2/mc --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c @@ -36,8 +36,8 @@ static struct dpaa2_bp_list *h_bp_list; * is to optimize the PA_to_VA searches until a better mechanism (algo) is * available. */ -struct dpaa2_memseg_list dpaa2_memsegs - = TAILQ_HEAD_INITIALIZER(dpaa2_memsegs); +struct dpaa2_memseg_list rte_dpaa2_memsegs + = TAILQ_HEAD_INITIALIZER(rte_dpaa2_memsegs); /* Dynamic logging identified for mempool */ int dpaa2_logtype_mempool; @@ -394,7 +394,7 @@ dpaa2_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(&dpaa2_memsegs, ms, next); + TAILQ_INSERT_HEAD(&rte_dpaa2_memsegs, ms, next); return rte_mempool_op_populate_default(mp, max_objs, vaddr, paddr, len, obj_cb, obj_cb_arg); --- a/drivers/mempool/dpaa2/rte_mempool_dpaa2_version.map +++ b/drivers/mempool/dpaa2/rte_mempool_dpaa2_version.map @@ -3,6 +3,7 @@ DPDK_17.05 { rte_dpaa2_bpid_info; rte_dpaa2_mbuf_alloc_bulk; + rte_dpaa2_memsegs; local: *; };