#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>
* 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)
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;
}
}
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));
* 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;
}
}
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;
}
}
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;
}
{
struct dpaa2_eventdev *priv = dev->data->dev_private;
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(dev);
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;
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);
static void
dpaa2_eventdev_stop(struct rte_eventdev *dev)
{
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(dev);
}
static int
dpaa2_eventdev_close(struct rte_eventdev *dev)
{
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(dev);
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);
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);
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;
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);
static void
dpaa2_eventdev_port_release(void *port)
{
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(port);
}
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);
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]];
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]];
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;
}
{
uint32_t scale = 1;
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(dev);
*timeout_ticks = ns * scale;
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);
{
const char *ethdev_driver = eth_dev->device->driver->name;
- PMD_DRV_FUNC_TRACE();
+ EVENTDEV_INIT_FUNC_TRACE();
RTE_SET_USED(dev);
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;
}
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,
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;
{
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;
}
{
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;
}
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);
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);
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;
}
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;
}
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;
}
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);
}
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);
}
--- /dev/null
+/*-
+ * 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_ */