From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id A4B391C18C for ; Wed, 4 Apr 2018 14:09:29 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Apr 2018 05:09:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,406,1517904000"; d="scan'208";a="44808600" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.252.51.73]) ([10.252.51.73]) by orsmga001.jf.intel.com with ESMTP; 04 Apr 2018 05:09:26 -0700 To: Arnon Warshavsky , thomas@monjalon.net, wenzhuo.lu@intel.com, declan.doherty@intel.com, jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com, ferruh.yigit@intel.com Cc: dev@dpdk.org References: <1522841257-11826-1-git-send-email-arnon@qwilt.com> <1522841257-11826-10-git-send-email-arnon@qwilt.com> From: "Burakov, Anatoly" Message-ID: Date: Wed, 4 Apr 2018 13:09:25 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1522841257-11826-10-git-send-email-arnon@qwilt.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 09/13] eal: replace rte_panic instances in common_memzone X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Apr 2018 12:09:30 -0000 On 04-Apr-18 12:27 PM, Arnon Warshavsky wrote: > replace panic calls with log and retrun value. > > Signed-off-by: Arnon Warshavsky > --- > 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? -- Thanks, Anatoly