From patchwork Tue Dec 17 15:27:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Ben Yosef X-Patchwork-Id: 3362221 X-Patchwork-Delegate: ira.weiny@intel.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 05270C0D4A for ; Tue, 17 Dec 2013 15:27:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 514FE2039F for ; Tue, 17 Dec 2013 15:27:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 654B7201FD for ; Tue, 17 Dec 2013 15:27:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753456Ab3LQP1g (ORCPT ); Tue, 17 Dec 2013 10:27:36 -0500 Received: from mailp.voltaire.com ([193.47.165.129]:54672 "EHLO mellanox.co.il" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753325Ab3LQP1f (ORCPT ); Tue, 17 Dec 2013 10:27:35 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from danby@mellanox.com) with SMTP; 17 Dec 2013 17:27:27 +0200 Received: from r-ufm5-17.mtr.labs.mlnx (r-ufm5-17.mtr.labs.mlnx [172.30.5.91]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id rBHFRR8b005919; Tue, 17 Dec 2013 17:27:27 +0200 Received: from r-ufm5-17.mtr.labs.mlnx (localhost [127.0.0.1]) by r-ufm5-17.mtr.labs.mlnx (8.14.4/8.14.4) with ESMTP id rBHFRRPL008874; Tue, 17 Dec 2013 17:27:27 +0200 Received: (from danby@localhost) by r-ufm5-17.mtr.labs.mlnx (8.14.4/8.14.4/Submit) id rBHFROiw008872; Tue, 17 Dec 2013 17:27:24 +0200 Date: Tue, 17 Dec 2013 17:27:24 +0200 From: Dan Ben Yosef To: Ira Weiny Cc: linux-rdma@vger.kernel.org Subject: [PATCH] infiniband-diags/vendstat: Fix GeneralInfo SW version Message-ID: <20131217152724.GA8696@r-ufm5-17.mtr.labs.mlnx> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix the offset for GeneralInfo SWInfo for IS4 Signed-off-by: Dan Ben Yosef --- src/vendstat.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/vendstat.c b/src/vendstat.c index a53e80d..f28ff02 100644 --- a/src/vendstat.c +++ b/src/vendstat.c @@ -87,6 +87,7 @@ typedef struct { uint32_t ext_major; uint32_t ext_minor; uint32_t ext_sub_minor; + uint32_t reserved[4]; } is4_fw_ext_info_t; typedef struct { @@ -324,6 +325,7 @@ int main(int argc, char **argv) uint32_t fw_ver_major = 0; uint32_t fw_ver_minor = 0; uint32_t fw_ver_sub_minor = 0; + uint8_t sw_ver_major = 0, sw_ver_minor = 0, sw_ver_sub_minor = 0; is3_general_info_t *gi_is3; is4_general_info_t *gi_is4; const struct ibdiag_opt opts[] = { @@ -415,10 +417,16 @@ int main(int argc, char **argv) fw_ver_major = ntohl(gi_is4->ext_fw_info.ext_major); fw_ver_minor = ntohl(gi_is4->ext_fw_info.ext_minor); fw_ver_sub_minor = ntohl(gi_is4->ext_fw_info.ext_sub_minor); + sw_ver_major = gi_is4->sw_info.major; + sw_ver_minor = gi_is4->sw_info.minor; + sw_ver_sub_minor = gi_is4->sw_info.sub_minor; } else { fw_ver_major = gi_is3->fw_info.major; fw_ver_minor = gi_is3->fw_info.minor; fw_ver_sub_minor = gi_is3->fw_info.sub_minor; + sw_ver_major = gi_is3->sw_info.major; + sw_ver_minor = gi_is3->sw_info.minor; + sw_ver_sub_minor = gi_is3->sw_info.sub_minor; } if (general_info) { @@ -435,8 +443,8 @@ int main(int argc, char **argv) printf("fw_psid: '%s'\n", gi_is3->fw_info.psid); printf("fw_ini_ver: %d\n", ntohl(gi_is3->fw_info.ini_file_version)); - printf("sw_version: %02d.%02d.%02d\n", gi_is3->sw_info.major, - gi_is3->sw_info.minor, gi_is3->sw_info.sub_minor); + printf("sw_version: %02d.%02d.%02d\n", sw_ver_major, + sw_ver_minor, sw_ver_sub_minor); } if (xmit_wait) {