DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rasesh Mody <rmody@marvell.com>
To: <dev@dpdk.org>, <jerinj@marvell.com>, <ferruh.yigit@intel.com>
Cc: Rasesh Mody <rmody@marvell.com>, <GR-Everest-DPDK-Dev@marvell.com>
Subject: [dpdk-dev] [PATCH 9/9] net/qede: print adapter info during init failure
Date: Sun, 29 Sep 2019 19:49:21 -0700	[thread overview]
Message-ID: <20190930024921.21818-10-rmody@marvell.com> (raw)
In-Reply-To: <20190930024921.21818-1-rmody@marvell.com>

Dump the info logs banner with available information in case of
device initialization failure.

Signed-off-by: Rasesh Mody <rmody@marvell.com>
---
 drivers/net/qede/qede_ethdev.c | 54 +++++++++++++++++++++-------------
 drivers/net/qede/qede_ethdev.h | 19 ++++++++----
 2 files changed, 46 insertions(+), 27 deletions(-)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 0c9f6590e..5dd49fc20 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -278,30 +278,38 @@ static void qede_print_adapter_info(struct qede_dev *qdev)
 {
 	struct ecore_dev *edev = &qdev->edev;
 	struct qed_dev_info *info = &qdev->dev_info.common;
-	static char drv_ver[QEDE_PMD_DRV_VER_STR_SIZE];
 	static char ver_str[QEDE_PMD_DRV_VER_STR_SIZE];
 
-	DP_INFO(edev, "*********************************\n");
-	DP_INFO(edev, " DPDK version:%s\n", rte_version());
-	DP_INFO(edev, " Chip details : %s %c%d\n",
+	DP_INFO(edev, "**************************************************\n");
+	DP_INFO(edev, " DPDK version\t\t\t: %s\n", rte_version());
+	DP_INFO(edev, " Chip details\t\t\t: %s %c%d\n",
 		  ECORE_IS_BB(edev) ? "BB" : "AH",
 		  'A' + edev->chip_rev,
 		  (int)edev->chip_metal);
-	snprintf(ver_str, QEDE_PMD_DRV_VER_STR_SIZE, "%d.%d.%d.%d",
-		 info->fw_major, info->fw_minor, info->fw_rev, info->fw_eng);
-	snprintf(drv_ver, QEDE_PMD_DRV_VER_STR_SIZE, "%s_%s",
-		 ver_str, QEDE_PMD_VERSION);
-	DP_INFO(edev, " Driver version : %s\n", drv_ver);
-	DP_INFO(edev, " Firmware version : %s\n", ver_str);
+	snprintf(ver_str, QEDE_PMD_DRV_VER_STR_SIZE, "%s",
+		 QEDE_PMD_DRV_VERSION);
+	DP_INFO(edev, " Driver version\t\t\t: %s\n", ver_str);
+
+	snprintf(ver_str, QEDE_PMD_DRV_VER_STR_SIZE, "%s",
+		 QEDE_PMD_BASE_VERSION);
+	DP_INFO(edev, " Base version\t\t\t: %s\n", ver_str);
+
+	snprintf(ver_str, QEDE_PMD_DRV_VER_STR_SIZE, "%s", QEDE_PMD_FW_VERSION);
+	DP_INFO(edev, " Firmware version\t\t\t: %s\n", ver_str);
 
 	snprintf(ver_str, MCP_DRV_VER_STR_SIZE,
 		 "%d.%d.%d.%d",
-		(info->mfw_rev >> 24) & 0xff,
-		(info->mfw_rev >> 16) & 0xff,
-		(info->mfw_rev >> 8) & 0xff, (info->mfw_rev) & 0xff);
-	DP_INFO(edev, " Management Firmware version : %s\n", ver_str);
-	DP_INFO(edev, " Firmware file : %s\n", qede_fw_file);
-	DP_INFO(edev, "*********************************\n");
+		 (info->mfw_rev & QED_MFW_VERSION_3_MASK) >>
+		 QED_MFW_VERSION_3_OFFSET,
+		 (info->mfw_rev & QED_MFW_VERSION_2_MASK) >>
+		 QED_MFW_VERSION_2_OFFSET,
+		 (info->mfw_rev & QED_MFW_VERSION_1_MASK) >>
+		 QED_MFW_VERSION_1_OFFSET,
+		 (info->mfw_rev & QED_MFW_VERSION_0_MASK) >>
+		 QED_MFW_VERSION_0_OFFSET);
+	DP_INFO(edev, " Management Firmware version\t: %s\n", ver_str);
+	DP_INFO(edev, " Firmware file\t\t\t: %s\n", qede_fw_file);
+	DP_INFO(edev, "**************************************************\n");
 }
 
 static void qede_reset_queue_stats(struct qede_dev *qdev, bool xstats)
@@ -2435,6 +2443,10 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 				    dp_level, is_vf);
 	if (rc != 0) {
 		DP_ERR(edev, "qede probe failed rc %d\n", rc);
+		if (do_once) {
+			qede_print_adapter_info(adapter);
+			do_once = false;
+		}
 		return -ENODEV;
 	}
 	qede_update_pf_params(edev);
@@ -2515,6 +2527,11 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 
 	qede_alloc_etherdev(adapter, &dev_info);
 
+	if (do_once) {
+		qede_print_adapter_info(adapter);
+		do_once = false;
+	}
+
 	adapter->ops->common->set_name(edev, edev->name);
 
 	if (!is_vf)
@@ -2571,11 +2588,6 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 
 	eth_dev->dev_ops = (is_vf) ? &qede_eth_vf_dev_ops : &qede_eth_dev_ops;
 
-	if (do_once) {
-		qede_print_adapter_info(adapter);
-		do_once = false;
-	}
-
 	/* Bring-up the link */
 	qede_dev_set_link_state(eth_dev, true);
 
diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h
index 559638508..1ac2d086a 100644
--- a/drivers/net/qede/qede_ethdev.h
+++ b/drivers/net/qede/qede_ethdev.h
@@ -42,20 +42,27 @@
 #define qede_stringify(x...)		qede_stringify1(x)
 
 /* Driver versions */
+#define QEDE_PMD_DRV_VER_STR_SIZE NAME_SIZE /* 128 */
 #define QEDE_PMD_VER_PREFIX		"QEDE PMD"
 #define QEDE_PMD_VERSION_MAJOR		2
 #define QEDE_PMD_VERSION_MINOR	        11
 #define QEDE_PMD_VERSION_REVISION       0
 #define QEDE_PMD_VERSION_PATCH	        1
 
-#define QEDE_PMD_VERSION qede_stringify(QEDE_PMD_VERSION_MAJOR) "."     \
-			 qede_stringify(QEDE_PMD_VERSION_MINOR) "."     \
-			 qede_stringify(QEDE_PMD_VERSION_REVISION) "."  \
-			 qede_stringify(QEDE_PMD_VERSION_PATCH)
+#define QEDE_PMD_DRV_VERSION qede_stringify(QEDE_PMD_VERSION_MAJOR) "."     \
+			     qede_stringify(QEDE_PMD_VERSION_MINOR) "."     \
+			     qede_stringify(QEDE_PMD_VERSION_REVISION) "."  \
+			     qede_stringify(QEDE_PMD_VERSION_PATCH)
 
-#define QEDE_PMD_DRV_VER_STR_SIZE NAME_SIZE
-#define QEDE_PMD_VER_PREFIX "QEDE PMD"
+#define QEDE_PMD_BASE_VERSION qede_stringify(ECORE_MAJOR_VERSION) "."       \
+			      qede_stringify(ECORE_MINOR_VERSION) "."       \
+			      qede_stringify(ECORE_REVISION_VERSION) "."    \
+			      qede_stringify(ECORE_ENGINEERING_VERSION)
 
+#define QEDE_PMD_FW_VERSION qede_stringify(FW_MAJOR_VERSION) "."            \
+			    qede_stringify(FW_MINOR_VERSION) "."            \
+			    qede_stringify(FW_REVISION_VERSION) "."         \
+			    qede_stringify(FW_ENGINEERING_VERSION)
 
 #define QEDE_RSS_INDIR_INITED     (1 << 0)
 #define QEDE_RSS_KEY_INITED       (1 << 1)
-- 
2.18.0


  parent reply	other threads:[~2019-09-30  2:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-30  2:49 [dpdk-dev] [PATCH 0/9] net/qede/base: update FW to 8.40.25.0 Rasesh Mody
2019-09-30  2:49 ` [dpdk-dev] [PATCH 1/9] net/qede/base: calculate right page index for PBL chains Rasesh Mody
2019-09-30  2:49 ` [dpdk-dev] [PATCH 2/9] net/qede/base: change MFW mailbox command log verbosity Rasesh Mody
2019-09-30  2:49 ` [dpdk-dev] [PATCH 3/9] net/qede/base: lock entire QM reconfiguration flow Rasesh Mody
2019-09-30  2:49 ` [dpdk-dev] [PATCH 4/9] net/qede/base: rename HSI datatypes and funcs Rasesh Mody
2019-09-30  2:49 ` [dpdk-dev] [PATCH 5/9] net/qede/base: update rt defs NVM cfg and mcp code Rasesh Mody
2019-09-30  2:49 ` [dpdk-dev] [PATCH 6/9] net/qede/base: move dmae code to HSI Rasesh Mody
2019-09-30  2:49 ` [dpdk-dev] [PATCH 7/9] net/qede/base: update HSI code Rasesh Mody
2019-09-30  2:49 ` [dpdk-dev] [PATCH 8/9] net/qede/base: update the FW to 8.40.25.0 Rasesh Mody
2019-09-30  2:49 ` Rasesh Mody [this message]
2019-10-03  5:06 ` [dpdk-dev] [PATCH 0/9] net/qede/base: update " Jerin Jacob
2019-10-03  5:59   ` Rasesh Mody
2019-10-06 20:14 ` [dpdk-dev] [PATCH v2 " Rasesh Mody
2019-10-11  7:57   ` Jerin Jacob
2019-10-06 20:14 ` [dpdk-dev] [PATCH v2 1/9] net/qede/base: calculate right page index for PBL chains Rasesh Mody
2019-10-06 20:14 ` [dpdk-dev] [PATCH v2 2/9] net/qede/base: change MFW mailbox command log verbosity Rasesh Mody
2019-10-06 20:14 ` [dpdk-dev] [PATCH v2 3/9] net/qede/base: lock entire QM reconfiguration flow Rasesh Mody
2019-10-06 20:14 ` [dpdk-dev] [PATCH v2 4/9] net/qede/base: rename HSI datatypes and funcs Rasesh Mody
2019-10-06 20:14 ` [dpdk-dev] [PATCH v2 5/9] net/qede/base: update rt defs NVM cfg and mcp code Rasesh Mody
2019-10-06 20:14 ` [dpdk-dev] [PATCH v2 6/9] net/qede/base: move dmae code to HSI Rasesh Mody
2019-10-06 20:14 ` [dpdk-dev] [PATCH v2 7/9] net/qede/base: update HSI code Rasesh Mody
2019-10-06 20:14 ` [dpdk-dev] [PATCH v2 8/9] net/qede/base: update the FW to 8.40.25.0 Rasesh Mody
2019-10-11 16:13   ` Ferruh Yigit
2019-10-06 20:14 ` [dpdk-dev] [PATCH v2 9/9] net/qede: print adapter info during init failure Rasesh Mody

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=20190930024921.21818-10-rmody@marvell.com \
    --to=rmody@marvell.com \
    --cc=GR-Everest-DPDK-Dev@marvell.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jerinj@marvell.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).