X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fraw%2Fdpaa2_cmdif%2Fdpaa2_cmdif.c;h=c7bddbc6cc3068258aaba9b9fa637a966214baff;hb=eb63ec0e56cd519eaaf160041c266de4f13ae413;hp=da3c7d7a643949dd363ba59af2052ebc2ce993ca;hpb=a53f14f96112a0851a9c3788dd1e7b9d61c50191;p=dpdk.git diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c index da3c7d7a64..c7bddbc6cc 100644 --- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c +++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2019 NXP */ #include @@ -20,15 +20,9 @@ #include "dpaa2_cmdif_logs.h" #include "rte_pmd_dpaa2_cmdif.h" -/* Dynamic log type identifier */ -int dpaa2_cmdif_logtype; - /* CMDIF driver name */ #define DPAA2_CMDIF_PMD_NAME dpaa2_dpci -/* CMDIF driver object */ -static struct rte_vdev_driver dpaa2_cmdif_drv; - /* * This API provides the DPCI device ID in 'attr_value'. * The device ID shall be passed by GPP to the AIOP using CMDIF commands. @@ -65,6 +59,7 @@ dpaa2_cmdif_enqueue_bufs(struct rte_rawdev *dev, struct qbman_fd fd; struct qbman_eq_desc eqdesc; struct qbman_swp *swp; + uint32_t retry_count = 0; int ret; RTE_SET_USED(count); @@ -72,7 +67,9 @@ dpaa2_cmdif_enqueue_bufs(struct rte_rawdev *dev, if (unlikely(!DPAA2_PER_LCORE_DPIO)) { ret = dpaa2_affine_qbman_swp(); if (ret) { - DPAA2_CMDIF_ERR("Failure in affining portal\n"); + DPAA2_CMDIF_ERR( + "Failed to allocate IO portal, tid: %d\n", + rte_gettid()); return 0; } } @@ -103,11 +100,15 @@ dpaa2_cmdif_enqueue_bufs(struct rte_rawdev *dev, ret = qbman_swp_enqueue_multiple(swp, &eqdesc, &fd, NULL, 1); if (ret < 0 && ret != -EBUSY) DPAA2_CMDIF_ERR("Transmit failure with err: %d\n", ret); - } while (ret == -EBUSY); + retry_count++; + } while ((ret == -EBUSY) && (retry_count < DPAA2_MAX_TX_RETRY_COUNT)); + + if (ret < 0) + return ret; DPAA2_CMDIF_DP_DEBUG("Successfully transmitted a packet\n"); - return 0; + return 1; } static int @@ -131,7 +132,9 @@ dpaa2_cmdif_dequeue_bufs(struct rte_rawdev *dev, if (unlikely(!DPAA2_PER_LCORE_DPIO)) { ret = dpaa2_affine_qbman_swp(); if (ret) { - DPAA2_CMDIF_ERR("Failure in affining portal\n"); + DPAA2_CMDIF_ERR( + "Failed to allocate IO portal, tid: %d\n", + rte_gettid()); return 0; } } @@ -207,7 +210,6 @@ dpaa2_cmdif_create(const char *name, rawdev->dev_ops = &dpaa2_cmdif_ops; rawdev->device = &vdev->device; - rawdev->driver_name = vdev->device.driver->name; /* For secondary processes, the primary has done all the work */ if (rte_eal_process_type() != RTE_PROC_PRIMARY) @@ -286,10 +288,4 @@ static struct rte_vdev_driver dpaa2_cmdif_drv = { }; RTE_PMD_REGISTER_VDEV(DPAA2_CMDIF_PMD_NAME, dpaa2_cmdif_drv); - -RTE_INIT(dpaa2_cmdif_init_log) -{ - dpaa2_cmdif_logtype = rte_log_register("pmd.raw.dpaa2.cmdif"); - if (dpaa2_cmdif_logtype >= 0) - rte_log_set_level(dpaa2_cmdif_logtype, RTE_LOG_INFO); -} +RTE_LOG_REGISTER(dpaa2_cmdif_logtype, pmd.raw.dpaa2.cmdif, INFO);