DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rasesh Mody <rasesh.mody@cavium.com>
To: <ferruh.yigit@intel.com>, <dev@dpdk.org>
Cc: Rasesh Mody <rasesh.mody@cavium.com>, <Dept-EngDPDKDev@cavium.com>
Subject: [dpdk-dev] [PATCH v2 5/8] net/qede: change debug verbosity of PMD messages
Date: Sat, 1 Jul 2017 12:29:59 -0700	[thread overview]
Message-ID: <1498937402-25547-6-git-send-email-rasesh.mody@cavium.com> (raw)
In-Reply-To: <1498729889-21524-1-git-send-email-rasesh.mody@cavium.com>

Convert DP_NOTICE() to DP_ERR() as appropriate in PMD files.
Change DP_NOTICE() macro to make use of boolean flag to log
it as error message or informational message.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/qede_ethdev.c |   20 +++++++++-----------
 drivers/net/qede/qede_logs.h   |   23 ++++++++++++++---------
 drivers/net/qede/qede_main.c   |   20 +++++++++-----------
 drivers/net/qede/qede_rxtx.c   |   15 ++++++---------
 4 files changed, 38 insertions(+), 40 deletions(-)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 8e18a17..ad264ba 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -2434,8 +2434,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 	eth_dev->tx_pkt_prepare = qede_xmit_prep_pkts;
 
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
-		DP_NOTICE(edev, false,
-			  "Skipping device init from secondary process\n");
+		DP_ERR(edev, "Skipping device init from secondary process\n");
 		return 0;
 	}
 
@@ -2558,8 +2557,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 				ether_addr_copy(&eth_dev->data->mac_addrs[0],
 						&adapter->primary_mac);
 			} else {
-				DP_NOTICE(edev, false,
-					  "No VF macaddr assigned\n");
+				DP_ERR(edev, "No VF macaddr assigned\n");
 			}
 		}
 	}
@@ -2584,13 +2582,13 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 		if (qede_start_vport(adapter, adapter->mtu))
 			return -1;
 
-	DP_NOTICE(edev, false, "MAC address : %02x:%02x:%02x:%02x:%02x:%02x\n",
-		  adapter->primary_mac.addr_bytes[0],
-		  adapter->primary_mac.addr_bytes[1],
-		  adapter->primary_mac.addr_bytes[2],
-		  adapter->primary_mac.addr_bytes[3],
-		  adapter->primary_mac.addr_bytes[4],
-		  adapter->primary_mac.addr_bytes[5]);
+	DP_INFO(edev, "MAC address : %02x:%02x:%02x:%02x:%02x:%02x\n",
+		adapter->primary_mac.addr_bytes[0],
+		adapter->primary_mac.addr_bytes[1],
+		adapter->primary_mac.addr_bytes[2],
+		adapter->primary_mac.addr_bytes[3],
+		adapter->primary_mac.addr_bytes[4],
+		adapter->primary_mac.addr_bytes[5]);
 
 	DP_INFO(edev, "Device initialized\n");
 
diff --git a/drivers/net/qede/qede_logs.h b/drivers/net/qede/qede_logs.h
index 25c14d8..1582115 100644
--- a/drivers/net/qede/qede_logs.h
+++ b/drivers/net/qede/qede_logs.h
@@ -16,16 +16,21 @@
 		(p_dev)->name ? (p_dev)->name : "", \
 		##__VA_ARGS__)
 
-#ifdef RTE_LIBRTE_QEDE_DEBUG_INFO
 #define DP_NOTICE(p_dev, is_assert, fmt, ...) \
-	rte_log(RTE_LOG_NOTICE, RTE_LOGTYPE_PMD,\
-		"[QEDE PMD: (%s)]%s:" fmt, \
-		(p_dev)->name ? (p_dev)->name : "", \
-		 __func__, \
-		##__VA_ARGS__)
-#else
-#define DP_NOTICE(p_dev, fmt, ...) do { } while (0)
-#endif
+do { \
+	if (is_assert) \
+		rte_log(RTE_LOG_ERR, RTE_LOGTYPE_PMD,\
+			"[QEDE PMD: (%s)]%s:" fmt, \
+			(p_dev)->name ? (p_dev)->name : "", \
+			 __func__, \
+			##__VA_ARGS__); \
+	else \
+		rte_log(RTE_LOG_NOTICE, RTE_LOGTYPE_PMD,\
+			"[QEDE PMD: (%s)]%s:" fmt, \
+			(p_dev)->name ? (p_dev)->name : "", \
+			 __func__, \
+			##__VA_ARGS__); \
+} while (0)
 
 #ifdef RTE_LIBRTE_QEDE_DEBUG_INFO
 #define DP_INFO(p_dev, fmt, ...) \
diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
index f74626b..01584f8 100644
--- a/drivers/net/qede/qede_main.c
+++ b/drivers/net/qede/qede_main.c
@@ -130,12 +130,12 @@ static int qed_load_firmware_data(struct ecore_dev *edev)
 
 	fd = open(fw_file, O_RDONLY);
 	if (fd < 0) {
-		DP_NOTICE(edev, false, "Can't open firmware file\n");
+		DP_ERR(edev, "Can't open firmware file\n");
 		return -ENOENT;
 	}
 
 	if (fstat(fd, &st) < 0) {
-		DP_NOTICE(edev, false, "Can't stat firmware file\n");
+		DP_ERR(edev, "Can't stat firmware file\n");
 		close(fd);
 		return -1;
 	}
@@ -143,20 +143,20 @@ static int qed_load_firmware_data(struct ecore_dev *edev)
 	edev->firmware = rte_zmalloc("qede_fw", st.st_size,
 				    RTE_CACHE_LINE_SIZE);
 	if (!edev->firmware) {
-		DP_NOTICE(edev, false, "Can't allocate memory for firmware\n");
+		DP_ERR(edev, "Can't allocate memory for firmware\n");
 		close(fd);
 		return -ENOMEM;
 	}
 
 	if (read(fd, edev->firmware, st.st_size) != st.st_size) {
-		DP_NOTICE(edev, false, "Can't read firmware data\n");
+		DP_ERR(edev, "Can't read firmware data\n");
 		close(fd);
 		return -1;
 	}
 
 	edev->fw_len = st.st_size;
 	if (edev->fw_len < 104) {
-		DP_NOTICE(edev, false, "Invalid fw size: %" PRIu64 "\n",
+		DP_ERR(edev, "Invalid fw size: %" PRIu64 "\n",
 			  edev->fw_len);
 		close(fd);
 		return -EINVAL;
@@ -260,8 +260,7 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 		/* Allocate stream for unzipping */
 		rc = qed_alloc_stream_mem(edev);
 		if (rc) {
-			DP_NOTICE(edev, true,
-			"Failed to allocate stream memory\n");
+			DP_ERR(edev, "Failed to allocate stream memory\n");
 			goto err1;
 		}
 	}
@@ -301,8 +300,7 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 		rc = ecore_mcp_send_drv_version(hwfn, hwfn->p_main_ptt,
 						&drv_version);
 		if (rc) {
-			DP_NOTICE(edev, true,
-				  "Failed sending drv version command\n");
+			DP_ERR(edev, "Failed sending drv version command\n");
 			goto err3;
 		}
 	}
@@ -606,7 +604,7 @@ static int qed_drain(struct ecore_dev *edev)
 		hwfn = &edev->hwfns[i];
 		ptt = ecore_ptt_acquire(hwfn);
 		if (!ptt) {
-			DP_NOTICE(hwfn, true, "Failed to drain NIG; No PTT\n");
+			DP_ERR(hwfn, "Failed to drain NIG; No PTT\n");
 			return -EBUSY;
 		}
 		rc = ecore_mcp_drain(hwfn, ptt);
@@ -699,7 +697,7 @@ static int qed_get_sb_info(struct ecore_dev *edev, struct ecore_sb_info *sb,
 
 	ptt = ecore_ptt_acquire(hwfn);
 	if (!ptt) {
-		DP_NOTICE(hwfn, true, "Can't acquire PTT\n");
+		DP_ERR(hwfn, "Can't acquire PTT\n");
 		return -EAGAIN;
 	}
 
diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
index e48fd66..8063233 100644
--- a/drivers/net/qede/qede_rxtx.c
+++ b/drivers/net/qede/qede_rxtx.c
@@ -111,9 +111,8 @@ static inline int qede_alloc_rx_buffer(struct qede_rx_queue *rxq)
 	rxq->sw_rx_ring = rte_zmalloc_socket("sw_rx_ring", size,
 					     RTE_CACHE_LINE_SIZE, socket_id);
 	if (!rxq->sw_rx_ring) {
-		DP_NOTICE(edev, false,
-			  "Unable to alloc memory for sw_rx_ring on socket %u\n",
-			  socket_id);
+		DP_ERR(edev, "Memory allocation fails for sw_rx_ring on"
+		       " socket %u\n", socket_id);
 		rte_free(rxq);
 		return -ENOMEM;
 	}
@@ -129,9 +128,8 @@ static inline int qede_alloc_rx_buffer(struct qede_rx_queue *rxq)
 					    NULL);
 
 	if (rc != ECORE_SUCCESS) {
-		DP_NOTICE(edev, false,
-			  "Unable to alloc memory for rxbd ring on socket %u\n",
-			  socket_id);
+		DP_ERR(edev, "Memory allocation fails for RX BD ring"
+		       " on socket %u\n", socket_id);
 		rte_free(rxq->sw_rx_ring);
 		rte_free(rxq);
 		return -ENOMEM;
@@ -148,9 +146,8 @@ static inline int qede_alloc_rx_buffer(struct qede_rx_queue *rxq)
 					    NULL);
 
 	if (rc != ECORE_SUCCESS) {
-		DP_NOTICE(edev, false,
-			  "Unable to alloc memory for cqe ring on socket %u\n",
-			  socket_id);
+		DP_ERR(edev, "Memory allocation fails for RX CQE ring"
+		       " on socket %u\n", socket_id);
 		qdev->ops->common->chain_free(edev, &rxq->rx_bd_ring);
 		rte_free(rxq->sw_rx_ring);
 		rte_free(rxq);
-- 
1.7.10.3

  parent reply	other threads:[~2017-07-01 19:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29  9:51 [dpdk-dev] [PATCH 0/9] net/qede: update PMD to 2.5.1.1 Rasesh Mody
2017-06-29  9:51 ` [dpdk-dev] [PATCH 1/9] net/qede: fix DMA memory leak Rasesh Mody
2017-06-29  9:51 ` [dpdk-dev] [PATCH 2/9] net/qede: add notifying HW errors Rasesh Mody
2017-06-29  9:51 ` [dpdk-dev] [PATCH 3/9] net/qede: limit ring size to 32k Rasesh Mody
2017-06-29  9:51 ` [dpdk-dev] [PATCH 4/9] net/qede: comments traces and format changes Rasesh Mody
2017-06-29  9:51 ` [dpdk-dev] [PATCH 5/9] net/qede: change debug verbosity of PMD messages Rasesh Mody
2017-06-29  9:51 ` [dpdk-dev] [PATCH 6/9] net/qede: set mdump flag Rasesh Mody
2017-06-29  9:51 ` [dpdk-dev] [PATCH 7/9] net/qede: add missing check for VNI Rasesh Mody
2017-06-29  9:51 ` [dpdk-dev] [PATCH 8/9] net/qede: use newer packet mbuf allocate API Rasesh Mody
2017-06-29 12:55   ` Ferruh Yigit
2017-07-01 19:34     ` Mody, Rasesh
2017-06-29  9:51 ` [dpdk-dev] [PATCH 9/9] net/qede: update PMD version to 2.5.1.1 Rasesh Mody
2017-06-29 12:16 ` [dpdk-dev] [PATCH 0/9] net/qede: update PMD " Ferruh Yigit
2017-07-01 19:29 ` [dpdk-dev] [PATCH v2 0/8] " Rasesh Mody
2017-07-05 10:01   ` Ferruh Yigit
2017-07-08 18:35     ` Mody, Rasesh
2017-07-01 19:29 ` [dpdk-dev] [PATCH v2 1/8] net/qede: fix DMA memory leak Rasesh Mody
2017-07-01 19:29 ` [dpdk-dev] [PATCH v2 2/8] net/qede: add notifying HW errors Rasesh Mody
2017-07-01 19:29 ` [dpdk-dev] [PATCH v2 3/8] net/qede: limit ring size to 32k Rasesh Mody
2017-07-01 19:29 ` [dpdk-dev] [PATCH v2 4/8] net/qede: comments traces and format changes Rasesh Mody
2017-07-01 19:29 ` Rasesh Mody [this message]
2017-07-01 19:30 ` [dpdk-dev] [PATCH v2 6/8] net/qede: set mdump flag Rasesh Mody
2017-07-01 19:30 ` [dpdk-dev] [PATCH v2 7/8] net/qede: add missing check for VNI Rasesh Mody
2017-07-03 10:08   ` Ferruh Yigit
2017-07-01 19:30 ` [dpdk-dev] [PATCH v2 8/8] net/qede: update PMD version to 2.5.1.1 Rasesh Mody
2017-07-03 10:06   ` Ferruh Yigit
2017-07-05  9:57     ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1498937402-25547-6-git-send-email-rasesh.mody@cavium.com \
    --to=rasesh.mody@cavium.com \
    --cc=Dept-EngDPDKDev@cavium.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).