From patchwork Wed Jan 31 14:51: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: 10194087 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 9680C603EE for ; Wed, 31 Jan 2018 14:52:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87A9A2872A for ; Wed, 31 Jan 2018 14:52:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B9FC2872D; Wed, 31 Jan 2018 14:52:14 +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 17E5D2872A for ; Wed, 31 Jan 2018 14:52:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752835AbeAaOwN (ORCPT ); Wed, 31 Jan 2018 09:52:13 -0500 Received: from mail-qk0-f193.google.com ([209.85.220.193]:33148 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752337AbeAaOwM (ORCPT ); Wed, 31 Jan 2018 09:52:12 -0500 Received: by mail-qk0-f193.google.com with SMTP id i141so15018954qke.0 for ; Wed, 31 Jan 2018 06:52:11 -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=FR+81C++0gB0QrCLp3ZmAPMmOO2XazxuuQb+B6d6F7Q=; b=Nh7U+C77CczlD2zviVNx7+CRET+aMXghle6auH4j+5sVmdaO/OlwirkKX2RQj8dcXS kFAIn+xPqIty0n9GSAumCImpx9fkUJJpnyJecLkWe079hegDeAkpFmPH4fbvnfZ2/V1h bE3JIPXijHafvkxKXlkv+/7UC4E3XPdMCf4hc= 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=FR+81C++0gB0QrCLp3ZmAPMmOO2XazxuuQb+B6d6F7Q=; b=d/u6uBV5yNVHdZ7j7ctDAxQsmq4zSTJDtlc99elCoagjnZvYMAFk/HFGXjlPRSp2vK UCO9/eiJ2EI2BEfSbTx+JydSiiurYwxXNiwSPeo+tw0aMrCw0Rp7UkU3PrHB0IAFBtpQ mSe8MGy6pCHVGQZgYJQS0gX5nQUJQmOT1kb0pPQJ4ALp4GcXH1isDn8LCW5xqgGDrJF2 M4iNxyLuIwmpOt2UCGzaKr00n/hnZenN1xBn53QRHOMNctiFE0bBxM6JGGl8Km0WHaZD h2BBh+K0znrntK6tcYh/ZYahkJR9lPgCA6Di0352E+RdGGUiEumZeMbVu4zqgHpcEe1o QeCw== X-Gm-Message-State: AKwxytdMjvXFqIwj+f1EGj/beFMUDi4mFsUH04P3CWPAN3uwQ/rAkQb9 7cmw7RptxwH894EzAJqME5x7+MTY X-Google-Smtp-Source: AH8x224uJ4JWuf4sDeOdC+WfWV9IfD28GJ1RKniqnYGZ6TnT4y/FTChxAYA3xvcYGEwSYN/GVkkbVg== X-Received: by 10.55.161.21 with SMTP id k21mr4653110qke.260.1517410331471; Wed, 31 Jan 2018 06:52:11 -0800 (PST) Received: from neo00-el73.dhcp.broadcom.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id s204sm7926932qke.4.2018.01.31.06.52.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Jan 2018 06:52:10 -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 2/3] libbnxt_re: Display FW version using ibv_devinfo Date: Wed, 31 Jan 2018 09:51:50 -0500 Message-Id: <1517410311-23623-3-git-send-email-devesh.sharma@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1517410311-23623-1-git-send-email-devesh.sharma@broadcom.com> References: <1517410311-23623-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: 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; }