From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-0016ce01.pphosted.com (mx0a-0016ce01.pphosted.com [67.231.148.157]) by dpdk.org (Postfix) with ESMTP id A340B8E58 for ; Fri, 11 Dec 2015 07:37:48 +0100 (CET) Received: from pps.filterd (m0045602.ppops.net [127.0.0.1]) by mx0a-0016ce01.pphosted.com (8.15.0.59/8.15.0.59) with SMTP id tBB6Wm6a010600; Thu, 10 Dec 2015 22:37:47 -0800 Received: from avcashub1.qlogic.com (avcashub2.qlogic.com [198.70.193.116]) by mx0a-0016ce01.pphosted.com with ESMTP id 1yqfyxrur5-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Thu, 10 Dec 2015 22:37:47 -0800 Received: from avluser05.qlc.com (10.1.113.115) by qlc.com (10.1.4.191) with Microsoft SMTP Server id 14.3.235.1; Thu, 10 Dec 2015 22:37:46 -0800 Received: (from rmody@localhost) by avluser05.qlc.com (8.14.4/8.14.4/Submit) id tBB6bkFD002169; Thu, 10 Dec 2015 22:37:46 -0800 X-Authentication-Warning: avluser05.qlc.com: rmody set sender to rasesh.mody@qlogic.com using -f From: Rasesh Mody To: , Date: Thu, 10 Dec 2015 22:36:42 -0800 Message-ID: <1449815802-1131-10-git-send-email-rasesh.mody@qlogic.com> X-Mailer: git-send-email 1.7.10.3 In-Reply-To: <1449815802-1131-1-git-send-email-rasesh.mody@qlogic.com> References: <1449815802-1131-1-git-send-email-rasesh.mody@qlogic.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=nai engine=5700 definitions=8011 signatures=670668 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1507310007 definitions=main-1512110118 Cc: sony.chacko@qlogic.com Subject: [dpdk-dev] [PATCH v4 9/9] bnx2x: Add BNX2X PMD versioning X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 06:37:49 -0000 Add BNX2X PMD version, print it as part of adapter info. Adjusted print adapter info output formatting. This patch versions BNX2X PMD at 1.0.0. Signed-off-by: Rasesh Mody --- drivers/net/bnx2x/bnx2x.c | 101 +++++++++++++++++++++++++++++---------------- 1 file changed, 65 insertions(+), 36 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index 37e338f..c9ef878 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -21,6 +21,7 @@ #include "ecore_init.h" #include "ecore_init_ops.h" +#include "rte_version.h" #include "rte_pci_dev_ids.h" #include @@ -28,6 +29,26 @@ #include #include +#define BNX2X_PMD_VER_PREFIX "BNX2X PMD" +#define BNX2X_PMD_VERSION_MAJOR 1 +#define BNX2X_PMD_VERSION_MINOR 0 +#define BNX2X_PMD_VERSION_PATCH 0 + +static inline const char * +bnx2x_pmd_version(void) +{ + static char version[32]; + + snprintf(version, sizeof(version), "%s %s_%d.%d.%d", + BNX2X_PMD_VER_PREFIX, + BNX2X_DRIVER_VERSION, + BNX2X_PMD_VERSION_MAJOR, + BNX2X_PMD_VERSION_MINOR, + BNX2X_PMD_VERSION_PATCH); + + return version; +} + static z_stream zlib_stream; #define EVL_VLID_MASK 0x0FFF @@ -11734,87 +11755,95 @@ void bnx2x_print_adapter_info(struct bnx2x_softc *sc) PMD_INIT_LOG(DEBUG, "\n\n===================================\n"); /* Hardware chip info. */ - PMD_INIT_LOG(DEBUG, "%10s : %#08x\n", "ASIC", sc->devinfo.chip_id); - PMD_INIT_LOG(DEBUG, "%10s : %c%d\n", "Rev", (CHIP_REV(sc) >> 12) + 'A', + PMD_INIT_LOG(DEBUG, "%12s : %#08x", "ASIC", sc->devinfo.chip_id); + PMD_INIT_LOG(DEBUG, "%12s : %c%d", "Rev", (CHIP_REV(sc) >> 12) + 'A', (CHIP_METAL(sc) >> 4)); /* Bus info. */ - PMD_INIT_LOG(DEBUG, "%10s : %d, ", "Bus PCIe", sc->devinfo.pcie_link_width); + PMD_INIT_LOG(DEBUG, "%12s : %d, ", "Bus PCIe", sc->devinfo.pcie_link_width); switch (sc->devinfo.pcie_link_speed) { case 1: - PMD_INIT_LOG(DEBUG, "2.5 Gbps\n"); + PMD_INIT_LOG(DEBUG, "%23s", "2.5 Gbps"); break; case 2: - PMD_INIT_LOG(DEBUG, "5 Gbps\n"); + PMD_INIT_LOG(DEBUG, "%21s", "5 Gbps"); break; case 4: - PMD_INIT_LOG(DEBUG, "8 Gbps\n"); + PMD_INIT_LOG(DEBUG, "%21s", "8 Gbps"); break; default: - PMD_INIT_LOG(DEBUG, "Unknown link speed\n"); + PMD_INIT_LOG(DEBUG, "%33s", "Unknown link speed"); } /* Device features. */ - PMD_INIT_LOG(DEBUG, "%10s : ", "Flags"); + PMD_INIT_LOG(DEBUG, "%12s : ", "Flags"); /* Miscellaneous flags. */ if (sc->devinfo.pcie_cap_flags & BNX2X_MSI_CAPABLE_FLAG) { - PMD_INIT_LOG(DEBUG, "MSI"); + PMD_INIT_LOG(DEBUG, "%18s", "MSI"); i++; } if (sc->devinfo.pcie_cap_flags & BNX2X_MSIX_CAPABLE_FLAG) { if (i > 0) PMD_INIT_LOG(DEBUG, "|"); - PMD_INIT_LOG(DEBUG, "MSI-X"); + PMD_INIT_LOG(DEBUG, "%20s", "MSI-X"); i++; } - PMD_INIT_LOG(DEBUG, "\n"); - if (IS_PF(sc)) { - PMD_INIT_LOG(DEBUG, "\n%10s : ", "Queues"); + PMD_INIT_LOG(DEBUG, "%12s : ", "Queues"); switch (sc->sp->rss_rdata.rss_mode) { case ETH_RSS_MODE_DISABLED: - PMD_INIT_LOG(DEBUG, "None\n"); + PMD_INIT_LOG(DEBUG, "%19s", "None"); break; case ETH_RSS_MODE_REGULAR: - PMD_INIT_LOG(DEBUG, "RSS : %d\n", sc->num_queues); + PMD_INIT_LOG(DEBUG, "%18s : %d", "RSS", sc->num_queues); break; default: - PMD_INIT_LOG(DEBUG, "Unknown\n"); + PMD_INIT_LOG(DEBUG, "%22s", "Unknown"); break; } } + /* RTE and Driver versions */ + PMD_INIT_LOG(DEBUG, "%12s : %s", "DPDK", + rte_version()); + PMD_INIT_LOG(DEBUG, "%12s : %s", "Driver", + bnx2x_pmd_version()); + /* Firmware versions and device features. */ - PMD_INIT_LOG(DEBUG, "%10s : %d.%d.%d\n%10s : %s\n", + PMD_INIT_LOG(DEBUG, "%12s : %d.%d.%d", "Firmware", BNX2X_5710_FW_MAJOR_VERSION, BNX2X_5710_FW_MINOR_VERSION, - BNX2X_5710_FW_REVISION_VERSION, + BNX2X_5710_FW_REVISION_VERSION); + PMD_INIT_LOG(DEBUG, "%12s : %s", "Bootcode", sc->devinfo.bc_ver_str); - PMD_INIT_LOG(DEBUG, "===================================\n"); - PMD_INIT_LOG(DEBUG, "%10s : %u\n", "Bnx2x Func", sc->pcie_func); - PMD_INIT_LOG(DEBUG, "%10s : %s\n", "Bnx2x Flags", get_bnx2x_flags(sc->flags)); - PMD_INIT_LOG(DEBUG, "%10s : %s\n", "DMAE Is", + PMD_INIT_LOG(DEBUG, "\n\n===================================\n"); + PMD_INIT_LOG(DEBUG, "%12s : %u", "Bnx2x Func", sc->pcie_func); + PMD_INIT_LOG(DEBUG, "%12s : %s", "Bnx2x Flags", get_bnx2x_flags(sc->flags)); + PMD_INIT_LOG(DEBUG, "%12s : %s", "DMAE Is", (sc->dmae_ready ? "Ready" : "Not Ready")); - PMD_INIT_LOG(DEBUG, "%10s : %s\n", "OVLAN", (OVLAN(sc) ? "YES" : "NO")); - PMD_INIT_LOG(DEBUG, "%10s : %s\n", "MF", (IS_MF(sc) ? "YES" : "NO")); - PMD_INIT_LOG(DEBUG, "%10s : %u\n", "MTU", sc->mtu); - PMD_INIT_LOG(DEBUG, "%10s : %s\n", "PHY Type", get_ext_phy_type(ext_phy_type)); - PMD_INIT_LOG(DEBUG, "%10s : ", "MAC Addr"); - for (i = 0; i < 6; i++) - PMD_INIT_LOG(DEBUG, "%x%s", sc->link_params.mac_addr[i], - i < 5 ? ":" : "\n"); - PMD_INIT_LOG(DEBUG, "%10s : %s\n", "RX Mode", get_rx_mode(sc->rx_mode)); - PMD_INIT_LOG(DEBUG, "%10s : %s\n", "State", get_state(sc->state)); + PMD_INIT_LOG(DEBUG, "%12s : %s", "OVLAN", (OVLAN(sc) ? "YES" : "NO")); + PMD_INIT_LOG(DEBUG, "%12s : %s", "MF", (IS_MF(sc) ? "YES" : "NO")); + PMD_INIT_LOG(DEBUG, "%12s : %u", "MTU", sc->mtu); + PMD_INIT_LOG(DEBUG, "%12s : %s", "PHY Type", get_ext_phy_type(ext_phy_type)); + PMD_INIT_LOG(DEBUG, "%12s : %x:%x:%x:%x:%x:%x", "MAC Addr", + sc->link_params.mac_addr[0], + sc->link_params.mac_addr[1], + sc->link_params.mac_addr[2], + sc->link_params.mac_addr[3], + sc->link_params.mac_addr[4], + sc->link_params.mac_addr[5]); + PMD_INIT_LOG(DEBUG, "%12s : %s", "RX Mode", get_rx_mode(sc->rx_mode)); + PMD_INIT_LOG(DEBUG, "%12s : %s", "State", get_state(sc->state)); if (sc->recovery_state) - PMD_INIT_LOG(DEBUG, "%10s : %s\n", "Recovery", + PMD_INIT_LOG(DEBUG, "%12s : %s", "Recovery", get_recovery_state(sc->recovery_state)); - PMD_INIT_LOG(DEBUG, "%10s : CQ = %lx, EQ = %lx\n", "SPQ Left", + PMD_INIT_LOG(DEBUG, "%12s : CQ = %lx, EQ = %lx", "SPQ Left", sc->cq_spq_left, sc->eq_spq_left); - PMD_INIT_LOG(DEBUG, "%10s : %x\n", "Switch", sc->link_params.switch_cfg); - PMD_INIT_LOG(DEBUG, "===================================\n\n"); + PMD_INIT_LOG(DEBUG, "%12s : %x", "Switch", sc->link_params.switch_cfg); + PMD_INIT_LOG(DEBUG, "\n\n===================================\n"); } -- 1.7.10.3