From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 82173A2EDB for ; Mon, 30 Sep 2019 04:51:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6C1E81BE91; Mon, 30 Sep 2019 04:50:25 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id AC1A15B3E for ; Mon, 30 Sep 2019 04:50:16 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x8U2jW9r017680; Sun, 29 Sep 2019 19:50:16 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0818; bh=yvBP0mDJc05AuiSL8RieIbODGYx7ho2H3rktaCMgurI=; b=FLzT7Zc+SiAtdduUFrDAMp20x8VLjFD56H/uDGxjfOXnDI5oyRcqnP0+CjIFovTIoXYN HhcIDB9GUqoWjUesRQtQbFerengLV7EDgZa3LnbuIjbhfJ0pDPn69rSIjoXCwNiv8iEC uU7aeqRSHzy93JTf42DL3Y/4FPdnU7EXJmrqLvvAVhydgLl5URUem8PjX+mqa6CJ1wf+ DMuGm7j9A0WI8k6jta5IhZ1cpiA+QmcgVoLYZuwURs6n7UV47EOGzpaXb/Fab7fzFKeG emxJV75VSHIm5I4Ac6vdoqAmH6sSOumduQh73/OJUn/5xwqE9U9y4H6ogjRDaMspV9T8 9A== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2va71mck1s-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 29 Sep 2019 19:50:16 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sun, 29 Sep 2019 19:50:13 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Sun, 29 Sep 2019 19:50:13 -0700 Received: from irv1user08.caveonetworks.com (unknown [10.104.116.105]) by maili.marvell.com (Postfix) with ESMTP id 6102D3F7040; Sun, 29 Sep 2019 19:50:13 -0700 (PDT) Received: (from rmody@localhost) by irv1user08.caveonetworks.com (8.14.4/8.14.4/Submit) id x8U2oCtn022321; Sun, 29 Sep 2019 19:50:12 -0700 X-Authentication-Warning: irv1user08.caveonetworks.com: rmody set sender to rmody@marvell.com using -f From: Rasesh Mody To: , , CC: Rasesh Mody , Date: Sun, 29 Sep 2019 19:49:21 -0700 Message-ID: <20190930024921.21818-10-rmody@marvell.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190930024921.21818-1-rmody@marvell.com> References: <20190930024921.21818-1-rmody@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-09-30_01:2019-09-25,2019-09-30 signatures=0 Subject: [dpdk-dev] [PATCH 9/9] net/qede: print adapter info during init failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Dump the info logs banner with available information in case of device initialization failure. Signed-off-by: Rasesh Mody --- 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