From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f42.google.com (mail-it0-f42.google.com [209.85.214.42]) by dpdk.org (Postfix) with ESMTP id 2D59D1C892 for ; Wed, 4 Apr 2018 22:44:13 +0200 (CEST) Received: by mail-it0-f42.google.com with SMTP id h143-v6so263368ita.4 for ; Wed, 04 Apr 2018 13:44:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qwilt-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Cwwl81Loxy6TtnqDVQLNJJUO1OLv7UxevC5XFOjbmjM=; b=JuyA5lJZttReIJASdpRmM2SnmPKiaMKWlxe4S7cz9021h/iGKJXDupbnKX4ipEHt6c mHyt1wAnNw0Z69kxyZx+yuqgjqpcEz0wowIichR1iFUwfBFqDhth0HFrOOgElt71oOHf 4Zb+6uW+n2WoBAotBqGMB9vrElNudeTcy2mRAYSsLWB55viLevIFBpR1IxGPHXLsODpE eT8MXB1/MJ3A1CmzxzNtaXVJ8xOB99rzSCGvQ0qoLHdf4DMQ0aK2yXWw3LJqZTv4ppNP NShLfQ3IxDdrz766OcuAAVo3D4HocEnb+AEYPxm9Upg9z7kT3H0vuwXAnIMjohqI2189 4A2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Cwwl81Loxy6TtnqDVQLNJJUO1OLv7UxevC5XFOjbmjM=; b=tGXbz5PUP8F07+pQQumOldM4rrxJq6B26BjnJJ6rnwnoriwJsTVs6DxaFG5sETbtBH YCfySGg+ZOnixdkvH23P4gXqKpcXHZg9MvYy08pPZj1lwZy4TPazQU06l84Ijzyn04PG VDdWxKGv/ES97mNzO6v1XS3A+LZme1vHJe4RwPmcwq2ietosBVb/b+a1c06dFF7CjG/Y sshNz4nim6peHgI1w/IQF2JWFTu226brgqZH8gvr3I6RY1MxKqKFhki1sJecVsNw6WwJ t6oUHK0MhtwyoL3p175AAmvPxpv92SOuixBEL4KhMTZ1R/fUJC5LUra36gMa7GyXLpB+ BUjA== X-Gm-Message-State: ALQs6tCZRFlOHinIi05rDVisyuZdmlD2f5KOUxxLHGRQ61+fGWYFpvX+ 7FvD+HAb+/OuoNcmAPRXb3jm1Cu8U7dwQ2W7MfGAaw== X-Google-Smtp-Source: AIpwx4/npSwoZNAyrBtjsGPwQeFxQkLoNhffQ3PxZ2T4sDVLpHm8T1TKk/58WB0zpuBjWn1rFP0He+6+aOJidc5P3/I= X-Received: by 2002:a24:a38b:: with SMTP id p133-v6mr10755578ite.22.1522874652586; Wed, 04 Apr 2018 13:44:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.142.202 with HTTP; Wed, 4 Apr 2018 13:44:11 -0700 (PDT) In-Reply-To: <2076505.4ZOuXatVQe@xps> References: <1522841257-11826-1-git-send-email-arnon@qwilt.com> <1522841257-11826-10-git-send-email-arnon@qwilt.com> <2076505.4ZOuXatVQe@xps> From: Arnon Warshavsky Date: Wed, 4 Apr 2018 23:44:11 +0300 Message-ID: To: Thomas Monjalon Cc: "Burakov, Anatoly" , wenzhuo.lu@intel.com, declan.doherty@intel.com, jerin.jacob@caviumnetworks.com, Bruce Richardson , ferruh.yigit@intel.com, dev@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 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 20:44:13 -0000 Thanks. Will update the doxigen On Wed, Apr 4, 2018 at 3:34 PM, Thomas Monjalon wrote: > 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. > > > > -- *Arnon Warshavsky* *Qwilt | work: +972-72-2221634 | mobile: +972-50-8583058 | arnon@qwilt.com *