From: Nipun Gupta Date: Mon, 23 Oct 2017 12:37:06 +0000 (+0530) Subject: event/dpaa2: improve error handling and logs X-Git-Tag: spdx-start~1219 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=49ccbfb6348981b9863ed250804fd350d50ce241;p=dpdk.git event/dpaa2: improve error handling and logs Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index ee3a1644c1..d1be5dec21 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -140,11 +140,20 @@ dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[], */ struct rte_event *ev_temp = rte_malloc(NULL, sizeof(struct rte_event), 0); + + if (!ev_temp) { + if (!loop) + return num_tx; + frames_to_send = loop; + PMD_DRV_LOG(ERR, "Unable to allocate memory"); + goto send_partial; + } rte_memcpy(ev_temp, event, sizeof(struct rte_event)); DPAA2_SET_FD_ADDR((&fd_arr[loop]), ev_temp); DPAA2_SET_FD_LEN((&fd_arr[loop]), sizeof(struct rte_event)); } +send_partial: loop = 0; while (loop < frames_to_send) { loop += qbman_swp_enqueue_multiple_desc(swp, diff --git a/drivers/event/dpaa2/dpaa2_hw_dpcon.c b/drivers/event/dpaa2/dpaa2_hw_dpcon.c index 2c416b5efa..005e6234d1 100644 --- a/drivers/event/dpaa2/dpaa2_hw_dpcon.c +++ b/drivers/event/dpaa2/dpaa2_hw_dpcon.c @@ -100,7 +100,7 @@ rte_dpaa2_create_dpcon_device(int dev_fd __rte_unused, TAILQ_INSERT_TAIL(&dpcon_dev_list, dpcon_node, next); - PMD_DRV_LOG(DEBUG, "DPAA2: Added [dpcon.%d]", dpcon_id); + RTE_LOG(DEBUG, PMD, "DPAA2: Added [dpcon.%d]\n", dpcon_id); return 0; }