DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: "Burakov, Anatoly" <anatoly.burakov@intel.com>,
	Arnon Warshavsky <arnon@qwilt.com>
Cc: wenzhuo.lu@intel.com, declan.doherty@intel.com,
	jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com,
	ferruh.yigit@intel.com, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 09/13] eal: replace rte_panic instances in common_memzone
Date: Wed, 04 Apr 2018 14:34:43 +0200	[thread overview]
Message-ID: <2076505.4ZOuXatVQe@xps> (raw)
In-Reply-To: <a9f15af7-1661-2c93-b178-0f793e9ed976@intel.com>

04/04/2018 14:09, Burakov, Anatoly:
> On 04-Apr-18 12:27 PM, Arnon Warshavsky wrote:
> > replace panic calls with log and retrun value.
> > 
> > Signed-off-by: Arnon Warshavsky <arnon@qwilt.com>
> > ---
> >   lib/librte_eal/common/eal_common_memzone.c | 5 +++--
> >   1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/lib/librte_eal/common/eal_common_memzone.c b/lib/librte_eal/common/eal_common_memzone.c
> > index 1ab3ade..fa0a407 100644
> > --- a/lib/librte_eal/common/eal_common_memzone.c
> > +++ b/lib/librte_eal/common/eal_common_memzone.c
> > @@ -314,8 +314,9 @@
> >   	if (addr == NULL)
> >   		ret = -EINVAL;
> >   	else if (mcfg->memzone_cnt == 0) {
> > -		rte_panic("%s(): memzone address not NULL but memzone_cnt is 0!\n",
> > -				__func__);
> > +		RTE_LOG(CRIT, EAL, "%s(): memzone address not NULL but memzone_cnt"
> > +				" is 0!\n", __func__);
> > +		return -1;
> >   	} else {
> >   		memset(&mcfg->memzone[idx], 0, sizeof(mcfg->memzone[idx]));
> >   		mcfg->memzone_cnt--;
> > 
> 
> This changes public API. For now, memzone docs mention either return 
> value of 0, or return value of -EINVAL in case of invalid arguments:
> 
> /**
>   * Free a memzone.
>   *
>   * @param mz
>   *   A pointer to the memzone
>   * @return
>   *  -EINVAL - invalid parameter.
>   *  0 - success
>   */
> 
> I'm not sure returning -EINVAL is suitable in this case (the parameter 
> was valid, but an internal error happened - I can't think of any 
> suitable errno value off hand), and adding a new return value changes 
> API, which presumably would require a deprecation notice.
> 
> Thomas?

It does not fully change the API, since the success value is not changed.
I think we can accept one more error value if doxygen is properly updated.

  reply	other threads:[~2018-04-04 12:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-04 11:27 [dpdk-dev] eal: replace calls to rte_panic and refrain from new instances Arnon Warshavsky
2018-04-04 11:27 ` [dpdk-dev] [PATCH 01/13] crypto: replace rte_panic instances in crypto driver Arnon Warshavsky
2018-04-04 13:10   ` Bruce Richardson
2018-04-04 20:43     ` Arnon Warshavsky
2018-04-04 11:27 ` [dpdk-dev] [PATCH 02/13] bond: replace rte_panic instances in bonding driver Arnon Warshavsky
2018-04-04 11:27 ` [dpdk-dev] [PATCH 03/13] e1000: replace rte_panic instances in e1000 driver Arnon Warshavsky
2018-04-04 11:27 ` [dpdk-dev] [PATCH 04/13] ixgbe: replace rte_panic instances in ixgbe driver Arnon Warshavsky
2018-04-04 11:27 ` [dpdk-dev] [PATCH 05/13] eal: replace rte_panic instances in eventdev Arnon Warshavsky
2018-04-04 11:27 ` [dpdk-dev] [PATCH 06/13] kni: replace rte_panic instances in kni Arnon Warshavsky
2018-04-04 11:27 ` [dpdk-dev] [PATCH 07/13] eal: replace rte_panic instances in rte_malloc Arnon Warshavsky
2018-04-04 11:56   ` Burakov, Anatoly
2018-04-04 11:27 ` [dpdk-dev] [PATCH 08/13] eal: replace rte_panic instances in hugepage_info Arnon Warshavsky
2018-04-04 11:57   ` Burakov, Anatoly
2018-04-04 11:27 ` [dpdk-dev] [PATCH 09/13] eal: replace rte_panic instances in common_memzone Arnon Warshavsky
2018-04-04 12:09   ` Burakov, Anatoly
2018-04-04 12:34     ` Thomas Monjalon [this message]
2018-04-04 20:44       ` Arnon Warshavsky
2018-04-04 11:27 ` [dpdk-dev] [PATCH 10/13] eal: replace rte_panic instances in interrupts thread Arnon Warshavsky
2018-04-04 11:27 ` [dpdk-dev] [PATCH 11/13] eal: replace rte_panic instances in ethdev Arnon Warshavsky
2018-04-04 11:27 ` [dpdk-dev] [PATCH 12/13] eal: replace rte_panic instances in init sequence Arnon Warshavsky
2018-04-04 11:27 ` [dpdk-dev] [PATCH 13/13] devtools: prevent new instances of rte_panic and rte_exit Arnon Warshavsky

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=2076505.4ZOuXatVQe@xps \
    --to=thomas@monjalon.net \
    --cc=anatoly.burakov@intel.com \
    --cc=arnon@qwilt.com \
    --cc=bruce.richardson@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=wenzhuo.lu@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).