@@ -35,6 +35,7 @@
#include <dpaa2_hw_dpio.h>
#include <dpaa2_ethdev.h>
#include "dpaa2_eventdev.h"
+#include "dpaa2_eventdev_logs.h"
#include <portal/dpaa2_hw_pvt.h>
#include <mc/fsl_dpci.h>
@@ -46,6 +47,9 @@
* Soft Event Flow is DPCI Instance
*/
+/* Dynamic logging identified for mempool */
+int dpaa2_logtype_event;
+
static uint16_t
dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[],
uint16_t nb_events)
@@ -68,7 +72,7 @@
if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
ret = dpaa2_affine_qbman_swp();
if (ret) {
- PMD_DRV_LOG(ERR, "Failure in affining portal\n");
+ DPAA2_EVENTDEV_ERR("Failure in affining portal\n");
return 0;
}
}
@@ -118,7 +122,7 @@
if (!loop)
return num_tx;
frames_to_send = loop;
- PMD_DRV_LOG(ERR, "Unable to allocate memory");
+ DPAA2_EVENTDEV_ERR("Unable to allocate memory");
goto send_partial;
}
rte_memcpy(ev_temp, event, sizeof(struct rte_event));
@@ -163,9 +167,9 @@ static void dpaa2_eventdev_dequeue_wait(uint64_t timeout_ticks)
* case to avoid the problem.
*/
if (errno == EINTR) {
- PMD_DRV_LOG(DEBUG, "epoll_wait fails\n");
+ DPAA2_EVENTDEV_DEBUG("epoll_wait fails\n");
if (i++ > 10)
- PMD_DRV_LOG(DEBUG, "Dequeue burst Failed\n");
+ DPAA2_EVENTDEV_DEBUG("Dequeue burst Failed\n");
goto RETRY;
}
}
@@ -223,7 +227,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
ret = dpaa2_affine_qbman_swp();
if (ret) {
- PMD_DRV_LOG(ERR, "Failure in affining portal\n");
+ DPAA2_EVENTDEV_ERR("Failure in affining portal\n");
return 0;
}
}
@@ -259,7 +263,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
rxq->cb(swp, fd, dq, rxq, &ev[num_pkts]);
} else {
qbman_swp_dqrr_consume(swp, dq);
- PMD_DRV_LOG(ERR, "Null Return VQ received\n");
+ DPAA2_EVENTDEV_ERR("Null Return VQ received\n");
return 0;
}
@@ -282,7 +286,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
{
struct dpaa2_eventdev *priv = dev->data->dev_private;
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(dev);
@@ -316,7 +320,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
struct dpaa2_eventdev *priv = dev->data->dev_private;
struct rte_event_dev_config *conf = &dev->data->dev_conf;
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
priv->dequeue_timeout_ns = conf->dequeue_timeout_ns;
priv->nb_event_queues = conf->nb_event_queues;
@@ -326,14 +330,15 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
priv->nb_event_port_enqueue_depth = conf->nb_event_port_enqueue_depth;
priv->event_dev_cfg = conf->event_dev_cfg;
- PMD_DRV_LOG(DEBUG, "Configured eventdev devid=%d", dev->data->dev_id);
+ DPAA2_EVENTDEV_DEBUG("Configured eventdev devid=%d",
+ dev->data->dev_id);
return 0;
}
static int
dpaa2_eventdev_start(struct rte_eventdev *dev)
{
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(dev);
@@ -343,7 +348,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
static void
dpaa2_eventdev_stop(struct rte_eventdev *dev)
{
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(dev);
}
@@ -351,7 +356,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
static int
dpaa2_eventdev_close(struct rte_eventdev *dev)
{
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(dev);
@@ -362,7 +367,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
dpaa2_eventdev_queue_def_conf(struct rte_eventdev *dev, uint8_t queue_id,
struct rte_event_queue_conf *queue_conf)
{
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(dev);
RTE_SET_USED(queue_id);
@@ -377,7 +382,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
static void
dpaa2_eventdev_queue_release(struct rte_eventdev *dev, uint8_t queue_id)
{
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(dev);
RTE_SET_USED(queue_id);
@@ -391,7 +396,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
struct evq_info_t *evq_info =
&priv->evq_info[queue_id];
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
evq_info->event_queue_cfg = queue_conf->event_queue_cfg;
@@ -402,7 +407,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
dpaa2_eventdev_port_def_conf(struct rte_eventdev *dev, uint8_t port_id,
struct rte_event_port_conf *port_conf)
{
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(dev);
RTE_SET_USED(port_id);
@@ -419,7 +424,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
static void
dpaa2_eventdev_port_release(void *port)
{
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(port);
}
@@ -428,7 +433,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
dpaa2_eventdev_port_setup(struct rte_eventdev *dev, uint8_t port_id,
const struct rte_event_port_conf *port_conf)
{
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(port_conf);
@@ -454,7 +459,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
struct evq_info_t *evq_info;
int i;
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
for (i = 0; i < nb_unlinks; i++) {
evq_info = &priv->evq_info[queues[i]];
@@ -480,7 +485,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
uint8_t channel_index;
int ret, i, n;
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
for (i = 0; i < nb_links; i++) {
evq_info = &priv->evq_info[queues[i]];
@@ -492,7 +497,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
CMD_PRI_LOW, dpaa2_portal->dpio_dev->token,
evq_info->dpcon->dpcon_id, &channel_index);
if (ret < 0) {
- PMD_DRV_ERR("Static dequeue cfg failed with ret: %d\n",
+ DPAA2_EVENTDEV_ERR("Static dequeue cfg failed with ret: %d\n",
ret);
goto err;
}
@@ -525,7 +530,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
{
uint32_t scale = 1;
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(dev);
*timeout_ticks = ns * scale;
@@ -536,7 +541,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
static void
dpaa2_eventdev_dump(struct rte_eventdev *dev, FILE *f)
{
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(dev);
RTE_SET_USED(f);
@@ -549,7 +554,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
{
const char *ethdev_driver = eth_dev->device->driver->name;
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(dev);
@@ -571,13 +576,13 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
uint16_t dpcon_id = priv->evq_info[ev_qid].dpcon->dpcon_id;
int i, ret;
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
ret = dpaa2_eth_eventq_attach(eth_dev, i,
dpcon_id, queue_conf);
if (ret) {
- PMD_DRV_ERR("dpaa2_eth_eventq_attach failed: ret %d\n",
+ DPAA2_EVENTDEV_ERR("dpaa2_eth_eventq_attach failed: ret %d\n",
ret);
goto fail;
}
@@ -601,7 +606,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
uint16_t dpcon_id = priv->evq_info[ev_qid].dpcon->dpcon_id;
int ret;
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
if (rx_queue_id == -1)
return dpaa2_eventdev_eth_queue_add_all(dev,
@@ -610,7 +615,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
ret = dpaa2_eth_eventq_attach(eth_dev, rx_queue_id,
dpcon_id, queue_conf);
if (ret) {
- PMD_DRV_ERR("dpaa2_eth_eventq_attach failed: ret: %d\n", ret);
+ DPAA2_EVENTDEV_ERR("dpaa2_eth_eventq_attach failed: ret: %d\n", ret);
return ret;
}
return 0;
@@ -622,14 +627,14 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
{
int i, ret;
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(dev);
for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
ret = dpaa2_eth_eventq_detach(eth_dev, i);
if (ret) {
- PMD_DRV_ERR("dpaa2_eth_eventq_detach failed: ret %d\n",
+ DPAA2_EVENTDEV_ERR("dpaa2_eth_eventq_detach failed: ret %d\n",
ret);
return ret;
}
@@ -645,14 +650,14 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
{
int ret;
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
if (rx_queue_id == -1)
return dpaa2_eventdev_eth_queue_del_all(dev, eth_dev);
ret = dpaa2_eth_eventq_detach(eth_dev, rx_queue_id);
if (ret) {
- PMD_DRV_ERR("dpaa2_eth_eventq_detach failed: ret: %d\n", ret);
+ DPAA2_EVENTDEV_ERR("dpaa2_eth_eventq_detach failed: ret: %d\n", ret);
return ret;
}
@@ -663,7 +668,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
dpaa2_eventdev_eth_start(const struct rte_eventdev *dev,
const struct rte_eth_dev *eth_dev)
{
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(dev);
RTE_SET_USED(eth_dev);
@@ -675,7 +680,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
dpaa2_eventdev_eth_stop(const struct rte_eventdev *dev,
const struct rte_eth_dev *eth_dev)
{
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(dev);
RTE_SET_USED(eth_dev);
@@ -732,7 +737,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
dpci_dev->token, i,
&rx_queue_cfg);
if (ret) {
- PMD_DRV_LOG(ERR,
+ DPAA2_EVENTDEV_ERR(
"set_rx_q failed with err code: %d", ret);
return ret;
}
@@ -753,7 +758,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
sizeof(struct dpaa2_eventdev),
rte_socket_id());
if (eventdev == NULL) {
- PMD_DRV_ERR("Failed to create eventdev vdev %s", name);
+ DPAA2_EVENTDEV_ERR("Failed to create eventdev vdev %s", name);
goto fail;
}
@@ -787,7 +792,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
ret = dpaa2_eventdev_setup_dpci(dpci_dev, dpcon_dev);
if (ret) {
- PMD_DRV_LOG(ERR,
+ DPAA2_EVENTDEV_ERR(
"dpci setup failed with err code: %d", ret);
return ret;
}
@@ -805,7 +810,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
const char *name;
name = rte_vdev_device_name(vdev);
- PMD_DRV_LOG(INFO, "Initializing %s", name);
+ DPAA2_EVENTDEV_INFO("Initializing %s", name);
return dpaa2_eventdev_create(name);
}
@@ -815,7 +820,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
const char *name;
name = rte_vdev_device_name(vdev);
- PMD_DRV_LOG(INFO, "Closing %s", name);
+ DPAA2_EVENTDEV_INFO("Closing %s", name);
return rte_event_pmd_vdev_uninit(name);
}
@@ -16,18 +16,6 @@
#define EVENTDEV_NAME_DPAA2_PMD event_dpaa2
-#ifdef RTE_LIBRTE_PMD_DPAA2_EVENTDEV_DEBUG
-#define PMD_DRV_LOG(level, fmt, args...) \
- RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
-#define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, ">>")
-#else
-#define PMD_DRV_LOG(level, fmt, args...) do { } while (0)
-#define PMD_DRV_FUNC_TRACE() do { } while (0)
-#endif
-
-#define PMD_DRV_ERR(fmt, args...) \
- RTE_LOG(ERR, PMD, "%s(): " fmt "\n", __func__, ## args)
-
#define DPAA2_EVENT_DEFAULT_DPCI_PRIO 0
#define DPAA2_EVENT_MAX_QUEUES 16
new file mode 100644
@@ -0,0 +1,37 @@
+/*-
+ * SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2018 NXP
+ */
+
+#ifndef _DPAA2_EVENTDEV_LOGS_H_
+#define _DPAA2_EVENTDEV_LOGS_H_
+
+extern int dpaa2_logtype_event;
+
+#define DPAA2_EVENTDEV_LOG(level, fmt, args...) \
+ rte_log(RTE_LOG_ ## level, dpaa2_logtype_event, "%s(): " fmt "\n", \
+ __func__, ##args)
+
+#define EVENTDEV_INIT_FUNC_TRACE() DPAA2_EVENTDEV_LOG(DEBUG, " >>")
+
+#define DPAA2_EVENTDEV_DEBUG(fmt, args...) \
+ DPAA2_EVENTDEV_LOG(DEBUG, fmt, ## args)
+#define DPAA2_EVENTDEV_INFO(fmt, args...) \
+ DPAA2_EVENTDEV_LOG(INFO, fmt, ## args)
+#define DPAA2_EVENTDEV_ERR(fmt, args...) \
+ DPAA2_EVENTDEV_LOG(ERR, fmt, ## args)
+#define DPAA2_EVENTDEV_WARN(fmt, args...) \
+ DPAA2_EVENTDEV_LOG(WARNING, fmt, ## args)
+
+/* DP Logs, toggled out at compile time if level lower than current level */
+#define DPAA2_EVENTDEV_DP_LOG(level, fmt, args...) \
+ RTE_LOG_DP(level, PMD, fmt, ## args)
+
+#define DPAA2_EVENTDEV_DP_DEBUG(fmt, args...) \
+ DPAA2_EVENTDEV_DP_LOG(DEBUG, fmt, ## args)
+#define DPAA2_EVENTDEV_DP_INFO(fmt, args...) \
+ DPAA2_EVENTDEV_DP_LOG(INFO, fmt, ## args)
+#define DPAA2_EVENTDEV_DP_WARN(fmt, args...) \
+ DPAA2_EVENTDEV_DP_LOG(WARNING, fmt, ## args)
+
+#endif /* _DPAA2_EVENTDEV_LOGS_H_ */
@@ -20,6 +20,7 @@
#include <rte_dev.h>
#include <rte_ethdev.h>
+#include <fslmc_logs.h>
#include <rte_fslmc.h>
#include <mc/fsl_dpcon.h>
#include <portal/dpaa2_hw_pvt.h>