From patchwork Wed Jan 31 15:28:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 10194137 X-Patchwork-Delegate: leon@leon.nu Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 540F9601A0 for ; Wed, 31 Jan 2018 15:29:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F4D728710 for ; Wed, 31 Jan 2018 15:29:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32D4128718; Wed, 31 Jan 2018 15:29:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C272828710 for ; Wed, 31 Jan 2018 15:29:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753356AbeAaP3K (ORCPT ); Wed, 31 Jan 2018 10:29:10 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:39035 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752497AbeAaP3K (ORCPT ); Wed, 31 Jan 2018 10:29:10 -0500 Received: by mail-qk0-f196.google.com with SMTP id n129so4452142qke.6 for ; Wed, 31 Jan 2018 07:29:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zdPhcEwecElo6I80IGrNlytHb7DoC+lmg/qTu3wAJJI=; b=Vneqx1EqaDutJtJ+yTN/cQLxz4pNyvSP0MI0IlCVjkyuXf0/5ZIhf8JLGGRX1/io+2 8tKbN1pTh4hHgV7kKkABttOKuZjnkbvBAgFXb5gTfZWc1/tSaMLS0xRLaORP/AzL8Lq8 gHbW9EYowVkcCUCU2LCSuVOb3yDtJrgcNRW1I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zdPhcEwecElo6I80IGrNlytHb7DoC+lmg/qTu3wAJJI=; b=AlL8R05wTg05XNfVWYpdgu53Wpk1t0qexo4W9RbWkaY8YVGPz5/wjA0C1VME6YJI/G OY+9dWo3cAqgTcMh7Wh9xBvkr5HwDxb1AQaIFq6j20IrzK3IPGDPhY1nUUO1po1a+S+1 NjNX/1CN8AZvrVmOQSUL8qFC8hOeeTjUG1iGBo7IkGMVKM+wK8oYt/Ojh3yJNwEJbXE5 CJdW/Cljmt5twe6pwW3L5Cq/vScMSh9mTdKbjlgQDHnNOJKI/41W/2f/f0m8rjJCHweJ icHmF/zC8HIynlXhKxTmfKjhvcL53XBP6YlxDMBrnJ19sKD492ZBeMyxghEPJghJiXwm mrYw== X-Gm-Message-State: AKwxytfLqq6hHAt0tNvF7wGDNm4W3Sa/s/whi/vVvH6yr1Cl5K1QborV MNubD32Yl0oCPl8iurMpi9J+gA== X-Google-Smtp-Source: AH8x227xLIMzcXiqcjrcCTlPA4zOhvMEcd19ROW9+1FYjqL0tFxp5Z5QTsvPrxrvBasQJcpniRE+KA== X-Received: by 10.55.64.84 with SMTP id n81mr49365972qka.95.1517412549625; Wed, 31 Jan 2018 07:29:09 -0800 (PST) Received: from neo00-el73.dhcp.broadcom.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id a27sm11324645qkj.94.2018.01.31.07.29.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Jan 2018 07:29:08 -0800 (PST) From: Devesh Sharma To: dledford@redhat.com, jgg@mellanox.com, leon@kernel.org Cc: linux-rdma@vger.kernel.org, Selvin Xavier , Devesh Sharma Subject: [rdma-core v2 2/3] libbnxt_re: Display FW version using ibv_devinfo Date: Wed, 31 Jan 2018 10:28:50 -0500 Message-Id: <1517412531-25195-3-git-send-email-devesh.sharma@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1517412531-25195-1-git-send-email-devesh.sharma@broadcom.com> References: <1517412531-25195-1-git-send-email-devesh.sharma@broadcom.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Selvin Xavier Need to expose the 64bit fw version received as an o/p of ibv_cmd_query_device as a string. Fixing this in the query_device verb. Signed-off-by: Selvin Xavier Signed-off-by: Devesh Sharma --- providers/bnxt_re/verbs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/providers/bnxt_re/verbs.c b/providers/bnxt_re/verbs.c index 2e88304..6c07646 100644 --- a/providers/bnxt_re/verbs.c +++ b/providers/bnxt_re/verbs.c @@ -58,12 +58,14 @@ int bnxt_re_query_device(struct ibv_context *ibvctx, struct ibv_device_attr *dev_attr) { struct ibv_query_device cmd; - uint64_t fw_ver; + uint8_t fw_ver[8]; int status; memset(dev_attr, 0, sizeof(struct ibv_device_attr)); - status = ibv_cmd_query_device(ibvctx, dev_attr, &fw_ver, + status = ibv_cmd_query_device(ibvctx, dev_attr, (uint64_t *)&fw_ver, &cmd, sizeof(cmd)); + snprintf(dev_attr->fw_ver, 64, "%d.%d.%d.%d", + fw_ver[0], fw_ver[1], fw_ver[2], fw_ver[3]); return status; }