From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-0016ce01.pphosted.com (mx0b-0016ce01.pphosted.com [67.231.156.153]) by dpdk.org (Postfix) with ESMTP id 8602791A0 for ; Tue, 24 Nov 2015 08:45:25 +0100 (CET) Received: from pps.filterd (m0085408.ppops.net [127.0.0.1]) by mx0b-0016ce01.pphosted.com (8.15.0.59/8.15.0.59) with SMTP id tAO7g5VC020800; Mon, 23 Nov 2015 23:45:23 -0800 Received: from avcashub1.qlogic.com (avcashub1.qlogic.com [198.70.193.115]) by mx0b-0016ce01.pphosted.com with ESMTP id 1ycg9a86a4-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 23 Nov 2015 23:45:23 -0800 Received: from avluser05.qlc.com (10.1.113.115) by qlc.com (10.1.4.190) with Microsoft SMTP Server id 14.3.235.1; Mon, 23 Nov 2015 23:45:22 -0800 Received: (from rmody@localhost) by avluser05.qlc.com (8.14.4/8.14.4/Submit) id tAO7jMne024126; Mon, 23 Nov 2015 23:45:22 -0800 X-Authentication-Warning: avluser05.qlc.com: rmody set sender to rasesh.mody@qlogic.com using -f From: Rasesh Mody To: , Date: Mon, 23 Nov 2015 23:44:36 -0800 Message-ID: <1448351076-23161-12-git-send-email-rasesh.mody@qlogic.com> X-Mailer: git-send-email 1.7.10.3 In-Reply-To: <1448351076-23161-1-git-send-email-rasesh.mody@qlogic.com> References: <1448351076-23161-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=7994 signatures=670662 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-1507310000 definitions=main-1511240144 Cc: sony.chacko@qlogic.com Subject: [dpdk-dev] [PATCH v3 11/11] 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: Tue, 24 Nov 2015 07:45:25 -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 088c041..423a9bf 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