From patchwork Fri Apr 13 18:30:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnon Warshavsky X-Patchwork-Id: 38085 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5D19F8E79; Fri, 13 Apr 2018 20:31:17 +0200 (CEST) Received: from mta.qwilt.com (mta.qwilt.com [52.9.191.255]) by dpdk.org (Postfix) with ESMTP id 16AAC324B for ; Fri, 13 Apr 2018 20:31:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mta.qwilt.com (Postfix) with ESMTP id 8698A80B51A; Fri, 13 Apr 2018 18:31:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at qwilt.com Received: from mta.qwilt.com ([127.0.0.1]) by localhost (mta.qwilt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gqcQwPQAPaQo; Fri, 13 Apr 2018 18:31:14 +0000 (UTC) Received: from rd01.it.qwilt.com.qwilt.com (80.179.204.39.cable.012.net.il [80.179.204.39]) by mta.qwilt.com (Postfix) with ESMTPSA id 0155480C258; Fri, 13 Apr 2018 18:31:11 +0000 (UTC) From: Arnon Warshavsky To: thomas@monjalon.net, anatoly.burakov@intel.com, wenzhuo.lu@intel.com, declan.doherty@intel.com, jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com, ferruh.yigit@intel.com Cc: dev@dpdk.org, arnon@qwilt.com Date: Fri, 13 Apr 2018 21:30:40 +0300 Message-Id: <1523644244-17511-10-git-send-email-arnon@qwilt.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1523644244-17511-1-git-send-email-arnon@qwilt.com> References: <1523644244-17511-1-git-send-email-arnon@qwilt.com> Subject: [dpdk-dev] [PATCH v3 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" replace panic calls with log and return value. --- v2: - update doxigen to include new error value - reformat error message to include literal string in a single line Signed-off-by: Arnon Warshavsky --- lib/librte_eal/common/eal_common_memzone.c | 3 ++- lib/librte_eal/common/include/rte_memzone.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_memzone.c b/lib/librte_eal/common/eal_common_memzone.c index 1ab3ade..fe058cc 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", + 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--; diff --git a/lib/librte_eal/common/include/rte_memzone.h b/lib/librte_eal/common/include/rte_memzone.h index 2bfb273..e2b4c7d 100644 --- a/lib/librte_eal/common/include/rte_memzone.h +++ b/lib/librte_eal/common/include/rte_memzone.h @@ -234,6 +234,7 @@ const struct rte_memzone *rte_memzone_reserve_bounded(const char *name, * A pointer to the memzone * @return * -EINVAL - invalid parameter. + * -1 - internal state error * 0 - success */ int rte_memzone_free(const struct rte_memzone *mz);