From: Arnon Warshavsky <arnon@qwilt.com>
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
Subject: [dpdk-dev] [PATCH v2 09/13] eal: replace rte_panic instances in common_memzone
Date: Thu, 5 Apr 2018 01:01:33 +0300 [thread overview]
Message-ID: <1522879294-8803-2-git-send-email-arnon@qwilt.com> (raw)
In-Reply-To: <1522879294-8803-1-git-send-email-arnon@qwilt.com>
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 <arnon@qwilt.com>
---
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);
--
1.8.3.1
next prev parent reply other threads:[~2018-04-04 22:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-04 22:01 [dpdk-dev] [PATCH v2 00/13] eal: replace calls to rte_panic and refrain from new instances Arnon Warshavsky
2018-04-04 22:01 ` Arnon Warshavsky [this message]
2018-04-04 22:01 ` [dpdk-dev] [PATCH v2 01/13] crypto: replace rte_panic instances in crypto driver Arnon Warshavsky
2018-04-13 9:16 ` [dpdk-dev] [PATCH v2 00/13] eal: replace calls to rte_panic and refrain from new instances Burakov, Anatoly
2018-04-13 18:21 ` 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=1522879294-8803-2-git-send-email-arnon@qwilt.com \
--to=arnon@qwilt.com \
--cc=anatoly.burakov@intel.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=thomas@monjalon.net \
--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).