DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] mempool/dpaa2: alloc pool data dynamically
@ 2017-07-13 14:18 Hemant Agrawal
  2017-07-18 14:45 ` Shreyansh Jain
  0 siblings, 1 reply; 3+ messages in thread
From: Hemant Agrawal @ 2017-07-13 14:18 UTC (permalink / raw)
  To: olivier.matz; +Cc: dev, Nipun Gupta

In order to support multiprocess applications, pool data is to be
allocated on dynamic memory instead of existing usages of global
variable.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index d578c2f..ad48709 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -63,6 +63,7 @@ rte_hw_mbuf_create_pool(struct rte_mempool *mp)
 {
 	struct dpaa2_bp_list *bp_list;
 	struct dpaa2_dpbp_dev *avail_dpbp;
+	struct dpaa2_bp_info *bp_info;
 	struct dpbp_attr dpbp_attr;
 	uint32_t bpid;
 	int ret, p_ret;
@@ -127,7 +128,12 @@ rte_hw_mbuf_create_pool(struct rte_mempool *mp)
 	rte_dpaa2_bpid_info[bpid].bp_list = bp_list;
 	rte_dpaa2_bpid_info[bpid].bpid = bpid;
 
-	mp->pool_data = (void *)&rte_dpaa2_bpid_info[bpid];
+	bp_info = rte_malloc(NULL,
+			     sizeof(struct dpaa2_bp_info),
+			     RTE_CACHE_LINE_SIZE);
+	rte_memcpy(bp_info, (void *)&rte_dpaa2_bpid_info[bpid],
+		   sizeof(struct dpaa2_bp_info));
+	mp->pool_data = (void *)bp_info;
 
 	PMD_INIT_LOG(DEBUG, "BP List created for bpid =%d", dpbp_attr.bpid);
 
@@ -169,6 +175,7 @@ rte_hw_mbuf_free_pool(struct rte_mempool *mp)
 		}
 	}
 
+	rte_free(mp->pool_data);
 	dpaa2_free_dpbp_dev(dpbp_node);
 }
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] mempool/dpaa2: alloc pool data dynamically
  2017-07-13 14:18 [dpdk-dev] [PATCH] mempool/dpaa2: alloc pool data dynamically Hemant Agrawal
@ 2017-07-18 14:45 ` Shreyansh Jain
  2017-07-21  6:15   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Shreyansh Jain @ 2017-07-18 14:45 UTC (permalink / raw)
  To: Hemant Agrawal, olivier.matz; +Cc: dev, Nipun Gupta

On Thursday 13 July 2017 07:48 PM, Hemant Agrawal wrote:
> In order to support multiprocess applications, pool data is to be
> allocated on dynamic memory instead of existing usages of global
> variable.
> 
> Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
> ---

Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] mempool/dpaa2: alloc pool data dynamically
  2017-07-18 14:45 ` Shreyansh Jain
@ 2017-07-21  6:15   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2017-07-21  6:15 UTC (permalink / raw)
  To: Hemant Agrawal, Nipun Gupta; +Cc: dev, Shreyansh Jain, olivier.matz

18/07/2017 17:45, Shreyansh Jain:
> On Thursday 13 July 2017 07:48 PM, Hemant Agrawal wrote:
> > In order to support multiprocess applications, pool data is to be
> > allocated on dynamic memory instead of existing usages of global
> > variable.
> > 
> > Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
> 
> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-21  6:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-13 14:18 [dpdk-dev] [PATCH] mempool/dpaa2: alloc pool data dynamically Hemant Agrawal
2017-07-18 14:45 ` Shreyansh Jain
2017-07-21  6:15   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).