[dpdk-dev,v3,09/13] eal: replace rte_panic instances in common_memzone
Checks
Commit Message
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(-)
@@ -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--;
@@ -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);