[dpdk-dev] [PATCH v2 4/4] event/dpaa2: improve the err handling and log msg
Hemant Agrawal
hemant.agrawal at nxp.com
Fri Oct 13 16:52:05 CEST 2017
On 10/12/2017 10:48 PM, Nipun Gupta wrote:
> Signed-off-by: Nipun Gupta <nipun.gupta at nxp.com>
> ---
> drivers/event/dpaa2/dpaa2_eventdev.c | 9 +++++++++
> drivers/event/dpaa2/dpaa2_hw_dpcon.c | 2 +-
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
> index ee3a164..d1be5de 100644
> --- a/drivers/event/dpaa2/dpaa2_eventdev.c
> +++ b/drivers/event/dpaa2/dpaa2_eventdev.c
> @@ -140,11 +140,20 @@
> */
> 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 2c416b5..005e623 100644
> --- a/drivers/event/dpaa2/dpaa2_hw_dpcon.c
> +++ b/drivers/event/dpaa2/dpaa2_hw_dpcon.c
> @@ -100,7 +100,7 @@
>
> 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;
> }
>
Acked-by: Hemant Agrawal <hemant.agrawal at nxp.com>
More information about the dev
mailing list