net/dpaa2: support debug log
authorHemant Agrawal <hemant.agrawal@nxp.com>
Tue, 11 Apr 2017 13:49:19 +0000 (19:19 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 19 Apr 2017 13:37:37 +0000 (15:37 +0200)
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
config/common_base
config/defconfig_arm64-dpaa2-linuxapp-gcc
drivers/net/dpaa2/Makefile
drivers/net/dpaa2/dpaa2_ethdev.c

index 5812b00..92bd9c9 100644 (file)
@@ -312,6 +312,11 @@ CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL=n
 # Compile burst-oriented NXP DPAA2 PMD driver
 #
 CONFIG_RTE_LIBRTE_DPAA2_PMD=n
+CONFIG_RTE_LIBRTE_DPAA2_DEBUG_INIT=n
+CONFIG_RTE_LIBRTE_DPAA2_DEBUG_DRIVER=n
+CONFIG_RTE_LIBRTE_DPAA2_DEBUG_RX=n
+CONFIG_RTE_LIBRTE_DPAA2_DEBUG_TX=n
+CONFIG_RTE_LIBRTE_DPAA2_DEBUG_TX_FREE=n
 
 #
 # Compile burst-oriented VIRTIO PMD driver
index d2f174e..6e8f6fd 100644 (file)
@@ -59,3 +59,8 @@ CONFIG_RTE_LIBRTE_FSLMC_BUS=y
 # Compile burst-oriented NXP DPAA2 PMD driver
 #
 CONFIG_RTE_LIBRTE_DPAA2_PMD=y
+CONFIG_RTE_LIBRTE_DPAA2_DEBUG_INIT=n
+CONFIG_RTE_LIBRTE_DPAA2_DEBUG_DRIVER=n
+CONFIG_RTE_LIBRTE_DPAA2_DEBUG_RX=n
+CONFIG_RTE_LIBRTE_DPAA2_DEBUG_TX=n
+CONFIG_RTE_LIBRTE_DPAA2_DEBUG_TX_FREE=n
index c91e743..86db137 100644 (file)
@@ -36,8 +36,13 @@ include $(RTE_SDK)/mk/rte.vars.mk
 #
 LIB = librte_pmd_dpaa2.a
 
+ifeq ($(CONFIG_RTE_LIBRTE_DPAA2_DEBUG_INIT),y)
+CFLAGS += -O0 -g
+CFLAGS += "-Wno-error"
+else
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+endif
 
 CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2
 CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc
index 829d1b9..0b3dd67 100644 (file)
@@ -45,6 +45,7 @@
 #include <rte_ethdev.h>
 #include <rte_fslmc.h>
 
+#include <fslmc_logs.h>
 #include <fslmc_vfio.h>
 #include "dpaa2_ethdev.h"
 
@@ -53,6 +54,8 @@ static struct rte_dpaa2_driver rte_dpaa2_pmd;
 static int
 dpaa2_dev_init(struct rte_eth_dev *eth_dev)
 {
+       PMD_INIT_FUNC_TRACE();
+
        /* For secondary processes, the primary has done all the work */
        if (rte_eal_process_type() != RTE_PROC_PRIMARY)
                return 0;
@@ -65,6 +68,8 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
 static int
 dpaa2_dev_uninit(struct rte_eth_dev *eth_dev __rte_unused)
 {
+       PMD_INIT_FUNC_TRACE();
+
        if (rte_eal_process_type() != RTE_PROC_PRIMARY)
                return -EPERM;
 
@@ -92,8 +97,8 @@ rte_dpaa2_probe(struct rte_dpaa2_driver *dpaa2_drv __rte_unused,
                                                sizeof(struct dpaa2_dev_priv),
                                                RTE_CACHE_LINE_SIZE);
                if (eth_dev->data->dev_private == NULL) {
-                       RTE_LOG(CRIT, PMD, "Cannot allocate memzone for"
-                               " private port data\n");
+                       PMD_INIT_LOG(CRIT, "Cannot allocate memzone for"
+                                    " private port data\n");
                        rte_eth_dev_release_port(eth_dev);
                        return -ENOMEM;
                }