From: "Zhang, Helin" <helin.zhang@intel.com>
To: "Wu, Jingjing" <jingjing.wu@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] i40e: fix the issue of not freeing memzone
Date: Fri, 6 Nov 2015 06:00:25 +0000 [thread overview]
Message-ID: <F35DEAC7BCE34641BA9FAC6BCA4A12E70A936B4D@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <9BB6961774997848B5B42BEC655768F8D239E5@SHSMSX104.ccr.corp.intel.com>
> -----Original Message-----
> From: Wu, Jingjing
> Sent: Friday, November 6, 2015 1:40 PM
> To: Zhang, Helin; dev@dpdk.org
> Subject: RE: [PATCH] i40e: fix the issue of not freeing memzone
>
> > - static uint64_t id = 0;
> > const struct rte_memzone *mz = NULL;
> > char z_name[RTE_MEMZONE_NAMESIZE];
> >
> > if (!mem)
> > return I40E_ERR_PARAM;
> >
> > - id++;
> > - snprintf(z_name, sizeof(z_name), "i40e_dma_%"PRIu64, id);
> > + snprintf(z_name, sizeof(z_name), "i40e_dma_%"PRIu64, rte_rand());
>
> Why change id++ to rte_rand() ?
Don't need to maintain the ID, which may have race condition issue.
Get a random data is good enough. Some other PMDs are using tsc count for the similar purpose.
>
> > #ifdef RTE_LIBRTE_XEN_DOM0
> > mz = rte_memzone_reserve_bounded(z_name, size, SOCKET_ID_ANY, 0,
> > alignment, RTE_PGSIZE_2M);
> > @@ -2929,7 +2927,6 @@
> > i40e_allocate_dma_mem_d(__attribute__((unused)) struct i40e_hw *hw,
> > if (!mz)
> > return I40E_ERR_NO_MEMORY;
> >
> > - mem->id = id;
> > mem->size = size;
> > mem->va = mz->addr;
> > #ifdef RTE_LIBRTE_XEN_DOM0
> > @@ -2937,6 +2934,8 @@
> > i40e_allocate_dma_mem_d(__attribute__((unused)) struct i40e_hw *hw,
> > #else
> > mem->pa = mz->phys_addr;
> > #endif
> > + mem->zone = (const void *)mz;
> > + PMD_DRV_LOG(DEBUG, "memzone allocated: %p", mem->zone);
> >
> Why not print the name of mem_zone instead of pointer?
Good idea to print the name instead, and possible physical address, virtual address, etc.
Regards,
Helin
>
>
> Thanks
> Jingjing
next prev parent reply other threads:[~2015-11-06 6:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-06 3:26 Helin Zhang
2015-11-06 5:39 ` Wu, Jingjing
2015-11-06 6:00 ` Zhang, Helin [this message]
2015-11-06 7:57 ` [dpdk-dev] [PATCH v2] " Helin Zhang
2015-11-06 8:32 ` Wu, Jingjing
2015-11-06 10:19 ` Thomas Monjalon
2015-11-09 1:20 ` Zhang, Helin
2015-11-09 1:20 ` [dpdk-dev] [PATCH v3] " Helin Zhang
2015-11-10 15:53 ` Thomas Monjalon
2015-11-11 5:28 ` [dpdk-dev] [PATCH v4] " Helin Zhang
2015-11-11 18:10 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=F35DEAC7BCE34641BA9FAC6BCA4A12E70A936B4D@SHSMSX104.ccr.corp.intel.com \
--to=helin.zhang@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).