From patchwork Wed May 16 18:40:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 10404657 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 CBC41601F7 for ; Wed, 16 May 2018 18:41:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9A9928628 for ; Wed, 16 May 2018 18:41:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE47C28687; Wed, 16 May 2018 18:41:05 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, 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 2EB6C2869D for ; Wed, 16 May 2018 18:41:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751255AbeEPSlC (ORCPT ); Wed, 16 May 2018 14:41:02 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:44407 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751038AbeEPSlB (ORCPT ); Wed, 16 May 2018 14:41:01 -0400 Received: by mail-qk0-f193.google.com with SMTP id t129-v6so1506231qke.11 for ; Wed, 16 May 2018 11:41:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dev-mellanox-co-il.20150623.gappssmtp.com; s=20150623; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=2r/X31qTU+v5kkH/p44A5BZNDzx/7nOt/apfqaOi7Wo=; b=W+t4YVYOVZdFGWwv/IbwB7+cM6AEXikZgtGjAr55xTNbxMchFcV/Zxyf+kxPe2hi9i AYXhEWMKuFEHPRc9ZGnuxvffdF3pBABg9k2c6DwQfbXADIBe908BnYbCdGDl5Leb/VAc mPv9heZ5WY3SX8e69l9f7T5as9wD427KyHruw1G0dORACwKSO/ZwYuGt9GWaJWXU/+bi 1VUvBJJIch8fTJ9YHd5gYqP/SZGTZ7xVqAuJmM1aZH3997ZPXp0zdRz04dEfaoZfB1wV Cko4w05byGw+nUuukzRBRndR4iTck16WNle+394GElx/nF3qFLuUnG7U0zIXSbKlgb5g E1Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=2r/X31qTU+v5kkH/p44A5BZNDzx/7nOt/apfqaOi7Wo=; b=MBcpTDYbdFT7Qzt+aMkX6ruFu1I8WcC3LYBbHW6y2g8m5TG4I3itYL/4YJZqcggHBD XLWC6XlU4kncJJPQcRftIBfsQnvehf9w2LW6VPd3gtkLYmnB1n5OVYymbvjIODbS2Ltz oUcmSiNHD0uAhaajiXMsnMCVUwFvvvlZIYvp2j6/uEQmrZNnYV9PpD3kP+fjmHvFApLq bw00YvkUY1KNueEuGywP3HtRg7+tPiXvLdn7aPvpruJb7HLTkv/Qama33ymkqXbv489l D2LWmLh0Nff/ZRlkhjuAlu0tf4KnrEqqiAeapjvHw1f+Fmz/OkXfpYNnIrIrDmiEgRgp xWgw== X-Gm-Message-State: ALKqPwd7T9eG/2MRS3I1HiUwXBnfVoQbLtdb8MwEos5A+EIk5IilUFzk FvaGQ6AAUR7pl5yz7/K1oJ4gtb1n X-Google-Smtp-Source: AB8JxZqPtAhvHS+kfnWDvjsOXvgZk7Jy3Arrzlo7fQwqKt42NBTueD2e1vQE03X074X13k4fiU0a8w== X-Received: by 2002:a37:2ace:: with SMTP id q75-v6mr1997795qkq.77.1526496060379; Wed, 16 May 2018 11:41:00 -0700 (PDT) Received: from [192.168.1.183] (c-73-182-207-166.hsd1.ma.comcast.net. [73.182.207.166]) by smtp.googlemail.com with ESMTPSA id q67-v6sm2458194qki.97.2018.05.16.11.40.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 May 2018 11:40:59 -0700 (PDT) To: "Weiny, Ira" Cc: "linux-rdma@vger.kernel.org" From: Hal Rosenstock Subject: [PATCH infiniband-diags] ibstat no longer works with ibsim with latest libibumad in rdma-core Message-ID: Date: Wed, 16 May 2018 14:40:58 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 Content-Language: en-US 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 If ibstat is run with ibsim, it no longer detects the local ports with the latest libibumad from rdma-core with the following patch: commit abf72057c27750275d0668375d30c4971911d041 Author: Jason Gunthorpe Date: Thu Apr 5 11:04:14 2018 -0600 Now that we don't load the umad module if the HW doesn't use it (eg for roce only hardware) umad_init is failing to read the ABI version from the kernel. Applications still want to use some libibumad services that are not related to the char device, so move the version check to umad_open_port instead. Signed-off-by: Jason Gunthorpe umad_get_cas_names no longer finds any IB devices/ports when running with ibsim as sysfs is no longer initialized with the latest libibumad where this is not done as part of umad_init but moved to umad_open_port. Fix this by adding dummy umad_open_port call (to IB device and port that is not possible) which completes the initialization needed after umad_init in main. Signed-off-by: Hal Rosenstock --- src/ibstat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ibstat.c b/src/ibstat.c index bad4c99..77b6dc0 100644 --- a/src/ibstat.c +++ b/src/ibstat.c @@ -307,6 +307,8 @@ int main(int argc, char *argv[]) if (umad_init() < 0) IBPANIC("can't init UMAD library"); + umad_open_port("", 255); + if ((n = umad_get_cas_names(names, UMAD_MAX_DEVICES)) < 0) IBPANIC("can't list IB device names");