DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: David Marchand <david.marchand@redhat.com>,
	Bruce Richardson <bruce.richardson@intel.com>
Cc: dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/2] lib/metrics: fix to reset the init flag
Date: Tue, 19 May 2020 09:50:41 +0000	[thread overview]
Message-ID: <DB7PR04MB4459A1C3EA37862E3501F73D89B90@DB7PR04MB4459.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <CAJFAV8yQZygDqTnLv+ocON1mdqPnxeaZv7J7zjfYcJp=rw_Pcg@mail.gmail.com>


> On Wed, May 13, 2020 at 12:39 PM Hemant Agrawal
> <hemant.agrawal@nxp.com> wrote:
> >
> > metrics_initialized shall be reset in deinit function This is
> > currently causing issue in running metrics_autotest mulutiple times
> >
> > Fixes: 07c1b6925b65 ("telemetry: invert dependency on metrics
> > library")
> >
> > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> > ---
> >  lib/librte_metrics/rte_metrics.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/lib/librte_metrics/rte_metrics.c
> > b/lib/librte_metrics/rte_metrics.c
> > index e07670219..f570cf226 100644
> > --- a/lib/librte_metrics/rte_metrics.c
> > +++ b/lib/librte_metrics/rte_metrics.c
> > @@ -96,6 +96,8 @@ rte_metrics_deinit(void)
> >         stats = memzone->addr;
> >         memset(stats, 0, sizeof(struct rte_metrics_data_s));
> >
> > +       metrics_initialized = 0;
> > +
> >         return rte_memzone_free(memzone);
> 
> Should this flag be reset only if rte_memzone_free succeeds?
> 
[Hemant]  I thought about it but I did not do it for following reasons.
1. If the memzone is not freed,  It will not be initialized next time due to following check in init routine.
 	memzone = rte_memzone_lookup(RTE_METRICS_MEMZONE_NAME);
	if (memzone != NULL)
		return;
2. Most applications have very weak error handling in de-init/cleanup parts. 

Having said that. It can be changed to do it only on the success of rte_memzone_free
> 
> --
> David Marchand


  reply	other threads:[~2020-05-19  9:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 10:36 Hemant Agrawal
2020-05-13 10:36 ` [dpdk-dev] [PATCH 2/2] test: support cleanup in bitrate and latency test Hemant Agrawal
2020-05-19  9:31 ` [dpdk-dev] [PATCH 1/2] lib/metrics: fix to reset the init flag David Marchand
2020-05-19  9:50   ` Hemant Agrawal [this message]
2020-05-19 10:52 ` [dpdk-dev] [PATCH v2 " Hemant Agrawal
2020-05-19 10:52   ` [dpdk-dev] [PATCH v2 2/2] test: support cleanup in bitrate and latency test Hemant Agrawal
2020-05-19 15:24     ` Stephen Hemminger
2020-05-19 12:12   ` [dpdk-dev] [PATCH v2 1/2] lib/metrics: fix to reset the init flag David Marchand
2020-05-19 15:23   ` Stephen Hemminger

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=DB7PR04MB4459A1C3EA37862E3501F73D89B90@DB7PR04MB4459.eurprd04.prod.outlook.com \
    --to=hemant.agrawal@nxp.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    /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).