/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright 2018 NXP
+ * Copyright 2018-2019 NXP
*/
#include <stdio.h>
/* 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.
struct qbman_fd fd;
struct qbman_eq_desc eqdesc;
struct qbman_swp *swp;
+ uint32_t retry_count = 0;
int ret;
- DPAA2_CMDIF_FUNC_TRACE();
-
RTE_SET_USED(count);
if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
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
uint8_t status;
int ret;
- DPAA2_CMDIF_FUNC_TRACE();
-
RTE_SET_USED(count);
if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
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)
int ret;
name = rte_vdev_device_name(vdev);
+ if (name == NULL)
+ return -1;
DPAA2_CMDIF_INFO("Closing %s on NUMA node %d", name, rte_socket_id());
RTE_PMD_REGISTER_VDEV(DPAA2_CMDIF_PMD_NAME, dpaa2_cmdif_drv);
-RTE_INIT(dpaa2_cmdif_init_log);
-
-static void
-dpaa2_cmdif_init_log(void)
+RTE_INIT(dpaa2_cmdif_init_log)
{
dpaa2_cmdif_logtype = rte_log_register("pmd.raw.dpaa2.cmdif");
if (dpaa2_cmdif_logtype >= 0)