From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id 683C91B7B4 for ; Wed, 4 Apr 2018 14:34:46 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id DEE8520A74; Wed, 4 Apr 2018 08:34:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 04 Apr 2018 08:34:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=IKVUe3Ms5skZ0JaFu+kd0/hL7Z ICIlcYQPvy287Hn0c=; b=qE8+hwJjWuBcQWYXSPrsP0/Yhm3lkdUEGGMWTZqlti 3VfRCsrT3DeuQ2kF1wG/9XODV9bXinH+L5NufyBfUsalfnZvErdLjSSM9Rwbwb4b 0mWZISuyQsoz4mDV88tkWPNVsDnf9/Ox3NzKxkUFfYy034TXy+yiADJYX2ihXaVf 0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=IKVUe3 Ms5skZ0JaFu+kd0/hL7ZICIlcYQPvy287Hn0c=; b=PVwsLQeA1heSgxTjuwvgk0 YOLWIFgf3N8fg11XhJs96VW8VgjKqQJJ2aMYJ1aiRzasjSmk/kwDmfwt74hArJ/S dHjGd5qcU1P4CzEgQ4n+Gl0tCu7n1swvxwusOqkdUxUMRR7ldx5heEUqm2/L4jte QAw91tWXIwxaIEPCO38k6kCnOrB4RXYJ1v4+CebZLAwiF3f3jgLizH4fUZapiI36 +OVGMaEqz0AgCloYoeyhcHaJsXZ6q+18PMdDDHo92wlXrdG8X/lkFpnKf8Ohgy7U rrNgcus/XH5FetArySaMBdBKX3tQ8yWgoq+/zsNklo+JfKSNOxGYdkqwLNUHkwFg == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id D1A09E4925; Wed, 4 Apr 2018 08:34:44 -0400 (EDT) From: Thomas Monjalon To: "Burakov, Anatoly" , Arnon Warshavsky Cc: wenzhuo.lu@intel.com, declan.doherty@intel.com, jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com, ferruh.yigit@intel.com, dev@dpdk.org Date: Wed, 04 Apr 2018 14:34:43 +0200 Message-ID: <2076505.4ZOuXatVQe@xps> In-Reply-To: References: <1522841257-11826-1-git-send-email-arnon@qwilt.com> <1522841257-11826-10-git-send-email-arnon@qwilt.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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:34:46 -0000 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 > > --- > > 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.