summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyong Youb Kim <hyonkim@cisco.com>2018-01-10 01:17:09 -0800
committerFerruh Yigit <ferruh.yigit@intel.com>2018-01-16 18:47:49 +0100
commit36efba2f93c45b18cf21642034517206d4784d42 (patch)
tree03765898ca93d7252feee05275edd4a728c9eabe
parentb5df2f7ac53cee378ddbcf8b1a423361a8743b77 (diff)
downloaddpdk-36efba2f93c45b18cf21642034517206d4784d42.zip
dpdk-36efba2f93c45b18cf21642034517206d4784d42.tar.gz
dpdk-36efba2f93c45b18cf21642034517206d4784d42.tar.xz
net/enic: use dynamic log types
"pmd.enic.init" replaces CONFIG_RTE_LIBRTE_ENIC_DEBUG "pmd.enic.flow" replaces CONFIG_RTE_LIBRTE_ENIC_DEBUG_FLOW Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com> Reviewed-by: John Daley <johndale@cisco.com>
-rw-r--r--config/common_base2
-rw-r--r--doc/guides/nics/enic.rst6
-rw-r--r--drivers/net/enic/enic_compat.h2
-rw-r--r--drivers/net/enic/enic_ethdev.c26
-rw-r--r--drivers/net/enic/enic_flow.c11
5 files changed, 26 insertions, 21 deletions
diff --git a/config/common_base b/config/common_base
index d92bc2a..90508a8 100644
--- a/config/common_base
+++ b/config/common_base
@@ -265,8 +265,6 @@ CONFIG_RTE_LIBRTE_CXGBE_TPUT=y
# Compile burst-oriented Cisco ENIC PMD driver
#
CONFIG_RTE_LIBRTE_ENIC_PMD=y
-CONFIG_RTE_LIBRTE_ENIC_DEBUG=n
-CONFIG_RTE_LIBRTE_ENIC_DEBUG_FLOW=n
#
# Compile burst-oriented Netronome NFP PMD driver
diff --git a/doc/guides/nics/enic.rst b/doc/guides/nics/enic.rst
index 22df466..4dffce1 100644
--- a/doc/guides/nics/enic.rst
+++ b/doc/guides/nics/enic.rst
@@ -52,12 +52,6 @@ Configuration information
- **CONFIG_RTE_LIBRTE_ENIC_PMD** (default y): Enables or disables inclusion
of the ENIC PMD driver in the DPDK compilation.
- - **CONFIG_RTE_LIBRTE_ENIC_DEBUG** (default n): Enables or disables debug
- logging within the ENIC PMD driver.
-
- - **CONFIG_RTE_LIBRTE_ENIC_DEBUG_FLOW** (default n): Enables or disables flow
- API related debug logging within the ENIC PMD driver.
-
- **vNIC Configuration Parameters**
- **Number of Queues**
diff --git a/drivers/net/enic/enic_compat.h b/drivers/net/enic/enic_compat.h
index 1cb5686..4fb92dd 100644
--- a/drivers/net/enic/enic_compat.h
+++ b/drivers/net/enic/enic_compat.h
@@ -84,6 +84,8 @@
#define dev_warning(x, args...) dev_printk(WARNING, args)
#define dev_debug(x, args...) dev_printk(DEBUG, args)
+extern int enicpmd_logtype_flow;
+
#define __le16 u16
#define __le32 u32
#define __le64 u64
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 2491631..5132966 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -49,12 +49,14 @@
#include "vnic_enet.h"
#include "enic.h"
-#ifdef RTE_LIBRTE_ENIC_DEBUG
-#define ENICPMD_FUNC_TRACE() \
- RTE_LOG(DEBUG, PMD, "ENICPMD trace: %s\n", __func__)
-#else
-#define ENICPMD_FUNC_TRACE() (void)0
-#endif
+int enicpmd_logtype_init;
+int enicpmd_logtype_flow;
+
+#define PMD_INIT_LOG(level, fmt, args...) \
+ rte_log(RTE_LOG_ ## level, enicpmd_logtype_init, \
+ "%s" fmt "\n", __func__, ##args)
+
+#define ENICPMD_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
/*
* The set of PCI devices this driver supports
@@ -66,6 +68,18 @@ static const struct rte_pci_id pci_id_enic_map[] = {
{.vendor_id = 0, /* sentinel */},
};
+RTE_INIT(enicpmd_init_log);
+static void
+enicpmd_init_log(void)
+{
+ enicpmd_logtype_init = rte_log_register("pmd.enic.init");
+ if (enicpmd_logtype_init >= 0)
+ rte_log_set_level(enicpmd_logtype_init, RTE_LOG_NOTICE);
+ enicpmd_logtype_flow = rte_log_register("pmd.enic.flow");
+ if (enicpmd_logtype_flow >= 0)
+ rte_log_set_level(enicpmd_logtype_flow, RTE_LOG_NOTICE);
+}
+
static int
enicpmd_fdir_ctrl_func(struct rte_eth_dev *eth_dev,
enum rte_filter_op filter_op, void *arg)
diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c
index a728d07..190762e 100644
--- a/drivers/net/enic/enic_flow.c
+++ b/drivers/net/enic/enic_flow.c
@@ -42,15 +42,12 @@
#include "vnic_dev.h"
#include "vnic_nic.h"
-#ifdef RTE_LIBRTE_ENIC_DEBUG_FLOW
#define FLOW_TRACE() \
- RTE_LOG(DEBUG, PMD, "%s()\n", __func__)
+ rte_log(RTE_LOG_DEBUG, enicpmd_logtype_flow, \
+ "%s()\n", __func__)
#define FLOW_LOG(level, fmt, args...) \
- RTE_LOG(level, PMD, fmt, ## args)
-#else
-#define FLOW_TRACE() do { } while (0)
-#define FLOW_LOG(level, fmt, args...) do { } while (0)
-#endif
+ rte_log(RTE_LOG_ ## level, enicpmd_logtype_flow, \
+ fmt "\n", ##args)
/** Info about how to copy items into enic filters. */
struct enic_items {