DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Carrillo, Erik G" <erik.g.carrillo@intel.com>
To: "Burakov, Anatoly" <anatoly.burakov@intel.com>,
	"rsanford@akamai.com" <rsanford@akamai.com>,
	"thomas@monjalon.net" <thomas@monjalon.net>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] timer: allow first subsystem init from secondary
Date: Thu, 9 May 2019 19:47:43 +0000	[thread overview]
Message-ID: <BE54F058557D9A4FAC1D84E2FC6D875723407A55@fmsmsx115.amr.corp.intel.com> (raw)
Message-ID: <20190509194743.eHNtaf7pV4pMZFfVoVM4OeSp4Koqs9ER04ox60Zi594@z> (raw)
In-Reply-To: <bc282556-36fa-a11f-9083-704acdcf7cf0@intel.com>

<...snipped...>

> >
> > @@ -155,40 +156,41 @@ rte_timer_subsystem_init_v1905(void)
> >   	struct rte_timer_data *data;
> >   	int i, lcore_id;
> >   	static const char *mz_name = "rte_timer_mz";
> > +	const size_t data_arr_size =
> > +				RTE_MAX_DATA_ELS *
> sizeof(*rte_timer_data_arr);
> > +	bool do_full_init;
> >
> >   	if (rte_timer_subsystem_initialized)
> >   		return -EALREADY;
> >
> > -	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
> > -		mz = rte_memzone_lookup(mz_name);
> > -		if (mz == NULL)
> > -			return -EEXIST;
> > +lookup:
> > +	mz = rte_memzone_lookup(mz_name);
> 
> Wouldn't it be better to attempt to reserve outright, and then do a lookup on
> EEXIST?

It's probably the expected order;  I've made the change and submitted v2.

Thanks for the review,
Erik

> 
> > +	if (mz == NULL) {
> > +		mz = rte_memzone_reserve_aligned(mz_name,
> data_arr_size,
> > +				SOCKET_ID_ANY, 0, RTE_CACHE_LINE_SIZE);
> > +		if (mz == NULL) {
> > +			if (rte_errno == EEXIST)
> > +				goto lookup;
> >
> 
> 
> --
> Thanks,
> Anatoly

  parent reply	other threads:[~2019-05-09 19:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-08 22:17 Erik Gabriel Carrillo
2019-05-08 22:17 ` Erik Gabriel Carrillo
2019-05-09 11:44 ` Burakov, Anatoly
2019-05-09 11:44   ` Burakov, Anatoly
2019-05-09 19:47   ` Carrillo, Erik G [this message]
2019-05-09 19:47     ` Carrillo, Erik G
2019-05-09 19:39 ` [dpdk-dev] [PATCH v2] " Erik Gabriel Carrillo
2019-05-09 19:39   ` Erik Gabriel Carrillo
2019-05-09 19:51   ` Thomas Monjalon
2019-05-09 19:51     ` Thomas Monjalon
2019-05-09 20:08     ` Carrillo, Erik G
2019-05-09 20:12       ` Thomas Monjalon
2019-05-09 20:12         ` Thomas Monjalon
2019-05-09 21:19         ` Carrillo, Erik G
2019-05-09 21:19           ` Carrillo, Erik G
2019-05-09 22:07           ` Thomas Monjalon
2019-05-09 22:07             ` 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=BE54F058557D9A4FAC1D84E2FC6D875723407A55@fmsmsx115.amr.corp.intel.com \
    --to=erik.g.carrillo@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=rsanford@akamai.com \
    --cc=thomas@monjalon.net \
    /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).