From patchwork Tue May 14 23:49:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10944115 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D0B32912 for ; Wed, 15 May 2019 00:11:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2142287FA for ; Wed, 15 May 2019 00:11:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0808289A2; Wed, 15 May 2019 00:11:11 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 6A9D7289B9 for ; Wed, 15 May 2019 00:11:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726573AbfEOALK (ORCPT ); Tue, 14 May 2019 20:11:10 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:38320 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726778AbfEOALK (ORCPT ); Tue, 14 May 2019 20:11:10 -0400 Received: by mail-qt1-f196.google.com with SMTP id d13so1281160qth.5 for ; Tue, 14 May 2019 17:11:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WvRrtRnP6kxjeCT7/zaUsi42Wm0dzFMHEoCnAof5sGY=; b=nZnW062rLnnIhNTpKjoN6HVnjIVZAn5izPgivdCP/jgOWG/zXThxK87ZdxXJMx8vsI ZL5BmP7ho43rTy5L5Uy2cxO4TfP7wOEecB5jeYlOM+8Wz8m1+W8BGQctcInAtWeeyJ7S BXJFiA321rUEqzLsCay0ByP1ZNWLHbXgQX/CU7gSbmh8NmYZeJpmILw4ZdmyQ82lHDf2 mDneARE4tViXlqkDTDioigjZWpjr3vYQVKk0IJ3B2lK6l3ZKxWew7PAMK9BPgh6FBHQv yagQHOUgU+PWVgJt8GGRCcbKkAiukkxRXaeaWZjtU6mFDVsqRv+QUmSMKit1IzV3LNxg nNow== 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:mime-version:content-transfer-encoding; bh=WvRrtRnP6kxjeCT7/zaUsi42Wm0dzFMHEoCnAof5sGY=; b=L6xriCyJilQuQbwI/SgovxYqa8KEDc0EEzQyqVA7PtCd5S+70CQ+WHjVlp8Lm7mgxY et30+4pRQqVtNKMgmVBkkj+CSMWqMfpykYVRvM05N+ufkLxS7VQxVNapMIrjyk4NIL74 YEDDc20jjip/ikBS+75ZlD8SrWZUq6lO59gt/ZBPWnkPT5aGEKvpRHvLkuO9TmOrZbv8 I12OnSIZlieNwfg3bzO5tajgBtCU7UwB6utxrmAgNBzmcXWu6OOKMDla/oA/npPgExcp VT206S91cyPP4HV2TgWp1FDB0qLuXzZE1BfncVSFs3Dxurbbf5usq2U9lEpVI/D+LOru 3aow== X-Gm-Message-State: APjAAAWuVVsplcID1aqNfUeaj8Ps3ZP97ZlhwIwA7aJm/Ol+GYU9Wg1X yQmwF2qs3JOKV2I+Y6yjhrrSZyfI2zw= X-Google-Smtp-Source: APXvYqxoJS+VfGceeeSHULxRWLp358TMi4qlcZ0wGFmwy+CDge26baLLeUT1ijFiYQa1e8MWOGEOqw== X-Received: by 2002:a0c:ba99:: with SMTP id x25mr31734561qvf.212.1557879069188; Tue, 14 May 2019 17:11:09 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id t129sm135297qkc.24.2019.05.14.17.11.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 17:11:08 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hQhAw-0001Mj-LU; Tue, 14 May 2019 20:49:38 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 01/20] ibdiags: Add SWITCH_FALLTHROUGH Date: Tue, 14 May 2019 20:49:17 -0300 Message-Id: <20190514234936.5175-2-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514234936.5175-1-jgg@ziepe.ca> References: <20190514234936.5175-1-jgg@ziepe.ca> MIME-Version: 1.0 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: Jason Gunthorpe Mark this case as deliberate fall through Signed-off-by: Jason Gunthorpe --- ibdiags/src/ibportstate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ibdiags/src/ibportstate.c b/ibdiags/src/ibportstate.c index cfe30655e67fd5..60afcb45a3ee07 100644 --- a/ibdiags/src/ibportstate.c +++ b/ibdiags/src/ibportstate.c @@ -48,6 +48,8 @@ #include "ibdiag_common.h" +#include + enum port_ops { QUERY, ENABLE, @@ -578,6 +580,7 @@ int main(int argc, char **argv) printf("Port is already in enable state\n"); goto close_port; } + SWITCH_FALLTHROUGH; case ENABLE: case RESET: /* Polling */ From patchwork Tue May 14 23:49:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10944083 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4580A1395 for ; Tue, 14 May 2019 23:49:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3030128984 for ; Tue, 14 May 2019 23:49:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1F82D2898B; Tue, 14 May 2019 23:49:43 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 A880628984 for ; Tue, 14 May 2019 23:49:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726260AbfENXtl (ORCPT ); Tue, 14 May 2019 19:49:41 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:33334 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726383AbfENXtl (ORCPT ); Tue, 14 May 2019 19:49:41 -0400 Received: by mail-qk1-f193.google.com with SMTP id k189so424445qkc.0 for ; Tue, 14 May 2019 16:49:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QbtdrFqkxPgdgaXBQcuFFa/5Tuj+fTnf34Xq/VloPvE=; b=ZA6pR3GDDOoi8TGBm+OQ9lMnqHXtc+pqi63JEP2vQvuqvoh3U11W3/wGQgjCB3AoIZ e4eyRlgu2O1J1RZAbI61yMOjrgic3lQ6mA/PM8EnDXOyl5hZVwTufQU6LLpSf5f3iNe2 /Bcv/lLcYR3aASbZSdQTjE/H0pf7Tm474NNdWazx/mE8x6VbnS3QM94V85Rqpa+lHPeO BdqYFi30AdN5ScbrX+TuHvkwHTtr+F8v7jMOukSzA5sDyLBJyBStlEhQsfDGdeAmTOGV v+LhKE+vk9++foFMCiEW80rgA1JZyM3OfuRLiNTUxvilXigrlOvRBg7QkOU5t6n9Ivxb XphQ== 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:mime-version:content-transfer-encoding; bh=QbtdrFqkxPgdgaXBQcuFFa/5Tuj+fTnf34Xq/VloPvE=; b=rLCJJtCjuVAn6meQzVcCjwESlgGWc15T1l+We9fP8fNSNLx6t8oFFodeTjv1Bpqyxk 1iv7/AEau1/h6MzQn5rbELD30QJBo2lTtX0j2c/6jsm0cq17qgpJdwyqp1ioonkQOdrC xCpHxI6iOTQXSY+pOKWj3s2GP5MCEaggnNR906KBPktSSFBrxYh5dPrgt4JkkwZoqtRC SFRlx0nvOcaGlWTo3YZSzlMd6jqeetM1aoC9NHMn9qW9VD05WVy+7ZOoTspFZzQJVn9a fFCvZG9V9awB0dkfSFBzOSNAzyaQIlsNrtu5gAkNwLueHizauX8FRtvczL5ieYy++ses x8Lg== X-Gm-Message-State: APjAAAUiQQ3f6K/Si6rvvi8HmK4EJPlJgxZVpmRLzTLfCk789YuRzMFn iNI9FtbryI/zgM1RPDzmpTJuNZFabjA= X-Google-Smtp-Source: APXvYqyt+EDQaw8fmnxVTl9o4aYttjmtcILZgGFqNgaBfpiH56jcG2OOlTUoZKysMx7tMuT2MxxP5Q== X-Received: by 2002:a37:9b88:: with SMTP id d130mr28810709qke.278.1557877780203; Tue, 14 May 2019 16:49:40 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id j29sm143302qki.39.2019.05.14.16.49.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 16:49:39 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hQhAw-0001Mp-Mk; Tue, 14 May 2019 20:49:38 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 02/20] ibdiags: Add required definitions to rdma-core config.h Date: Tue, 14 May 2019 20:49:18 -0300 Message-Id: <20190514234936.5175-3-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514234936.5175-1-jgg@ziepe.ca> References: <20190514234936.5175-1-jgg@ziepe.ca> MIME-Version: 1.0 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: Jason Gunthorpe Signed-off-by: Jason Gunthorpe --- CMakeLists.txt | 2 ++ buildlib/config.h.in | 4 ++++ ibdiags/src/ibdiag_common.c | 5 ++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31100e267f2150..5cb3c32c318821 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,6 +97,8 @@ set(BUILD_STATIC_LIB ${CMAKE_BINARY_DIR}/lib/statics) set(BUILD_ETC ${CMAKE_BINARY_DIR}/etc) set(BUILD_PYTHON ${CMAKE_BINARY_DIR}/python) +set(IBDIAG_CONFIG_PATH "${CMAKE_INSTALL_FULL_SYSCONFDIR}/infiniband-diags") + set(CMAKE_INSTALL_INITDDIR "${CMAKE_INSTALL_SYSCONFDIR}/init.d" CACHE PATH "Location for init.d files") set(CMAKE_INSTALL_SYSTEMD_SERVICEDIR "${CMAKE_INSTALL_PREFIX}/lib/systemd/system" diff --git a/buildlib/config.h.in b/buildlib/config.h.in index 0754d249423476..b4cb669b7be4bf 100644 --- a/buildlib/config.h.in +++ b/buildlib/config.h.in @@ -7,6 +7,8 @@ #define HAVE_ISBLANK 1 #define HAVE_BUILTIN_CLZL 1 +#define PACKAGE_VERSION "@PACKAGE_VERSION@" + // FIXME: Remove this, The cmake version hard-requires new style CLOEXEC support #define STREAM_CLOEXEC "e" @@ -29,6 +31,8 @@ #define IBACM_IBACME_SERVER_PATH "@CMAKE_INSTALL_FULL_RUNDIR@/" IBACM_SERVER_BASE #define IBACM_SERVER_PATH "@CMAKE_INSTALL_FULL_RUNDIR@/ibacm.sock" +#define IBDIAG_CONFIG_PATH "@IBDIAG_CONFIG_PATH@" + #define VERBS_PROVIDER_DIR "@VERBS_PROVIDER_DIR@" #define VERBS_PROVIDER_SUFFIX "@IBVERBS_PROVIDER_SUFFIX@" #define IBVERBS_PABI_VERSION @IBVERBS_PABI_VERSION@ diff --git a/ibdiags/src/ibdiag_common.c b/ibdiags/src/ibdiag_common.c index 293b9afce0a021..a5056ad244c7c3 100644 --- a/ibdiags/src/ibdiag_common.c +++ b/ibdiags/src/ibdiag_common.c @@ -58,7 +58,6 @@ #include #include #include -#include int ibverbose; enum MAD_DEST ibd_dest_type = IB_DEST_LID; @@ -84,8 +83,8 @@ static const struct ibdiag_opt *opts_map[256]; static const char *get_build_version(void) { - return "BUILD VERSION: " IBDIAG_VERSION " Build date: " __DATE__ " " - __TIME__; + return "BUILD VERSION: " PACKAGE_VERSION " Build date: " __DATE__ + " " __TIME__; } static void pretty_print(int start, int width, const char *str) From patchwork Tue May 14 23:49:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10944103 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6DAF01515 for ; Tue, 14 May 2019 23:49:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FD43288DA for ; Tue, 14 May 2019 23:49:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 54CF728994; Tue, 14 May 2019 23:49:49 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 98B542898B for ; Tue, 14 May 2019 23:49:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726416AbfENXtn (ORCPT ); Tue, 14 May 2019 19:49:43 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:44624 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726383AbfENXtm (ORCPT ); Tue, 14 May 2019 19:49:42 -0400 Received: by mail-qt1-f193.google.com with SMTP id f24so1179140qtk.11 for ; Tue, 14 May 2019 16:49:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=51BhS5jEUBebH+qPlsnkv6c6og+FKGG9kgVILpb77gM=; b=AcJhoKYFT5+0u90Xfd7ozmjqo3C3DGqJLogN6n9242vdJRLAHYsDn9O2K+JqcKNNPn 6+2GXVRPkjQ18ngs4CbjI6dIY9PeKGXyyFVKjFvEvi7Ha6K8x4DJpTcjxA1RdjcvIcgl w7JDfcGT7OnvihjIMVQ1RnVPyk+wI3YjnokUeWF/0NEuGFjRos66UxF8LpPJZHVa5eq7 ylIw20O5G9npelOslL23XJ7YGg3lGL+oqAbna4086fK2N1fStYW51mGtoeBS6BL1+Mhz KHoL7wYpp0CvKpakxq0UYUIBxH5SeHBYGBvQzCAT928FE0EDxgBaZNQUVJP5MlnyrYWP WXiA== 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:mime-version:content-transfer-encoding; bh=51BhS5jEUBebH+qPlsnkv6c6og+FKGG9kgVILpb77gM=; b=WZVWR4rXF16M30p98/cQ54q7TNvb1YZdEKRGa1KAjnEFL8j4M47LzdJ/42FMw+fIRr WntzhWxMcSdL7aEZUEmePD0+fMmTuLCfZ5EYpdDsilBptTNiEOpMwK+4prPQi1Kke/Zc o7KfGgkN8j5HiH2xgz8s7CuPhVb929+OCcOCkaQidFSwdgOSbEdjA036WGdm5rYpI55V l0G3/c2+QuVdYH0Kb66kAS8miE6xMQM8Pa7KYd3z4WoWCFTq5EvWk4q55qLrcRoTGQbU l5dEhqXuKygSgAZaB+cIybW+N8Txhu2oZC9+JK4sDMkGe41cm36aQ7Vdvd/lJBumY5iz DE5w== X-Gm-Message-State: APjAAAWf29xy2zai4bvU9Cnnt0U10Y+zRTrUaNSyO6uq/0kn+oedtaix fyv23gKagOJR+Rskm5Y5luQeiUjQ6jg= X-Google-Smtp-Source: APXvYqw9AYtnpxVaLUBSPruo0tBU7mTw4bVFEtEFStJvLglIHxWjE5Aag6yOm0R/y+RwBN+NQSQBGA== X-Received: by 2002:a0c:ff0b:: with SMTP id w11mr30651894qvt.33.1557877781361; Tue, 14 May 2019 16:49:41 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id y18sm245275qty.78.2019.05.14.16.49.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 16:49:39 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hQhAw-0001Mv-Op; Tue, 14 May 2019 20:49:38 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 03/20] ibdiags: Remove unneeded HAVE_ checks Date: Tue, 14 May 2019 20:49:19 -0300 Message-Id: <20190514234936.5175-4-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514234936.5175-1-jgg@ziepe.ca> References: <20190514234936.5175-1-jgg@ziepe.ca> MIME-Version: 1.0 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: Jason Gunthorpe Signed-off-by: Jason Gunthorpe --- ibdiags/src/ibstat.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/ibdiags/src/ibstat.c b/ibdiags/src/ibstat.c index 0e79f21c544c52..61c6611a05043e 100644 --- a/ibdiags/src/ibstat.c +++ b/ibdiags/src/ibstat.c @@ -193,9 +193,7 @@ static int port_dump(umad_port_t * port, int alone) printf("%sSM lid: %d\n", pre, port->sm_lid); printf("%sCapability mask: 0x%08x\n", pre, ntohl(port->capmask)); printf("%sPort GUID: 0x%016" PRIx64 "\n", pre, be64toh(port->port_guid)); -#ifdef HAVE_UMAD_PORT_LINK_LAYER printf("%sLink layer: %s\n", pre, port->link_layer); -#endif return 0; } From patchwork Tue May 14 23:49:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10944085 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B18E41398 for ; Tue, 14 May 2019 23:49:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0E5F288DA for ; Tue, 14 May 2019 23:49:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94BC12898B; Tue, 14 May 2019 23:49:43 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 699A9288DA for ; Tue, 14 May 2019 23:49:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726475AbfENXtl (ORCPT ); Tue, 14 May 2019 19:49:41 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:43966 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726260AbfENXtl (ORCPT ); Tue, 14 May 2019 19:49:41 -0400 Received: by mail-qk1-f196.google.com with SMTP id z6so383244qkl.10 for ; Tue, 14 May 2019 16:49:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PZJmAdsM1j5J4rhFf5Uox4/M+tr7rrZWd0zdOvzMLr4=; b=LldYz+n4FWNWmVal7J4wtcTlqKju6D1oHSXdVkwi9k+47W0l4i8mKFdACqw5mD67MV 87SooOoi6jyCTyPFH/V5W79s2OmtWe3HV/zwZYbmUopJl2Dj7dFjMlRrYDOeUggJOmyl TuvoEBQJTnJJb+8UyJaU3zIgNHokatTs3QZ1iPyp1fRRzHNpFGVlncmlfN0WkvmdLiHv avB+ecqHETFH+IFJRMiVromzVdZREpVPwHYUuFucfhppKtyzDIRXVkCP70DQAgT/sMnU WXFO4Y5HoANw9iSFQgCRvx959ooB4FS5hLsgrwhMTFEGuml5xZUngs3q8O2IRv884V9U Tvyg== 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:mime-version:content-transfer-encoding; bh=PZJmAdsM1j5J4rhFf5Uox4/M+tr7rrZWd0zdOvzMLr4=; b=kPBhKvusuacXkrIZyw1z08BdEX6Xpqnm2ecnXQfwHv7LyfHx0P9XCfMD2iifkRaD1N 6Z2HGgyTbiJnTpaqBXjeoRs6qv1uvRPFSbjnkkYIwINBKzMCLU56cdTBMxixIElGLKCL hUKHgdxjDCLJdpFT6FOyWT3cxWoypKNUJURLgyCx/e/ewhDelmk+viFefxMq2V0+C8DQ eWJxZy+zdFWVY5nsnK2d3o0MaoVHFvT2iqgP0prY1khvB8Ff9fLf8E/5oyn6Hi4sOzwW ANdB5NNpfh6Qvm0g2wqzMTHUvDlHv91BVSAdo+LyoG+cO7rfJTqy1ySAMq0b7rrcrO4l D2Rg== X-Gm-Message-State: APjAAAUYboJlQRwgFu4OIpDLOeVckL7ZjXnf8VqQQMHfiN0skC6ogR1c sh+jHq/sAn1HcjLT5qzs8gReyvM6X0Q= X-Google-Smtp-Source: APXvYqxDi3LJnRdTtc1q4QiMdBQJr7vDqV9Wz4vDgRb7qSsZDH4QMW5XTo8euYeQoM3eOnojrVcgUQ== X-Received: by 2002:a05:620a:15ac:: with SMTP id f12mr20511995qkk.311.1557877779995; Tue, 14 May 2019 16:49:39 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id v126sm115925qkh.86.2019.05.14.16.49.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 16:49:39 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hQhAw-0001N1-Q9; Tue, 14 May 2019 20:49:38 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 04/20] ibdiags: Remove config.h and HAVE_CONFIG_H Date: Tue, 14 May 2019 20:49:20 -0300 Message-Id: <20190514234936.5175-5-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514234936.5175-1-jgg@ziepe.ca> References: <20190514234936.5175-1-jgg@ziepe.ca> MIME-Version: 1.0 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: Jason Gunthorpe Only files that actually need config.h should include it. Signed-off-by: Jason Gunthorpe --- ibdiags/libibmad/src/bm.c | 4 ---- ibdiags/libibmad/src/cc.c | 4 ---- ibdiags/libibmad/src/dump.c | 4 ---- ibdiags/libibmad/src/fields.c | 4 ---- ibdiags/libibmad/src/gs.c | 4 ---- ibdiags/libibmad/src/mad.c | 4 ---- ibdiags/libibmad/src/portid.c | 4 ---- ibdiags/libibmad/src/register.c | 4 ---- ibdiags/libibmad/src/resolve.c | 4 ---- ibdiags/libibmad/src/rpc.c | 4 ---- ibdiags/libibmad/src/sa.c | 4 ---- ibdiags/libibmad/src/serv.c | 4 ---- ibdiags/libibmad/src/smp.c | 4 ---- ibdiags/libibmad/src/vendor.c | 4 ---- ibdiags/libibnetdisc/src/chassis.c | 4 ---- ibdiags/libibnetdisc/src/ibnetdisc.c | 4 ---- ibdiags/libibnetdisc/src/ibnetdisc_cache.c | 4 ---- ibdiags/libibnetdisc/src/query_smp.c | 4 ---- ibdiags/libibnetdisc/test/testleaks.c | 4 ---- ibdiags/src/dump_fts.c | 4 ---- ibdiags/src/ibaddr.c | 4 ---- ibdiags/src/ibcacheedit.c | 4 ---- ibdiags/src/ibccconfig.c | 4 ---- ibdiags/src/ibccquery.c | 4 ---- ibdiags/src/iblinkinfo.c | 4 ---- ibdiags/src/ibnetdiscover.c | 4 ---- ibdiags/src/ibping.c | 4 ---- ibdiags/src/ibportstate.c | 4 ---- ibdiags/src/ibqueryerrors.c | 4 +--- ibdiags/src/ibroute.c | 4 ---- ibdiags/src/ibstat.c | 4 ---- ibdiags/src/ibsysstat.c | 4 ---- ibdiags/src/ibtracert.c | 4 ---- ibdiags/src/mcm_rereg_test.c | 4 ---- ibdiags/src/perfquery.c | 4 ---- ibdiags/src/saquery.c | 4 ---- ibdiags/src/sminfo.c | 4 ---- ibdiags/src/smpdump.c | 4 ---- ibdiags/src/smpquery.c | 4 ---- ibdiags/src/vendstat.c | 4 ---- 40 files changed, 1 insertion(+), 159 deletions(-) diff --git a/ibdiags/libibmad/src/bm.c b/ibdiags/libibmad/src/bm.c index 8b3d342284ce00..921dbb85f788db 100644 --- a/ibdiags/libibmad/src/bm.c +++ b/ibdiags/libibmad/src/bm.c @@ -31,10 +31,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include diff --git a/ibdiags/libibmad/src/cc.c b/ibdiags/libibmad/src/cc.c index cae174e702d74b..5cc2ebb6d07a22 100644 --- a/ibdiags/libibmad/src/cc.c +++ b/ibdiags/libibmad/src/cc.c @@ -31,10 +31,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/libibmad/src/dump.c b/ibdiags/libibmad/src/dump.c index d1a69115f06313..1d3c37510f42f6 100644 --- a/ibdiags/libibmad/src/dump.c +++ b/ibdiags/libibmad/src/dump.c @@ -34,10 +34,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/libibmad/src/fields.c b/ibdiags/libibmad/src/fields.c index 45eafd94921060..233eb1609f69e5 100644 --- a/ibdiags/libibmad/src/fields.c +++ b/ibdiags/libibmad/src/fields.c @@ -33,10 +33,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/libibmad/src/gs.c b/ibdiags/libibmad/src/gs.c index 90db7e25e7320d..7f9c12960303e0 100644 --- a/ibdiags/libibmad/src/gs.c +++ b/ibdiags/libibmad/src/gs.c @@ -32,10 +32,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/libibmad/src/mad.c b/ibdiags/libibmad/src/mad.c index 2ca317efc9296d..d22226429d808b 100644 --- a/ibdiags/libibmad/src/mad.c +++ b/ibdiags/libibmad/src/mad.c @@ -33,10 +33,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/libibmad/src/portid.c b/ibdiags/libibmad/src/portid.c index 40754fe2e4f7f7..ea02ca9ae50af0 100644 --- a/ibdiags/libibmad/src/portid.c +++ b/ibdiags/libibmad/src/portid.c @@ -31,10 +31,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/libibmad/src/register.c b/ibdiags/libibmad/src/register.c index d046264bdc69a9..854e46241e96a2 100644 --- a/ibdiags/libibmad/src/register.c +++ b/ibdiags/libibmad/src/register.c @@ -31,10 +31,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/libibmad/src/resolve.c b/ibdiags/libibmad/src/resolve.c index 542aa16167c872..2c397eb1ad22fb 100644 --- a/ibdiags/libibmad/src/resolve.c +++ b/ibdiags/libibmad/src/resolve.c @@ -32,10 +32,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/libibmad/src/rpc.c b/ibdiags/libibmad/src/rpc.c index a05d71ffe12d5b..9e3d88e336238e 100644 --- a/ibdiags/libibmad/src/rpc.c +++ b/ibdiags/libibmad/src/rpc.c @@ -33,10 +33,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/libibmad/src/sa.c b/ibdiags/libibmad/src/sa.c index 09bf58824ae530..9dfec937143ca6 100644 --- a/ibdiags/libibmad/src/sa.c +++ b/ibdiags/libibmad/src/sa.c @@ -31,10 +31,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/libibmad/src/serv.c b/ibdiags/libibmad/src/serv.c index 74dbc8b519b385..040bb62b6ac12c 100644 --- a/ibdiags/libibmad/src/serv.c +++ b/ibdiags/libibmad/src/serv.c @@ -31,10 +31,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/libibmad/src/smp.c b/ibdiags/libibmad/src/smp.c index 14c74ed55277cc..07d0ad208a6c2b 100644 --- a/ibdiags/libibmad/src/smp.c +++ b/ibdiags/libibmad/src/smp.c @@ -32,10 +32,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/libibmad/src/vendor.c b/ibdiags/libibmad/src/vendor.c index 939cc2a7b3b125..f96ba2468d003f 100644 --- a/ibdiags/libibmad/src/vendor.c +++ b/ibdiags/libibmad/src/vendor.c @@ -32,10 +32,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/libibnetdisc/src/chassis.c b/ibdiags/libibnetdisc/src/chassis.c index c1eef73664a377..a3ec1d82807c8d 100644 --- a/ibdiags/libibnetdisc/src/chassis.c +++ b/ibdiags/libibnetdisc/src/chassis.c @@ -38,10 +38,6 @@ /* FABRIC SCANNER SPECIFIC DATA */ /*========================================================*/ -#if HAVE_CONFIG_H -#include -#endif /* HAVE_CONFIG_H */ - #include #include diff --git a/ibdiags/libibnetdisc/src/ibnetdisc.c b/ibdiags/libibnetdisc/src/ibnetdisc.c index c4206eb6b65bd4..0c60b4419a9c8e 100644 --- a/ibdiags/libibnetdisc/src/ibnetdisc.c +++ b/ibdiags/libibnetdisc/src/ibnetdisc.c @@ -34,10 +34,6 @@ * */ -#if HAVE_CONFIG_H -#include -#endif /* HAVE_CONFIG_H */ - #define _GNU_SOURCE #include #include diff --git a/ibdiags/libibnetdisc/src/ibnetdisc_cache.c b/ibdiags/libibnetdisc/src/ibnetdisc_cache.c index 384a27c99501d7..605582fca6cccc 100644 --- a/ibdiags/libibnetdisc/src/ibnetdisc_cache.c +++ b/ibdiags/libibnetdisc/src/ibnetdisc_cache.c @@ -33,10 +33,6 @@ * */ -#if HAVE_CONFIG_H -#include -#endif /* HAVE_CONFIG_H */ - #define _GNU_SOURCE #include #include diff --git a/ibdiags/libibnetdisc/src/query_smp.c b/ibdiags/libibnetdisc/src/query_smp.c index 26a5909524f777..47693bcf697cfa 100644 --- a/ibdiags/libibnetdisc/src/query_smp.c +++ b/ibdiags/libibnetdisc/src/query_smp.c @@ -32,10 +32,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/libibnetdisc/test/testleaks.c b/ibdiags/libibnetdisc/test/testleaks.c index 508c5ae2e84112..0723b109854de8 100644 --- a/ibdiags/libibnetdisc/test/testleaks.c +++ b/ibdiags/libibnetdisc/test/testleaks.c @@ -33,10 +33,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #define _GNU_SOURCE #include #include diff --git a/ibdiags/src/dump_fts.c b/ibdiags/src/dump_fts.c index 8a5b3e20da6b45..6aba80827d279c 100644 --- a/ibdiags/src/dump_fts.c +++ b/ibdiags/src/dump_fts.c @@ -33,10 +33,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/src/ibaddr.c b/ibdiags/src/ibaddr.c index 4c2b67c7428d6f..19d2ec31a43206 100644 --- a/ibdiags/src/ibaddr.c +++ b/ibdiags/src/ibaddr.c @@ -32,10 +32,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/src/ibcacheedit.c b/ibdiags/src/ibcacheedit.c index 03e4a7efeaeae5..4b8dbcb00d1d11 100644 --- a/ibdiags/src/ibcacheedit.c +++ b/ibdiags/src/ibcacheedit.c @@ -31,10 +31,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #define _GNU_SOURCE #include #include diff --git a/ibdiags/src/ibccconfig.c b/ibdiags/src/ibccconfig.c index 296d3f791419d7..7a02ee7f81794a 100644 --- a/ibdiags/src/ibccconfig.c +++ b/ibdiags/src/ibccconfig.c @@ -33,10 +33,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/src/ibccquery.c b/ibdiags/src/ibccquery.c index 390ea71d55b0df..e9e8b4969f6cc9 100644 --- a/ibdiags/src/ibccquery.c +++ b/ibdiags/src/ibccquery.c @@ -33,10 +33,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/src/iblinkinfo.c b/ibdiags/src/iblinkinfo.c index 7060959993b0e9..557faad0b6f3bf 100644 --- a/ibdiags/src/iblinkinfo.c +++ b/ibdiags/src/iblinkinfo.c @@ -34,10 +34,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #define _GNU_SOURCE #include #include diff --git a/ibdiags/src/ibnetdiscover.c b/ibdiags/src/ibnetdiscover.c index ba2e04a15783c8..e8c8b19be4e592 100644 --- a/ibdiags/src/ibnetdiscover.c +++ b/ibdiags/src/ibnetdiscover.c @@ -34,10 +34,6 @@ * */ -#if HAVE_CONFIG_H -#include -#endif /* HAVE_CONFIG_H */ - #define _GNU_SOURCE #include #include diff --git a/ibdiags/src/ibping.c b/ibdiags/src/ibping.c index 9a236fe8233f85..0d10da0b34da87 100644 --- a/ibdiags/src/ibping.c +++ b/ibdiags/src/ibping.c @@ -31,10 +31,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/src/ibportstate.c b/ibdiags/src/ibportstate.c index 60afcb45a3ee07..d57554d7067711 100644 --- a/ibdiags/src/ibportstate.c +++ b/ibdiags/src/ibportstate.c @@ -33,10 +33,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/src/ibqueryerrors.c b/ibdiags/src/ibqueryerrors.c index dcda64da529a51..332b7ce764e097 100644 --- a/ibdiags/src/ibqueryerrors.c +++ b/ibdiags/src/ibqueryerrors.c @@ -35,9 +35,7 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ +#include #define _GNU_SOURCE #include diff --git a/ibdiags/src/ibroute.c b/ibdiags/src/ibroute.c index 8108362e3a45cd..6a59d63483ad3f 100644 --- a/ibdiags/src/ibroute.c +++ b/ibdiags/src/ibroute.c @@ -32,10 +32,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/src/ibstat.c b/ibdiags/src/ibstat.c index 61c6611a05043e..4601f2ad57d36c 100644 --- a/ibdiags/src/ibstat.c +++ b/ibdiags/src/ibstat.c @@ -34,10 +34,6 @@ #define _GNU_SOURCE -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/src/ibsysstat.c b/ibdiags/src/ibsysstat.c index 4d8267e2eba4ed..6ff7ca0c44ae47 100644 --- a/ibdiags/src/ibsysstat.c +++ b/ibdiags/src/ibsysstat.c @@ -31,10 +31,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/src/ibtracert.c b/ibdiags/src/ibtracert.c index 7bdb1e0034e8ea..b7d383a8d48947 100644 --- a/ibdiags/src/ibtracert.c +++ b/ibdiags/src/ibtracert.c @@ -33,10 +33,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #define _GNU_SOURCE #include #include diff --git a/ibdiags/src/mcm_rereg_test.c b/ibdiags/src/mcm_rereg_test.c index f521f22277cece..66c066b40e40cc 100644 --- a/ibdiags/src/mcm_rereg_test.c +++ b/ibdiags/src/mcm_rereg_test.c @@ -31,10 +31,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/src/perfquery.c b/ibdiags/src/perfquery.c index 6bb29e6f82c335..b921e3d402854c 100644 --- a/ibdiags/src/perfquery.c +++ b/ibdiags/src/perfquery.c @@ -34,10 +34,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/src/saquery.c b/ibdiags/src/saquery.c index 379b9436c794d5..f50430818c7863 100644 --- a/ibdiags/src/saquery.c +++ b/ibdiags/src/saquery.c @@ -38,10 +38,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/src/sminfo.c b/ibdiags/src/sminfo.c index 494c95be239e91..7193a999aee5cf 100644 --- a/ibdiags/src/sminfo.c +++ b/ibdiags/src/sminfo.c @@ -32,10 +32,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/src/smpdump.c b/ibdiags/src/smpdump.c index ece87bf2bb49e6..b5bb87ba30ed48 100644 --- a/ibdiags/src/smpdump.c +++ b/ibdiags/src/smpdump.c @@ -33,10 +33,6 @@ #define _GNU_SOURCE -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/src/smpquery.c b/ibdiags/src/smpquery.c index 6d54e65fd49181..210bad41fdf88f 100644 --- a/ibdiags/src/smpquery.c +++ b/ibdiags/src/smpquery.c @@ -32,10 +32,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include diff --git a/ibdiags/src/vendstat.c b/ibdiags/src/vendstat.c index 49036d4f127f30..2f7d7bd877b23d 100644 --- a/ibdiags/src/vendstat.c +++ b/ibdiags/src/vendstat.c @@ -32,10 +32,6 @@ * */ -#if HAVE_CONFIG_H -# include -#endif /* HAVE_CONFIG_H */ - #include #include #include From patchwork Tue May 14 23:49:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10944087 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2C6C21515 for ; Tue, 14 May 2019 23:49:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1996B2898B for ; Tue, 14 May 2019 23:49:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09B0728987; Tue, 14 May 2019 23:49:44 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 B39C728987 for ; Tue, 14 May 2019 23:49:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726503AbfENXtm (ORCPT ); Tue, 14 May 2019 19:49:42 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:38577 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726461AbfENXtl (ORCPT ); Tue, 14 May 2019 19:49:41 -0400 Received: by mail-qt1-f193.google.com with SMTP id d13so1229649qth.5 for ; Tue, 14 May 2019 16:49:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tsMTShzm/koB+U9S1nxSpT0oAMcFXUOyuXFGB0JtrOs=; b=Liahz+k2gNYSRs9RSKClpiyffK4DkpkxE1+9Ioc1xKB9awbvVeM6Rg6fSrteoCltgr pF35xFoeqDm0Kn48S6IgAtwyRVu7EuSyOB2VQLf5kcXAd5FtMqxX/o12FIOi9DmPHaT9 kB7td2X6he8PzAYzf29ND37a4e/aMBuwELtB50MRl6U9lCyCRrkibyMRxV7S0GjwAd/J 5dSjBCjUo/mzInbrFo0+C5F9OH8OVV9Jfxi+XJgG42z8gJxV5qWt7bTKVg+IoKby6NpI bdZy7U2KELuwNOoxPuisJ8IvDSul0avVOGpiU82QytgLjm1xn3sgp91uYF80XSyH4V0c qKaA== 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:mime-version:content-transfer-encoding; bh=tsMTShzm/koB+U9S1nxSpT0oAMcFXUOyuXFGB0JtrOs=; b=YcnRWKHOFNtRunI7ZAGiQbLI9Hr1dcDSzN25rGfxboVK91flTlib6q9ROcaz3yFuux SDbmwNgNPtpNnH7KBE0oH75vNXCkIe44a5KRL0qZ9aNK/+NvryBd6reBMlLcjZhI8Ms9 f4eC4ueBOtW3p3S8hnSVOZh0U4YI2BwVaMwLmfYtW3e6bfGEo1iglZzKu8iux9R27HLD dlVmmIYZF4ATDCF761jjVboVN4Sy4uQS8lf2HebKZQfxToLnDxcb/x2ocnKAY5mW56wN ItroJebPr4p361UAI0ru4drfShWADHvfq6InsTW2vqh9aeBHcc0iolTiR+uv/yiC42XV Zn+g== X-Gm-Message-State: APjAAAU+5xrFWFNStgewmuCUiv8s9R+86z6aFxA5ae0AASBqN2gvu6tg bVTvBic8dL+Y6YQZF8hCO3absNabuL8= X-Google-Smtp-Source: APXvYqyrBCxsXwhjtrvjOxVbw7CL3aeqQKR/5cLxXQLZ+q63cmHkFyoOFbEYOJf2vFp8V0aYEYj7vg== X-Received: by 2002:ac8:8fb:: with SMTP id y56mr32516763qth.160.1557877780911; Tue, 14 May 2019 16:49:40 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id g9sm200605qtj.67.2019.05.14.16.49.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 16:49:39 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hQhAw-0001N7-Ra; Tue, 14 May 2019 20:49:38 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 05/20] ibdiags: Don't use __DATE__ and __TIME__ Date: Tue, 14 May 2019 20:49:21 -0300 Message-Id: <20190514234936.5175-6-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514234936.5175-1-jgg@ziepe.ca> References: <20190514234936.5175-1-jgg@ziepe.ca> MIME-Version: 1.0 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: Jason Gunthorpe This prevents the build from being reproducible. Signed-off-by: Jason Gunthorpe --- ibdiags/src/ibdiag_common.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ibdiags/src/ibdiag_common.c b/ibdiags/src/ibdiag_common.c index a5056ad244c7c3..6b1a31f877e16d 100644 --- a/ibdiags/src/ibdiag_common.c +++ b/ibdiags/src/ibdiag_common.c @@ -83,8 +83,7 @@ static const struct ibdiag_opt *opts_map[256]; static const char *get_build_version(void) { - return "BUILD VERSION: " PACKAGE_VERSION " Build date: " __DATE__ - " " __TIME__; + return "BUILD VERSION: " PACKAGE_VERSION; } static void pretty_print(int start, int width, const char *str) From patchwork Tue May 14 23:49:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10944091 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4755A1395 for ; Tue, 14 May 2019 23:49:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36B2328984 for ; Tue, 14 May 2019 23:49:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B47928987; Tue, 14 May 2019 23:49:45 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 00D9A288DA for ; Tue, 14 May 2019 23:49:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726495AbfENXtn (ORCPT ); Tue, 14 May 2019 19:49:43 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:43436 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726416AbfENXtl (ORCPT ); Tue, 14 May 2019 19:49:41 -0400 Received: by mail-qt1-f194.google.com with SMTP id i26so1186854qtr.10 for ; Tue, 14 May 2019 16:49:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UL2wNBlXg9debLwIHryy/HadoDYIIpSBighsnapG9WM=; b=ONInj+Ce8zHbbWztyCvxbZTeN+En48v/EGz2jvTEnrv6htbnlFcJygx9iLRkjsQbZe TzvrIZb+JwFZoQpaBLZLYOU4wwzKrrgz6d54KIt5kHIwhBQCPQ0ixbWtqwsmsoUqw4pj 9meJfF5X2iF6TKb68qwP/VvsXhrElKieE+Y3tWggYn1a0/jmYFG8cy+RfZcnkepmIP3J y0D9v/AW6NKyjAJJBUnb8c3G8wo/pSEzo9xvI3yjCPIQxyERA2x7+ziL6fe/5X/4rMpl XSwsKD6qpnhbjHP/unyNeXEtf5MQpOYYfwM20gVd3lKgag+wLdSoKLvvT4R5RdSmh4Uz w+Lw== 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:mime-version:content-transfer-encoding; bh=UL2wNBlXg9debLwIHryy/HadoDYIIpSBighsnapG9WM=; b=OLEtFwGsGLJ1So+caFDZ9KS+bBtHxbGwus9I8QwxY8FlJDuCVYK+ll3qANM3eTv2PJ eFvmJA7jwi6ChY8UYC7Q5Rj0HhzGTObKL8j7KeIYDsAa72kN/EH83pCl8m5fw8XWWlSL SidCUbc7/omGhX/WQwjJ+E6HkXs770tpPFJ+YIJfE/Q03m4XVm5bJmi+ggXZx8kWI5v8 ZInh/bGjLvzlhN6AXbH6OkEusPKl46FnBdiXqDyOh8sfSwo/d+33AHoFNPpYu+J3LIdb 8MkgQGTwHu1BtE2HiXmPeu44siiOv7YEf09XOYT3vxPKfr8VXdCwyicx+zJvslOmpWaj dRXw== X-Gm-Message-State: APjAAAXkI3mCnUUpLkrof2jWdQzqC+FKJvGakLfzTzrcwq57koZULdIc ykhNV6Ik9OjtWz2gDlADBDf36HRxrwc= X-Google-Smtp-Source: APXvYqyCEC9PbFL8Aal8t+KKp5ZUpy9ElB6w7Nx90gLh4S0Y8PKHs0ge5Tm7eS7EGcRUXuM2JXSZoQ== X-Received: by 2002:aed:2a25:: with SMTP id c34mr33303643qtd.62.1557877780508; Tue, 14 May 2019 16:49:40 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id u5sm128664qkk.85.2019.05.14.16.49.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 16:49:39 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hQhAw-0001ND-TN; Tue, 14 May 2019 20:49:38 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 06/20] build: Support rst as a man page option Date: Tue, 14 May 2019 20:49:22 -0300 Message-Id: <20190514234936.5175-7-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514234936.5175-1-jgg@ziepe.ca> References: <20190514234936.5175-1-jgg@ziepe.ca> MIME-Version: 1.0 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: Jason Gunthorpe infiniband-diags uses rst as a man page preprocessor, so add it along side pandoc in the build system. Signed-off-by: Jason Gunthorpe --- .travis.yml | 1 + CMakeLists.txt | 10 ++++++- buildlib/Findrst2man.cmake | 21 +++++++++++++ buildlib/cbuild | 12 +++++++- buildlib/pandoc-prebuilt.py | 33 +++++++++++++++++--- buildlib/rdma_man.cmake | 60 ++++++++++++++++++++++++++++++------- debian/control | 1 + redhat/rdma-core.spec | 1 + suse/rdma-core.spec | 1 + 9 files changed, 123 insertions(+), 17 deletions(-) create mode 100644 buildlib/Findrst2man.cmake diff --git a/.travis.yml b/.travis.yml index 660b306797bf6b..1cc2c69ca8671d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,7 @@ addons: - make - ninja-build - pandoc + - python-docutils - pkg-config - python - valgrind diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cb3c32c318821..9428ce02191bc4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -406,8 +406,9 @@ if (CYTHON_EXECUTABLE) string(STRIP ${py_path} CMAKE_PYTHON_SO_SUFFIX) endif() -# Look for pandoc +# Look for pandoc and rst2man for making manual pages FIND_PACKAGE(pandoc) +FIND_PACKAGE(rst2man) #------------------------- # Find libraries @@ -668,6 +669,13 @@ if (NOT PANDOC_FOUND) message(STATUS " pandoc NOT found (using prebuilt man pages)") endif() endif() +if (NOT RST2MAN_FOUND) + if (NOT EXISTS "${CMAKE_SOURCE_DIR}/buildlib/pandoc-prebuilt") + message(STATUS " rst2man NOT found and NO prebuilt man pages. 'install' disabled") + else() + message(STATUS " rst2man NOT found (using prebuilt man pages)") + endif() +endif() if (NOT CYTHON_EXECUTABLE) message(STATUS " cython NOT found (disabling pyverbs)") endif() diff --git a/buildlib/Findrst2man.cmake b/buildlib/Findrst2man.cmake new file mode 100644 index 00000000000000..a7236604dfcc28 --- /dev/null +++ b/buildlib/Findrst2man.cmake @@ -0,0 +1,21 @@ +# COPYRIGHT (c) 2019 Mellanox Technologies Ltd +# Licensed under BSD (MIT variant) or GPLv2. See COPYING. +find_program(RST2MAN_EXECUTABLE NAMES rst2man) + +if(RST2MAN_EXECUTABLE) + execute_process(COMMAND "${RST2MAN_EXECUTABLE}" --version + OUTPUT_VARIABLE _VERSION + RESULT_VARIABLE _VERSION_RESULT + ERROR_QUIET) + + if(NOT _VERSION_RESULT) + string(REGEX REPLACE "^rst2man \\(Docutils ([^,]+), .*" "\\1" RST2MAN_VERSION_STRING "${_VERSION}") + endif() + unset(_VERSION_RESULT) + unset(_VERSION) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(rst2man REQUIRED_VARS RST2MAN_EXECUTABLE RST2MAN_VERSION_STRING VERSION_VAR RST2MAN_VERSION_STRING) + +mark_as_advanced(RST2MAN_EXECUTABLE) diff --git a/buildlib/cbuild b/buildlib/cbuild index e012b08b5fbb76..2d0fc46a1ee913 100755 --- a/buildlib/cbuild +++ b/buildlib/cbuild @@ -104,6 +104,7 @@ class centos6(YumEnvironment): 'pkgconfig', 'python', 'python-argparse', + 'python-docutils', 'rpm-build', 'valgrind-devel', }; @@ -149,7 +150,14 @@ class centos7_epel(centos7): class fc30(Environment): docker_parent = "fedora:30"; - pkgs = (centos7.pkgs - {"make", "python-argparse" }) | {"ninja-build","pandoc","perl-generators","python3-Cython","python3-devel"}; + pkgs = (centos7.pkgs - {"make", "python-argparse" }) | { + "ninja-build", + "pandoc", + "perl-generators", + "python3-docutils", + "python3-Cython", + "python3-devel", + }; name = "fc30"; specfile = "redhat/rdma-core.spec"; ninja_cmd = "ninja-build"; @@ -190,6 +198,7 @@ class xenial(APTEnvironment): 'pandoc', 'pkg-config', 'python3', + "python3-docutils", 'valgrind', }; name = "ubuntu-16.04"; @@ -354,6 +363,7 @@ class leap(ZypperEnvironment): 'valgrind-devel', 'python3-Cython', 'python3-devel', + 'python3-docutils', }; rpmbuild_options = [ "--without=curlmini" ]; name = "opensuse-15.0"; diff --git a/buildlib/pandoc-prebuilt.py b/buildlib/pandoc-prebuilt.py index c1db6a25a23bad..afba326324345b 100644 --- a/buildlib/pandoc-prebuilt.py +++ b/buildlib/pandoc-prebuilt.py @@ -4,19 +4,31 @@ import shutil import subprocess import sys import hashlib +import re + +def hash_rst_includes(incdir,txt): + h = "" + for fn in re.findall(br"^..\s+include::\s+(.*)$", txt, flags=re.MULTILINE): + with open(os.path.join(incdir,fn.decode()),"rb") as F: + h = h + hashlib.sha1(F.read()).hexdigest(); + return h.encode(); def get_id(SRC): """Return a unique ID for the SRC file. For simplicity and robustness we just content hash it""" + incdir = os.path.dirname(SRC) with open(SRC,"rb") as F: - return hashlib.sha1(F.read()).hexdigest(); + txt = F.read(); + if SRC.endswith(".rst"): + txt = txt + hash_rst_includes(incdir,txt); + return hashlib.sha1(txt).hexdigest(); def do_retrieve(src_root,SRC): """Retrieve the file from the prebuild cache and write it to DEST""" prebuilt = os.path.join(src_root,"buildlib","pandoc-prebuilt",get_id(SRC)) sys.stdout.write(prebuilt); -def do_build(build_root,pandoc,SRC,DEST): +def do_build_pandoc(build_root,pandoc,SRC,DEST): """Build the markdown into a man page with pandoc and then keep a copy of the output under build/pandoc-prebuilt""" try: @@ -25,13 +37,26 @@ def do_build(build_root,pandoc,SRC,DEST): sys.exit(100); shutil.copy(DEST,os.path.join(build_root,"pandoc-prebuilt",get_id(SRC))); +def do_build_rst2man(build_root,rst2man,SRC,DEST): + """Build the markdown into a man page with pandoc and then keep a copy of the + output under build/pandoc-prebuilt""" + try: + subprocess.check_call([rst2man,SRC,DEST]); + except subprocess.CalledProcessError: + sys.exit(100); + shutil.copy(DEST,os.path.join(build_root,"pandoc-prebuilt",get_id(SRC))); + # We support python 2.6 so argparse is not available. if len(sys.argv) == 4: assert(sys.argv[1] == "--retrieve"); do_retrieve(sys.argv[2],sys.argv[3]); elif len(sys.argv) == 7: assert(sys.argv[1] == "--build"); - assert(sys.argv[3] == "--pandoc"); - do_build(sys.argv[2],sys.argv[4],sys.argv[5],sys.argv[6]); + if sys.argv[3] == "--pandoc": + do_build_pandoc(sys.argv[2],sys.argv[4],sys.argv[5],sys.argv[6]); + elif sys.argv[3] == "--rst": + do_build_rst2man(sys.argv[2],sys.argv[4],sys.argv[5],sys.argv[6]); + else: + raise ValueError("Bad sys.argv[3]"); else: raise ValueError("Must provide --build or --retrieve"); diff --git a/buildlib/rdma_man.cmake b/buildlib/rdma_man.cmake index 0db455f0cc6029..f8f43c9fe55a6e 100644 --- a/buildlib/rdma_man.cmake +++ b/buildlib/rdma_man.cmake @@ -4,6 +4,22 @@ rdma_make_dir("${CMAKE_BINARY_DIR}/pandoc-prebuilt") add_custom_target("docs" ALL DEPENDS "${OBJ}") +function(rdma_man_get_prebuilt SRC OUT) + # If rst2man is not installed then we install the man page from the + # pre-built cache directory under buildlib. When the release tar file is + # made the man pages are pre-built and included. This is done via install + # so that ./build.sh never depends on pandoc, only 'ninja install'. + execute_process( + COMMAND "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/buildlib/pandoc-prebuilt.py" --retrieve "${CMAKE_SOURCE_DIR}" "${SRC}" + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + OUTPUT_VARIABLE OBJ + RESULT_VARIABLE retcode) + if(NOT "${retcode}" STREQUAL "0") + message(FATAL_ERROR "Failed to load prebuilt pandoc output") + endif() + set(${OUT} "${OBJ}" PARENT_SCOPE) +endfunction() + function(rdma_md_man_page SRC MAN_SECT MANFN) set(OBJ "${CMAKE_CURRENT_BINARY_DIR}/${MANFN}") @@ -18,18 +34,29 @@ function(rdma_md_man_page SRC MAN_SECT MANFN) add_custom_target("man-${MANFN}" ALL DEPENDS "${OBJ}") add_dependencies("docs" "man-${MANFN}") else() - # If pandoc is not installed then we install the man page from the - # pre-built cache directory under buildlib. When the release tar file is - # made the man pages are pre-built and included. This is done via install - # so that ./build.sh never depends on pandoc, only 'ninja install'. - execute_process( - COMMAND "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/buildlib/pandoc-prebuilt.py" --retrieve "${CMAKE_SOURCE_DIR}" "${SRC}" + rdma_man_get_prebuilt(${SRC} OBJ) + endif() + + install(FILES "${OBJ}" + RENAME "${MANFN}" + DESTINATION "${CMAKE_INSTALL_MANDIR}/man${MAN_SECT}/") +endfunction() + +function(rdma_rst_man_page SRC MAN_SECT MANFN) + set(OBJ "${CMAKE_CURRENT_BINARY_DIR}/${MANFN}") + + if (RST2MAN_EXECUTABLE) + add_custom_command( + OUTPUT "${OBJ}" + COMMAND "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/buildlib/pandoc-prebuilt.py" --build "${CMAKE_BINARY_DIR}" --rst "${RST2MAN_EXECUTABLE}" "${SRC}" "${OBJ}" + MAIN_DEPENDENCY "${SRC}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - OUTPUT_VARIABLE OBJ - RESULT_VARIABLE retcode) - if(NOT "${retcode}" STREQUAL "0") - message(FATAL_ERROR "Failed to load prebuilt pandoc output") - endif() + COMMENT "Creating man page ${MANFN}" + VERBATIM) + add_custom_target("man-${MANFN}" ALL DEPENDS "${OBJ}") + add_dependencies("docs" "man-${MANFN}") + else() + rdma_man_get_prebuilt(${SRC} OBJ) endif() install(FILES "${OBJ}" @@ -50,6 +77,17 @@ function(rdma_man_pages) "${I}" "${MAN_SECT}" "${BASE_NAME}") + elseif ("${I}" MATCHES "\\.in\\.rst$") + string(REGEX REPLACE "^.+[.](.+)\\.in\\.rst$" "\\1" MAN_SECT "${I}") + string(REGEX REPLACE "^(.+)\\.in\\.rst$" "\\1" BASE_NAME "${I}") + get_filename_component(BASE_NAME "${BASE_NAME}" NAME) + + configure_file("${I}" "${CMAKE_CURRENT_BINARY_DIR}/${BASE_NAME}.rst" @ONLY) + + rdma_rst_man_page( + "${CMAKE_CURRENT_BINARY_DIR}/${BASE_NAME}.rst" + "${MAN_SECT}" + "${BASE_NAME}") elseif ("${I}" MATCHES "\\.in$") string(REGEX REPLACE "^.+[.](.+)\\.in$" "\\1" MAN_SECT "${I}") string(REGEX REPLACE "^(.+)\\.in$" "\\1" BASE_NAME "${I}") diff --git a/debian/control b/debian/control index 9fb546ac8999cd..f4480827bf86af 100644 --- a/debian/control +++ b/debian/control @@ -16,6 +16,7 @@ Build-Depends: cmake (>= 2.8.11), ninja-build, pandoc, pkg-config, + python-docutils, python3-dev, valgrind [amd64 arm64 armhf i386 mips mips64el mipsel powerpc ppc64 ppc64el s390x] Standards-Version: 4.3.0 diff --git a/redhat/rdma-core.spec b/redhat/rdma-core.spec index ba563a7b87fa4e..ea48fc4e29a36f 100644 --- a/redhat/rdma-core.spec +++ b/redhat/rdma-core.spec @@ -20,6 +20,7 @@ BuildRequires: libudev-devel BuildRequires: pkgconfig BuildRequires: pkgconfig(libnl-3.0) BuildRequires: pkgconfig(libnl-route-3.0) +BuildRequires: python-docutils BuildRequires: valgrind-devel BuildRequires: systemd BuildRequires: systemd-devel diff --git a/suse/rdma-core.spec b/suse/rdma-core.spec index d533059603b918..5ddb46aaf8f9cc 100644 --- a/suse/rdma-core.spec +++ b/suse/rdma-core.spec @@ -62,6 +62,7 @@ BuildRequires: pkgconfig(libsystemd) BuildRequires: pkgconfig(libudev) BuildRequires: pkgconfig(systemd) BuildRequires: pkgconfig(udev) +BuildRequires: python-docutils %if %{with_pyverbs} BuildRequires: python3-Cython BuildRequires: python3-devel From patchwork Tue May 14 23:49:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10944089 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AF01F1398 for ; Tue, 14 May 2019 23:49:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E29828984 for ; Tue, 14 May 2019 23:49:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92BDE2898B; Tue, 14 May 2019 23:49:44 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 498BE28984 for ; Tue, 14 May 2019 23:49:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726491AbfENXtl (ORCPT ); Tue, 14 May 2019 19:49:41 -0400 Received: from mail-qt1-f175.google.com ([209.85.160.175]:43315 "EHLO mail-qt1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726281AbfENXtl (ORCPT ); Tue, 14 May 2019 19:49:41 -0400 Received: by mail-qt1-f175.google.com with SMTP id i26so1186840qtr.10 for ; Tue, 14 May 2019 16:49:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+KpfNuvqNu3/sVb2aStopFsd7NJVmrQALKhZUo1BvIg=; b=EMpSBCqmCZGjNsei+tEHj9FU9QK3JixAFJmMlBiFIs0/Z7B67CSmc6vDgzKrhPWEop pPQXHzs0oTVmABLb7bJfmu35EtnGTFSZ0gFOpX+DR/c7JjdtSALnckD2kdczvkU3+eQh 87W5EHquNjBZKYMDGkTGGnqXDPBMBQCJsMfhpFqV9zq55vptdVIsvy+lZlQbenwVQC60 UzPRRmAW+omMRtF4kIHmNbatG9gv2KDno6J52s1ccv0YF81jaWa0LXIw/5DsKHyN6Xnm LiSfo0mJlRSJJw7IgsTE5xnU9CwEioo/EJzYOHX1KMhlAed152dBdOymQpm1QFdJpW2H zMlQ== 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:mime-version:content-transfer-encoding; bh=+KpfNuvqNu3/sVb2aStopFsd7NJVmrQALKhZUo1BvIg=; b=YL+AELjzUmtZW3KJxJOMI9ismvoPHu+s/CInOxvU2I33AFVFMy+Bpoal2qpKtgD4Fu +G1pNoP+4joQuBpJp6kFIejiTuQtC1VvXTs4s7oMm2YN+pEPEzqz2Bip9enNU7oXOj+G 4IyWTQEunyZhVJnAL19sIvL6Jz6w0owoH8HAy1dTVd67R69O/drHQ5hImg68dg2esR9x RM11Hdn0lG1xjOc7AO2y+vJH6K6HxwOfQaIvti4oDQe1GE3Qm9utyVu508Idt0adOIlg fN0BZgn+hJwOYaC4OaoawHzt9n5QSdpsUYEmABuus+BpzEKQ6WLJnfILWbM5SyyPfU9o +UKg== X-Gm-Message-State: APjAAAWcr8X4XYm8DF+Ce2BfJjLQhqWw+bkJ6u6FbrRSUXn5eTONFdpd tgjCC2ZWLoA8P1jOnaRxusWrLBDDiq8= X-Google-Smtp-Source: APXvYqyWKAwHmP4ZnDJQsSqFCekIt1B1x2u9t/2CNZhWECCpLl0s5S6QRcvW6o8boQS6PA0TOwaYtA== X-Received: by 2002:a0c:d1d0:: with SMTP id k16mr31039264qvh.59.1557877780025; Tue, 14 May 2019 16:49:40 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id 91sm224673qte.38.2019.05.14.16.49.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 16:49:39 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hQhAw-0001NJ-V5; Tue, 14 May 2019 20:49:38 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 07/20] ibdiags: Add cmake files for ibdiags components Date: Tue, 14 May 2019 20:49:23 -0300 Message-Id: <20190514234936.5175-8-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514234936.5175-1-jgg@ziepe.ca> References: <20190514234936.5175-1-jgg@ziepe.ca> MIME-Version: 1.0 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: Jason Gunthorpe These are simple cmakefiles that emulate what the autotools stuff did. Signed-off-by: Jason Gunthorpe --- CMakeLists.txt | 28 +++++- buildlib/check-build | 6 +- debian/rules | 1 + ibdiags/doc/rst/CMakeLists.txt | 41 ++++++++ ibdiags/libibmad/src/CMakeLists.txt | 27 ++++++ ibdiags/libibnetdisc/man/CMakeLists.txt | 14 +++ ibdiags/libibnetdisc/src/CMakeLists.txt | 28 ++++++ ibdiags/man/CMakeLists.txt | 22 +++++ ibdiags/scripts/CMakeLists.txt | 119 ++++++++++++++++++++++++ ibdiags/src/CMakeLists.txt | 48 ++++++++++ redhat/rdma-core.spec | 1 + suse/rdma-core.spec | 1 + 12 files changed, 334 insertions(+), 2 deletions(-) create mode 100644 ibdiags/doc/rst/CMakeLists.txt create mode 100644 ibdiags/libibmad/src/CMakeLists.txt create mode 100644 ibdiags/libibnetdisc/man/CMakeLists.txt create mode 100644 ibdiags/libibnetdisc/src/CMakeLists.txt create mode 100644 ibdiags/man/CMakeLists.txt create mode 100644 ibdiags/scripts/CMakeLists.txt create mode 100644 ibdiags/src/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 9428ce02191bc4..c54cf6606e3c0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,11 @@ # -DNO_PYVERBS=1 (default, build pyverbs) # Invoke cython to build pyverbs. Usually you will run with this option # is set, but it will be disabled for travis runs. +# -DWITH_IBDIAGS=False (default True) +# Do not build infiniband-diags components +# -DWITH_IBDIAGS_COMPAT=True (default False) +# Include obsolete scripts. These scripts are replaced by C programs with +# a different interface now. cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR) project(rdma-core C) @@ -79,6 +84,7 @@ set(IBVERBS_PROVIDER_SUFFIX "-rdmav${IBVERBS_PABI_VERSION}.so") if (IN_PLACE) set(CMAKE_INSTALL_SYSCONFDIR "${CMAKE_BINARY_DIR}/etc") set(CMAKE_INSTALL_BINDIR "${CMAKE_BINARY_DIR}/bin") + set(CMAKE_INSTALL_SBINDIR "${CMAKE_BINARY_DIR}/bin") set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}") set(CMAKE_INSTALL_LIBDIR "lib") set(CMAKE_INSTALL_INCLUDEDIR "include") @@ -108,7 +114,6 @@ set(CMAKE_INSTALL_SYSTEMD_BINDIR "/lib/systemd" set(ACM_PROVIDER_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/ibacm" CACHE PATH "Location for ibacm provider plugin shared library files.") - # Location to find the provider plugin shared library files set(VERBS_PROVIDER_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/libibverbs" CACHE PATH "Location for provider plugin shared library files. If set to empty the system search path is used.") @@ -133,6 +138,15 @@ else() set(CMAKE_INSTALL_FULL_UDEV_RULESDIR "${CMAKE_INSTALL_UDEV_RULESDIR}") endif() +# Allow the perl library dir to be configurable +set(CMAKE_INSTALL_PERLDIR "share/perl5" + CACHE PATH "Location for system perl library, typically /usr/share/perl5") +if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_PERLDIR}) + set(CMAKE_INSTALL_FULL_PERLDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_PERLDIR}") +else() + set(CMAKE_INSTALL_FULL_PERLDIR "${CMAKE_INSTALL_PERLDIR}") +endif() + # Location to place provider .driver files if (IN_PLACE) set(CONFIG_DIR "${BUILD_ETC}/libibverbs.d") @@ -145,6 +159,8 @@ endif() set(DISTRO_FLAVOUR "None" CACHE STRING "Flavour of distribution to install for. This primarily impacts the init.d scripts installed.") +set(WITH_IBDIAGS "True" CACHE BOOL "Build infiniband-diags stuff too") + #------------------------- # Load CMake components set(BUILDLIB "${CMAKE_SOURCE_DIR}/buildlib") @@ -604,6 +620,16 @@ add_subdirectory(providers/ipathverbs) add_subdirectory(providers/rxe) add_subdirectory(providers/rxe/man) +if (WITH_IBDIAGS) +add_subdirectory(ibdiags/libibmad/src) +add_subdirectory(ibdiags/libibnetdisc/src) +add_subdirectory(ibdiags/libibnetdisc/man) +add_subdirectory(ibdiags/src) +add_subdirectory(ibdiags/scripts) +add_subdirectory(ibdiags/man) +add_subdirectory(ibdiags/doc/rst) +endif() + if (CYTHON_EXECUTABLE) add_subdirectory(pyverbs) endif() diff --git a/buildlib/check-build b/buildlib/check-build index 348b0590f296ee..83358572b0b906 100755 --- a/buildlib/check-build +++ b/buildlib/check-build @@ -85,9 +85,13 @@ def check_lib_symver(args,fn): raise ValueError("Shared Library filename %r does not have the package version %r (%r)%"( fn,args.PACKAGE_VERSION,g.groups())); - # umad used the wrong symbol version name when they moved to soname 3.0 + # umad/etc used the wrong symbol version name when they moved to soname 3.0 if g.group(1) == "ibumad": newest_symver = "%s_%s.%s"%(g.group(1).upper(),'1',g.group(3)); + elif g.group(1) == "ibmad": + newest_symver = "%s_%s.%s"%(g.group(1).upper(),'1',g.group(3)); + elif g.group(1) == "ibnetdisc": + newest_symver = "%s_%s.%s"%(g.group(1).upper(),'1',g.group(3)); else: newest_symver = "%s_%s.%s"%(g.group(1).upper(),g.group(2),g.group(3)); diff --git a/debian/rules b/debian/rules index c84d9ef8f5ed54..744bf28c52f070 100755 --- a/debian/rules +++ b/debian/rules @@ -36,6 +36,7 @@ DH_AUTO_CONFIGURE := "--" \ "-DCMAKE_INSTALL_RUNDIR:PATH=/run" \ "-DCMAKE_INSTALL_UDEV_RULESDIR:PATH=/lib/udev/rules.d" \ "-DENABLE_STATIC=1" \ + "-DWITH_IBDIAGS:BOOL=False" \ $(EXTRA_CMAKE_FLAGS) override_dh_auto_configure: diff --git a/ibdiags/doc/rst/CMakeLists.txt b/ibdiags/doc/rst/CMakeLists.txt new file mode 100644 index 00000000000000..f0e4072306a57c --- /dev/null +++ b/ibdiags/doc/rst/CMakeLists.txt @@ -0,0 +1,41 @@ +set(BUILD_DATE "2019") + +# rst2man has no way to set the include search path +rdma_create_symlink("${CMAKE_CURRENT_SOURCE_DIR}/common" "${CMAKE_CURRENT_BINARY_DIR}/common") + +rdma_man_pages( + check_lft_balance.8.in.rst + dump_fts.8.in.rst + ibaddr.8.in.rst + ibcacheedit.8.in.rst + ibccconfig.8.in.rst + ibccquery.8.in.rst + ibfindnodesusing.8.in.rst + ibhosts.8.in.rst + ibidsverify.8.in.rst + iblinkinfo.8.in.rst + ibnetdiscover.8.in.rst + ibnodes.8.in.rst + ibping.8.in.rst + ibportstate.8.in.rst + ibqueryerrors.8.in.rst + ibroute.8.in.rst + ibrouters.8.in.rst + ibstat.8.in.rst + ibstatus.8.in.rst + ibswitches.8.in.rst + ibsysstat.8.in.rst + ibtracert.8.in.rst + infiniband-diags.8.in.rst + perfquery.8.in.rst + saquery.8.in.rst + sminfo.8.in.rst + smpdump.8.in.rst + smpquery.8.in.rst + vendstat.8.in.rst + ) + +rdma_alias_man_pages( + dump_fts.8 dump_lfts.8 + dump_fts.8 dump_mfts.8 + ) diff --git a/ibdiags/libibmad/src/CMakeLists.txt b/ibdiags/libibmad/src/CMakeLists.txt new file mode 100644 index 00000000000000..37da71a336324a --- /dev/null +++ b/ibdiags/libibmad/src/CMakeLists.txt @@ -0,0 +1,27 @@ +publish_headers(infiniband + ../include/infiniband/mad.h + ../include/infiniband/mad_osd.h + ) + +rdma_library(ibmad libibmad.map + # See Documentation/versioning.md + 5 5.3.${PACKAGE_VERSION} + bm.c + cc.c + dump.c + fields.c + gs.c + mad.c + portid.c + register.c + resolve.c + rpc.c + sa.c + serv.c + smp.c + vendor.c + ) +target_link_libraries(ibmad LINK_PRIVATE + ibumad + ) +rdma_pkg_config("ibmad" "libibumad" "") diff --git a/ibdiags/libibnetdisc/man/CMakeLists.txt b/ibdiags/libibnetdisc/man/CMakeLists.txt new file mode 100644 index 00000000000000..01457ddbc86c72 --- /dev/null +++ b/ibdiags/libibnetdisc/man/CMakeLists.txt @@ -0,0 +1,14 @@ +rdma_man_pages( + ibnd_discover_fabric.3 + ibnd_find_node_guid.3 + ibnd_iter_nodes.3 + ) + +rdma_alias_man_pages( + ibnd_discover_fabric.3 ibnd_debug.3 + ibnd_discover_fabric.3 ibnd_destroy_fabric.3 + ibnd_discover_fabric.3 ibnd_set_max_smps_on_wire.3 + ibnd_discover_fabric.3 ibnd_show_progress.3 + ibnd_find_node_guid.3 ibnd_find_node_dr.3 + ibnd_iter_nodes.3 ibnd_iter_nodes_type.3 + ) diff --git a/ibdiags/libibnetdisc/src/CMakeLists.txt b/ibdiags/libibnetdisc/src/CMakeLists.txt new file mode 100644 index 00000000000000..a71516ecc1eb60 --- /dev/null +++ b/ibdiags/libibnetdisc/src/CMakeLists.txt @@ -0,0 +1,28 @@ +publish_headers(infiniband + ../include/infiniband/ibnetdisc.h + ../include/infiniband/ibnetdisc_osd.h + ) + +rdma_library(ibnetdisc libibnetdisc.map + # See Documentation/versioning.md + 5 5.0.${PACKAGE_VERSION} + chassis.c + ibnetdisc.c + ibnetdisc_cache.c + query_smp.c + ) +target_link_libraries(ibnetdisc LINK_PRIVATE + ibmad + ibumad + osmcomp + ) +# FIXME for osmcomp +target_include_directories(ibnetdisc PRIVATE "/usr/include/infiniband") +rdma_pkg_config("ibnetdisc" "libibumad libibmad" "") + +rdma_test_executable(testleaks ../test/testleaks.c) +target_link_libraries(testleaks LINK_PRIVATE + ibmad + ibnetdisc +) +target_include_directories(testleaks PRIVATE "/usr/include/infiniband") diff --git a/ibdiags/man/CMakeLists.txt b/ibdiags/man/CMakeLists.txt new file mode 100644 index 00000000000000..2446acbb522c86 --- /dev/null +++ b/ibdiags/man/CMakeLists.txt @@ -0,0 +1,22 @@ +if (WITH_IBDIAGS_COMPAT) + rdma_man_pages( + ibcheckerrors.8 + ibcheckerrs.8 + ibchecknet.8 + ibchecknode.8 + ibcheckport.8 + ibcheckportstate.8 + ibcheckportwidth.8 + ibcheckstate.8 + ibcheckwidth.8 + ibclearcounters.8 + ibclearerrors.8 + ibdatacounters.8 + ibdatacounts.8 + ibdiscover.8 + ibprintca.8 + ibprintrt.8 + ibprintswitch.8 + ibswportwatch.8 + ) +endif() diff --git a/ibdiags/scripts/CMakeLists.txt b/ibdiags/scripts/CMakeLists.txt new file mode 100644 index 00000000000000..3d65ed837a2d83 --- /dev/null +++ b/ibdiags/scripts/CMakeLists.txt @@ -0,0 +1,119 @@ +function(_rdma_sbin_interp INTERP IFN OFN) + configure_file("${IFN}" "${CMAKE_CURRENT_BINARY_DIR}/${OFN}" @ONLY) + file(WRITE "${BUILD_BIN}/${OFN}" "#!${INTERP} ${CMAKE_CURRENT_BINARY_DIR}/${OFN}") + execute_process(COMMAND "chmod" "a+x" "${BUILD_BIN}/${OFN}") + + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${OFN}" + DESTINATION "${CMAKE_INSTALL_SBINDIR}" + PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE) +endfunction() + +function(_rdma_sbin_interp_link INTERP IFN OFN) + file(WRITE "${BUILD_BIN}/${OFN}" "#!${INTERP} ${CMAKE_CURRENT_SOURCE_DIR}/${IFN}") + execute_process(COMMAND "chmod" "a+x" "${BUILD_BIN}/${OFN}") + + install(FILES "${IFN}" + DESTINATION "${CMAKE_INSTALL_SBINDIR}" + RENAME "${OFN}" + PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE) +endfunction() + +function(rdma_sbin_shell_program) + foreach(IFN ${ARGN}) + if (IFN MATCHES "\\.sh\\.in") + if (DISTRO_FLAVOUR STREQUAL Debian) + string(REGEX REPLACE "^(.+)\\.sh\\.in$" "\\1" OFN "${IFN}") + else() + string(REGEX REPLACE "^(.+)\\.in$" "\\1" OFN "${IFN}") + endif() + _rdma_sbin_interp("/bin/bash" "${IFN}" "${OFN}") + elseif (IFN MATCHES "\\.in") + string(REGEX REPLACE "^(.+)\\.in$" "\\1" OFN "${IFN}") + _rdma_sbin_interp("/bin/bash" "${IFN}" "${OFN}") + elseif (IFN MATCHES "\\.sh") + if (DISTRO_FLAVOUR STREQUAL Debian) + string(REGEX REPLACE "^(.+)\\.sh$" "\\1" OFN "${IFN}") + else() + set(OFN "${IFN}") + endif() + _rdma_sbin_interp_link("/bin/bash" "${IFN}" "${OFN}") + else() + _rdma_sbin_interp_link("/bin/bash" "${IFN}" "${IFN}") + endif() + endforeach() +endfunction() + +function(rdma_sbin_perl_program) + foreach(IFN ${ARGN}) + if (IFN MATCHES "\\.pl\\.in") + if (DISTRO_FLAVOUR STREQUAL Debian) + string(REGEX REPLACE "^(.+)\\.pl\\.in$" "\\1" OFN "${IFN}") + else() + string(REGEX REPLACE "^(.+)\\.in$" "\\1" OFN "${IFN}") + endif() + _rdma_sbin_interp("/usr/bin/perl" "${IFN}" "${OFN}") + elseif (IFN MATCHES "\\.pl") + if (DISTRO_FLAVOUR STREQUAL Debian) + string(REGEX REPLACE "^(.+)\\.pl$" "\\1" OFN "${IFN}") + else() + set(OFN "${IFN}") + endif() + _rdma_sbin_interp_link("/usr/bin/perl" "${IFN}" "${OFN}") + endif() + endforeach() +endfunction() + +set(IBSCRIPTPATH "${CMAKE_INSTALL_FULL_SBINDIR}") + +rdma_sbin_shell_program( + dump_lfts.sh.in + dump_mfts.sh.in + ibhosts.in + ibnodes.in + ibrouters.in + ibstatus + ibswitches.in + ) + +rdma_sbin_perl_program( + check_lft_balance.pl + ibfindnodesusing.pl + ibidsverify.pl + ) + +install(FILES "IBswcountlimits.pm" + DESTINATION "${CMAKE_INSTALL_PERLDIR}") + +install(FILES + "../etc/error_thresholds" + "../etc/ibdiag.conf" + DESTINATION "${IBDIAG_CONFIG_PATH}") + +if (WITH_IBDIAGS_COMPAT) + rdma_sbin_shell_program( + ibcheckerrors.in + ibcheckerrs.in + ibchecknet.in + ibchecknode.in + ibcheckport.in + ibcheckportstate.in + ibcheckportwidth.in + ibcheckstate.in + ibcheckwidth.in + ibclearcounters.in + ibclearerrors.in + ibdatacounters.in + ibdatacounts.in + set_nodedesc.sh + ) + + rdma_sbin_perl_program( + ibdiscover.pl + iblinkinfo.pl.in + ibprintca.pl + ibprintrt.pl + ibprintswitch.pl + ibqueryerrors.pl.in + ibswportwatch.pl + ) +endif() diff --git a/ibdiags/src/CMakeLists.txt b/ibdiags/src/CMakeLists.txt new file mode 100644 index 00000000000000..edce64f2106a3d --- /dev/null +++ b/ibdiags/src/CMakeLists.txt @@ -0,0 +1,48 @@ +publish_internal_headers("" + ../include/ibdiag_common.h + ../include/ibdiag_sa.h + ) + +add_library(ibdiags_tools STATIC + ibdiag_common.c + ibdiag_sa.c + ) +target_include_directories(ibdiags_tools PRIVATE "/usr/include/infiniband") + +function(ibdiag_programs) + foreach(I ${ARGN}) + rdma_sbin_executable(${I} "${I}.c") + target_link_libraries(${I} PRIVATE ${RT_LIBRARIES} ibumad ibmad ibdiags_tools ibnetdisc osmcomp) + target_include_directories(${I} PRIVATE "/usr/include/infiniband") + endforeach() +endfunction() + +ibdiag_programs( + dump_fts + ibaddr + ibcacheedit + ibccconfig + ibccquery + iblinkinfo + ibnetdiscover + ibping + ibportstate + ibqueryerrors + ibroute + ibstat + ibsysstat + ibtracert + perfquery + saquery + sminfo + smpdump + smpquery + vendstat + ) + +rdma_test_executable(ibsendtrap "ibsendtrap.c") +target_link_libraries(ibsendtrap PRIVATE ibumad ibmad ibdiags_tools) +target_include_directories(ibsendtrap PRIVATE "/usr/include/infiniband") +rdma_test_executable(mcm_rereg_test "mcm_rereg_test.c") +target_link_libraries(mcm_rereg_test PRIVATE ibumad ibmad ibdiags_tools) +target_include_directories(mcm_rereg_test PRIVATE "/usr/include/infiniband") diff --git a/redhat/rdma-core.spec b/redhat/rdma-core.spec index ea48fc4e29a36f..29bf26531c97ab 100644 --- a/redhat/rdma-core.spec +++ b/redhat/rdma-core.spec @@ -259,6 +259,7 @@ easy, object-oriented access to IB verbs. -DCMAKE_INSTALL_RUNDIR:PATH=%{_rundir} \ -DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir}/%{name}-%{version} \ -DCMAKE_INSTALL_UDEV_RULESDIR:PATH=%{_udevrulesdir} \ + -DWITH_IBDIAGS:BOOL=False \ %if %{with_static} -DENABLE_STATIC=1 \ %endif diff --git a/suse/rdma-core.spec b/suse/rdma-core.spec index 5ddb46aaf8f9cc..c0d4922658cb6a 100644 --- a/suse/rdma-core.spec +++ b/suse/rdma-core.spec @@ -372,6 +372,7 @@ easy, object-oriented access to IB verbs. -DCMAKE_INSTALL_RUNDIR:PATH=%{_rundir} \ -DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir}/%{name}-%{version} \ -DCMAKE_INSTALL_UDEV_RULESDIR:PATH=%{_udevrulesdir} \ + -DWITH_IBDIAGS:BOOL=False \ %if %{with_static} -DENABLE_STATIC=1 \ %endif From patchwork Tue May 14 23:49:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10944109 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B10061395 for ; Tue, 14 May 2019 23:49:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 999B7288DA for ; Tue, 14 May 2019 23:49:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D1E82898B; Tue, 14 May 2019 23:49:52 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 C0900288DA for ; Tue, 14 May 2019 23:49:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726461AbfENXts (ORCPT ); Tue, 14 May 2019 19:49:48 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:42917 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726409AbfENXtm (ORCPT ); Tue, 14 May 2019 19:49:42 -0400 Received: by mail-qk1-f196.google.com with SMTP id d4so387211qkc.9 for ; Tue, 14 May 2019 16:49:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4LfgYjUQkwm95KvesbuLbSnqHwKw7X0yUQzuMBDUY74=; b=BUXLfR8EkEPUfWmNvvy4e/VR3Sv+B+2B0xcxfAGtP+mn4rinrZjxiOwbdaUG/y6YAi CFyuKEdpn4Nra3G4ZNhidEGMtJmKZqbbWZCQLCanbadsd1qsny5H/mbK5szVNA71OnIQ EENhnCfUpxldD0DOTaneIDe3U6tE13qDRAlBysyRvDka5rJ0nuECKkZ8ORbpHvd0w/11 g/o+jdZz+aJunmGwyii+R6Wush1amij6CrAOkGxcUP36MO4fCtrrcNlGAkwkMjFLPJbC oYiKdf/TOrGm7fadB4oK9vSFxpCTdQG5jLCzNa8tmZLFeQUbNzb+F4rLITQJB/swbM5i cxmg== 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:mime-version:content-transfer-encoding; bh=4LfgYjUQkwm95KvesbuLbSnqHwKw7X0yUQzuMBDUY74=; b=ad2bhtW69IDfzdVVRkv3sV3DA3ZlMcnbarZ/uCOpXYXUIJeKWpBiyZc0yp4ZwJMF/5 S+uKlNBNpCsROWupmkaDYsqjK1zlitsAf5uien0fErJ67WAaiAG7XyTaG1J0xaePPQ3/ 0j+AZJMiwlSy+2pIZf71OKSB8EtWWxbAOmMkgD8dQiY39Gl8xpG2xMQ/+uWJVFWnjlXd ndrPE8T0lgN40U6ePqb76HfOsOuHGSTvesUKKAyYvAC+iavD3/sNK7fb2Zi2Wuau9vge JBNDgxIy4bRPfHwVFCi+1j10drjNPLJgPGkRb10hpfJ1KsHMKW1Qim0Q1sw4Y5M21nOC ODCg== X-Gm-Message-State: APjAAAUgHzOhGl9nnhcjf+YWybUf5CqPyauSfpLkgl7a9z4jrPxMY+R8 yz3NeaIQOg2j9xQblP7mM1s3k1uMSmU= X-Google-Smtp-Source: APXvYqy5dPKcV/IaRQriliu1l117q9t8tUl4aIl8n1spx+LSCgGfNpvFq25E3pcZsUkZT/2P9Sbmyw== X-Received: by 2002:a37:9b88:: with SMTP id d130mr28810702qke.278.1557877780085; Tue, 14 May 2019 16:49:40 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id r47sm403558qtc.14.2019.05.14.16.49.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 16:49:40 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hQhAx-0001NP-0H; Tue, 14 May 2019 20:49:39 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 08/20] ibdiags: Copy the cl_qmap implementation from opensm Date: Tue, 14 May 2019 20:49:24 -0300 Message-Id: <20190514234936.5175-9-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514234936.5175-1-jgg@ziepe.ca> References: <20190514234936.5175-1-jgg@ziepe.ca> MIME-Version: 1.0 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: Jason Gunthorpe ibdiags stuff is using this, so provide it internally as we can't depend on opensm. This version is copied from opensm commit 6d49a7e3c02a ("libvendor/osm_vendor_mlx_sim.c: In osmv_transport_init, fix memory leaks on error") and then stripped down. This eliminates complib dependencies from libibnetdisc. Signed-off-by: Jason Gunthorpe --- ibdiags/libibnetdisc/src/CMakeLists.txt | 1 - ibdiags/libibnetdisc/src/ibnetdisc.c | 1 - ibdiags/libibnetdisc/src/internal.h | 2 +- ibdiags/libibnetdisc/test/testleaks.c | 1 - util/CMakeLists.txt | 2 + util/cl_map.c | 700 +++++++++++++++++ util/cl_qmap.h | 970 ++++++++++++++++++++++++ 7 files changed, 1673 insertions(+), 4 deletions(-) create mode 100644 util/cl_map.c create mode 100644 util/cl_qmap.h diff --git a/ibdiags/libibnetdisc/src/CMakeLists.txt b/ibdiags/libibnetdisc/src/CMakeLists.txt index a71516ecc1eb60..c93c9be8cc6cd6 100644 --- a/ibdiags/libibnetdisc/src/CMakeLists.txt +++ b/ibdiags/libibnetdisc/src/CMakeLists.txt @@ -14,7 +14,6 @@ rdma_library(ibnetdisc libibnetdisc.map target_link_libraries(ibnetdisc LINK_PRIVATE ibmad ibumad - osmcomp ) # FIXME for osmcomp target_include_directories(ibnetdisc PRIVATE "/usr/include/infiniband") diff --git a/ibdiags/libibnetdisc/src/ibnetdisc.c b/ibdiags/libibnetdisc/src/ibnetdisc.c index 0c60b4419a9c8e..7425545b78f532 100644 --- a/ibdiags/libibnetdisc/src/ibnetdisc.c +++ b/ibdiags/libibnetdisc/src/ibnetdisc.c @@ -46,7 +46,6 @@ #include #include -#include #include "internal.h" #include "chassis.h" diff --git a/ibdiags/libibnetdisc/src/internal.h b/ibdiags/libibnetdisc/src/internal.h index a40f48ea373718..7b5d4e85fd191f 100644 --- a/ibdiags/libibnetdisc/src/internal.h +++ b/ibdiags/libibnetdisc/src/internal.h @@ -39,7 +39,7 @@ #define _INTERNAL_H_ #include -#include +#include #define IBND_DEBUG(fmt, ...) \ if (ibdebug) { \ diff --git a/ibdiags/libibnetdisc/test/testleaks.c b/ibdiags/libibnetdisc/test/testleaks.c index 0723b109854de8..f1e1985d279156 100644 --- a/ibdiags/libibnetdisc/test/testleaks.c +++ b/ibdiags/libibnetdisc/test/testleaks.c @@ -44,7 +44,6 @@ #include #include -#include #include static const char *argv0 = "iblinkinfotest"; diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt index 4e9c4f16f30fa9..8b4f5d65c753f5 100644 --- a/util/CMakeLists.txt +++ b/util/CMakeLists.txt @@ -1,10 +1,12 @@ publish_internal_headers(util + cl_qmap.h compiler.h symver.h util.h ) set(C_FILES + cl_map.c util.c) if (HAVE_COHERENT_DMA) diff --git a/util/cl_map.c b/util/cl_map.c new file mode 100644 index 00000000000000..f48efec73197e1 --- /dev/null +++ b/util/cl_map.c @@ -0,0 +1,700 @@ +/* + * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + +/* + * Abstract: + * Implementation of quick map, a binary tree where the caller always + * provides all necessary storage. + * + */ + +/***************************************************************************** +* +* Map +* +* Map is an associative array. By providing a key, the caller can retrieve +* an object from the map. All objects in the map have an associated key, +* as specified by the caller when the object was inserted into the map. +* In addition to random access, the caller can traverse the map much like +* a linked list, either forwards from the first object or backwards from +* the last object. The objects in the map are always traversed in +* order since the nodes are stored sorted. +* +* This implementation of Map uses a red black tree verified against +* Cormen-Leiserson-Rivest text, McGraw-Hill Edition, fourteenth +* printing, 1994. +* +*****************************************************************************/ + +#include +#include + +static inline void __cl_primitive_insert(cl_list_item_t *const p_list_item, + cl_list_item_t *const p_new_item) +{ + /* CL_ASSERT that a non-null pointer is provided. */ + assert(p_list_item); + /* CL_ASSERT that a non-null pointer is provided. */ + assert(p_new_item); + + p_new_item->p_next = p_list_item; + p_new_item->p_prev = p_list_item->p_prev; + p_list_item->p_prev = p_new_item; + p_new_item->p_prev->p_next = p_new_item; +} + +static inline void __cl_primitive_remove(cl_list_item_t *const p_list_item) +{ + /* CL_ASSERT that a non-null pointer is provided. */ + assert(p_list_item); + + /* set the back pointer */ + p_list_item->p_next->p_prev = p_list_item->p_prev; + /* set the next pointer */ + p_list_item->p_prev->p_next = p_list_item->p_next; + + /* if we're debugging, spruce up the pointers to help find bugs */ +#if defined( _DEBUG_ ) + if (p_list_item != p_list_item->p_next) { + p_list_item->p_next = NULL; + p_list_item->p_prev = NULL; + } +#endif /* defined( _DEBUG_ ) */ +} + +/****************************************************************************** + IMPLEMENTATION OF QUICK MAP +******************************************************************************/ + +/* + * Get the root. + */ +static inline cl_map_item_t *__cl_map_root(const cl_qmap_t * const p_map) +{ + assert(p_map); + return (p_map->root.p_left); +} + +/* + * Returns whether a given item is on the left of its parent. + */ +static bool __cl_map_is_left_child(const cl_map_item_t * const p_item) +{ + assert(p_item); + assert(p_item->p_up); + assert(p_item->p_up != p_item); + + return (p_item->p_up->p_left == p_item); +} + +/* + * Retrieve the pointer to the parent's pointer to an item. + */ +static cl_map_item_t **__cl_map_get_parent_ptr_to_item(cl_map_item_t * + const p_item) +{ + assert(p_item); + assert(p_item->p_up); + assert(p_item->p_up != p_item); + + if (__cl_map_is_left_child(p_item)) + return (&p_item->p_up->p_left); + + assert(p_item->p_up->p_right == p_item); + return (&p_item->p_up->p_right); +} + +/* + * Rotate a node to the left. This rotation affects the least number of links + * between nodes and brings the level of C up by one while increasing the depth + * of A one. Note that the links to/from W, X, Y, and Z are not affected. + * + * R R + * | | + * A C + * / \ / \ + * W C A Z + * / \ / \ + * B Z W B + * / \ / \ + * X Y X Y + */ +static void __cl_map_rot_left(cl_qmap_t * const p_map, + cl_map_item_t * const p_item) +{ + cl_map_item_t **pp_root; + + assert(p_map); + assert(p_item); + assert(p_item->p_right != &p_map->nil); + + pp_root = __cl_map_get_parent_ptr_to_item(p_item); + + /* Point R to C instead of A. */ + *pp_root = p_item->p_right; + /* Set C's parent to R. */ + (*pp_root)->p_up = p_item->p_up; + + /* Set A's right to B */ + p_item->p_right = (*pp_root)->p_left; + /* + * Set B's parent to A. We trap for B being NIL since the + * caller may depend on NIL not changing. + */ + if ((*pp_root)->p_left != &p_map->nil) + (*pp_root)->p_left->p_up = p_item; + + /* Set C's left to A. */ + (*pp_root)->p_left = p_item; + /* Set A's parent to C. */ + p_item->p_up = *pp_root; +} + +/* + * Rotate a node to the right. This rotation affects the least number of links + * between nodes and brings the level of A up by one while increasing the depth + * of C one. Note that the links to/from W, X, Y, and Z are not affected. + * + * R R + * | | + * C A + * / \ / \ + * A Z W C + * / \ / \ + * W B B Z + * / \ / \ + * X Y X Y + */ +static void __cl_map_rot_right(cl_qmap_t * const p_map, + cl_map_item_t * const p_item) +{ + cl_map_item_t **pp_root; + + assert(p_map); + assert(p_item); + assert(p_item->p_left != &p_map->nil); + + /* Point R to A instead of C. */ + pp_root = __cl_map_get_parent_ptr_to_item(p_item); + (*pp_root) = p_item->p_left; + /* Set A's parent to R. */ + (*pp_root)->p_up = p_item->p_up; + + /* Set C's left to B */ + p_item->p_left = (*pp_root)->p_right; + /* + * Set B's parent to C. We trap for B being NIL since the + * caller may depend on NIL not changing. + */ + if ((*pp_root)->p_right != &p_map->nil) + (*pp_root)->p_right->p_up = p_item; + + /* Set A's right to C. */ + (*pp_root)->p_right = p_item; + /* Set C's parent to A. */ + p_item->p_up = *pp_root; +} + +void cl_qmap_init(cl_qmap_t * const p_map) +{ + assert(p_map); + + memset(p_map, 0, sizeof(cl_qmap_t)); + + /* special setup for the root node */ + p_map->root.p_up = &p_map->root; + p_map->root.p_left = &p_map->nil; + p_map->root.p_right = &p_map->nil; + p_map->root.color = CL_MAP_BLACK; + + /* Setup the node used as terminator for all leaves. */ + p_map->nil.p_up = &p_map->nil; + p_map->nil.p_left = &p_map->nil; + p_map->nil.p_right = &p_map->nil; + p_map->nil.color = CL_MAP_BLACK; + + cl_qmap_remove_all(p_map); +} + +cl_map_item_t *cl_qmap_get(const cl_qmap_t * const p_map, + const uint64_t key) +{ + cl_map_item_t *p_item; + + assert(p_map); + + p_item = __cl_map_root(p_map); + + while (p_item != &p_map->nil) { + if (key == p_item->key) + break; /* just right */ + + if (key < p_item->key) + p_item = p_item->p_left; /* too small */ + else + p_item = p_item->p_right; /* too big */ + } + + return (p_item); +} + +cl_map_item_t *cl_qmap_get_next(const cl_qmap_t * const p_map, + const uint64_t key) +{ + cl_map_item_t *p_item; + cl_map_item_t *p_item_found; + + assert(p_map); + + p_item = __cl_map_root(p_map); + p_item_found = (cl_map_item_t *) & p_map->nil; + + while (p_item != &p_map->nil) { + if (key < p_item->key) { + p_item_found = p_item; + p_item = p_item->p_left; + } else { + p_item = p_item->p_right; + } + } + + return (p_item_found); +} + +void cl_qmap_apply_func(const cl_qmap_t * const p_map, + cl_pfn_qmap_apply_t pfn_func, + const void *const context) +{ + cl_map_item_t *p_map_item; + + /* Note that context can have any arbitrary value. */ + assert(p_map); + assert(pfn_func); + + p_map_item = cl_qmap_head(p_map); + while (p_map_item != cl_qmap_end(p_map)) { + pfn_func(p_map_item, (void *)context); + p_map_item = cl_qmap_next(p_map_item); + } +} + +/* + * Balance a tree starting at a given item back to the root. + */ +static void __cl_map_ins_bal(cl_qmap_t * const p_map, + cl_map_item_t * p_item) +{ + cl_map_item_t *p_grand_uncle; + + assert(p_map); + assert(p_item); + assert(p_item != &p_map->root); + + while (p_item->p_up->color == CL_MAP_RED) { + if (__cl_map_is_left_child(p_item->p_up)) { + p_grand_uncle = p_item->p_up->p_up->p_right; + assert(p_grand_uncle); + if (p_grand_uncle->color == CL_MAP_RED) { + p_grand_uncle->color = CL_MAP_BLACK; + p_item->p_up->color = CL_MAP_BLACK; + p_item->p_up->p_up->color = CL_MAP_RED; + p_item = p_item->p_up->p_up; + continue; + } + + if (!__cl_map_is_left_child(p_item)) { + p_item = p_item->p_up; + __cl_map_rot_left(p_map, p_item); + } + p_item->p_up->color = CL_MAP_BLACK; + p_item->p_up->p_up->color = CL_MAP_RED; + __cl_map_rot_right(p_map, p_item->p_up->p_up); + } else { + p_grand_uncle = p_item->p_up->p_up->p_left; + assert(p_grand_uncle); + if (p_grand_uncle->color == CL_MAP_RED) { + p_grand_uncle->color = CL_MAP_BLACK; + p_item->p_up->color = CL_MAP_BLACK; + p_item->p_up->p_up->color = CL_MAP_RED; + p_item = p_item->p_up->p_up; + continue; + } + + if (__cl_map_is_left_child(p_item)) { + p_item = p_item->p_up; + __cl_map_rot_right(p_map, p_item); + } + p_item->p_up->color = CL_MAP_BLACK; + p_item->p_up->p_up->color = CL_MAP_RED; + __cl_map_rot_left(p_map, p_item->p_up->p_up); + } + } +} + +cl_map_item_t *cl_qmap_insert(cl_qmap_t * const p_map, + const uint64_t key, + cl_map_item_t * const p_item) +{ + cl_map_item_t *p_insert_at, *p_comp_item; + + assert(p_map); + assert(p_item); + assert(p_map->root.p_up == &p_map->root); + assert(p_map->root.color != CL_MAP_RED); + assert(p_map->nil.color != CL_MAP_RED); + + p_item->p_left = &p_map->nil; + p_item->p_right = &p_map->nil; + p_item->key = key; + p_item->color = CL_MAP_RED; + + /* Find the insertion location. */ + p_insert_at = &p_map->root; + p_comp_item = __cl_map_root(p_map); + + while (p_comp_item != &p_map->nil) { + p_insert_at = p_comp_item; + + if (key == p_insert_at->key) + return (p_insert_at); + + /* Traverse the tree until the correct insertion point is found. */ + if (key < p_insert_at->key) + p_comp_item = p_insert_at->p_left; + else + p_comp_item = p_insert_at->p_right; + } + + assert(p_insert_at != &p_map->nil); + assert(p_comp_item == &p_map->nil); + /* Insert the item. */ + if (p_insert_at == &p_map->root) { + p_insert_at->p_left = p_item; + /* + * Primitive insert places the new item in front of + * the existing item. + */ + __cl_primitive_insert(&p_map->nil.pool_item.list_item, + &p_item->pool_item.list_item); + } else if (key < p_insert_at->key) { + p_insert_at->p_left = p_item; + /* + * Primitive insert places the new item in front of + * the existing item. + */ + __cl_primitive_insert(&p_insert_at->pool_item.list_item, + &p_item->pool_item.list_item); + } else { + p_insert_at->p_right = p_item; + /* + * Primitive insert places the new item in front of + * the existing item. + */ + __cl_primitive_insert(p_insert_at->pool_item.list_item.p_next, + &p_item->pool_item.list_item); + } + /* Increase the count. */ + p_map->count++; + + p_item->p_up = p_insert_at; + + /* + * We have added depth to this section of the tree. + * Rebalance as necessary as we retrace our path through the tree + * and update colors. + */ + __cl_map_ins_bal(p_map, p_item); + + __cl_map_root(p_map)->color = CL_MAP_BLACK; + + /* + * Note that it is not necessary to re-color the nil node black because all + * red color assignments are made via the p_up pointer, and nil is never + * set as the value of a p_up pointer. + */ + +#ifdef _DEBUG_ + /* Set the pointer to the map in the map item for consistency checking. */ + p_item->p_map = p_map; +#endif + + return (p_item); +} + +static void __cl_map_del_bal(cl_qmap_t * const p_map, + cl_map_item_t * p_item) +{ + cl_map_item_t *p_uncle; + + while ((p_item->color != CL_MAP_RED) && (p_item->p_up != &p_map->root)) { + if (__cl_map_is_left_child(p_item)) { + p_uncle = p_item->p_up->p_right; + + if (p_uncle->color == CL_MAP_RED) { + p_uncle->color = CL_MAP_BLACK; + p_item->p_up->color = CL_MAP_RED; + __cl_map_rot_left(p_map, p_item->p_up); + p_uncle = p_item->p_up->p_right; + } + + if (p_uncle->p_right->color != CL_MAP_RED) { + if (p_uncle->p_left->color != CL_MAP_RED) { + p_uncle->color = CL_MAP_RED; + p_item = p_item->p_up; + continue; + } + + p_uncle->p_left->color = CL_MAP_BLACK; + p_uncle->color = CL_MAP_RED; + __cl_map_rot_right(p_map, p_uncle); + p_uncle = p_item->p_up->p_right; + } + p_uncle->color = p_item->p_up->color; + p_item->p_up->color = CL_MAP_BLACK; + p_uncle->p_right->color = CL_MAP_BLACK; + __cl_map_rot_left(p_map, p_item->p_up); + break; + } else { + p_uncle = p_item->p_up->p_left; + + if (p_uncle->color == CL_MAP_RED) { + p_uncle->color = CL_MAP_BLACK; + p_item->p_up->color = CL_MAP_RED; + __cl_map_rot_right(p_map, p_item->p_up); + p_uncle = p_item->p_up->p_left; + } + + if (p_uncle->p_left->color != CL_MAP_RED) { + if (p_uncle->p_right->color != CL_MAP_RED) { + p_uncle->color = CL_MAP_RED; + p_item = p_item->p_up; + continue; + } + + p_uncle->p_right->color = CL_MAP_BLACK; + p_uncle->color = CL_MAP_RED; + __cl_map_rot_left(p_map, p_uncle); + p_uncle = p_item->p_up->p_left; + } + p_uncle->color = p_item->p_up->color; + p_item->p_up->color = CL_MAP_BLACK; + p_uncle->p_left->color = CL_MAP_BLACK; + __cl_map_rot_right(p_map, p_item->p_up); + break; + } + } + p_item->color = CL_MAP_BLACK; +} + +void cl_qmap_remove_item(cl_qmap_t * const p_map, + cl_map_item_t * const p_item) +{ + cl_map_item_t *p_child, *p_del_item; + + assert(p_map); + assert(p_item); + + if (p_item == cl_qmap_end(p_map)) + return; + + if ((p_item->p_right == &p_map->nil) || (p_item->p_left == &p_map->nil)) { + /* The item being removed has children on at most on side. */ + p_del_item = p_item; + } else { + /* + * The item being removed has children on both side. + * We select the item that will replace it. After removing + * the substitute item and rebalancing, the tree will have the + * correct topology. Exchanging the substitute for the item + * will finalize the removal. + */ + p_del_item = cl_qmap_next(p_item); + assert(p_del_item != &p_map->nil); + } + + /* Remove the item from the list. */ + __cl_primitive_remove(&p_item->pool_item.list_item); + /* Decrement the item count. */ + p_map->count--; + + /* Get the pointer to the new root's child, if any. */ + if (p_del_item->p_left != &p_map->nil) + p_child = p_del_item->p_left; + else + p_child = p_del_item->p_right; + + /* + * This assignment may modify the parent pointer of the nil node. + * This is inconsequential. + */ + p_child->p_up = p_del_item->p_up; + (*__cl_map_get_parent_ptr_to_item(p_del_item)) = p_child; + + if (p_del_item->color != CL_MAP_RED) + __cl_map_del_bal(p_map, p_child); + + /* + * Note that the splicing done below does not need to occur before + * the tree is balanced, since the actual topology changes are made by the + * preceding code. The topology is preserved by the color assignment made + * below (reader should be reminded that p_del_item == p_item in some cases). + */ + if (p_del_item != p_item) { + /* + * Finalize the removal of the specified item by exchanging it with + * the substitute which we removed above. + */ + p_del_item->p_up = p_item->p_up; + p_del_item->p_left = p_item->p_left; + p_del_item->p_right = p_item->p_right; + (*__cl_map_get_parent_ptr_to_item(p_item)) = p_del_item; + p_item->p_right->p_up = p_del_item; + p_item->p_left->p_up = p_del_item; + p_del_item->color = p_item->color; + } + + assert(p_map->nil.color != CL_MAP_RED); + +#ifdef _DEBUG_ + /* Clear the pointer to the map since the item has been removed. */ + p_item->p_map = NULL; +#endif +} + +cl_map_item_t *cl_qmap_remove(cl_qmap_t * const p_map, const uint64_t key) +{ + cl_map_item_t *p_item; + + assert(p_map); + + /* Seek the node with the specified key */ + p_item = cl_qmap_get(p_map, key); + + cl_qmap_remove_item(p_map, p_item); + + return (p_item); +} + +void cl_qmap_merge(cl_qmap_t * const p_dest_map, + cl_qmap_t * const p_src_map) +{ + cl_map_item_t *p_item, *p_item2, *p_next; + + assert(p_dest_map); + assert(p_src_map); + + p_item = cl_qmap_head(p_src_map); + + while (p_item != cl_qmap_end(p_src_map)) { + p_next = cl_qmap_next(p_item); + + /* Remove the item from its current map. */ + cl_qmap_remove_item(p_src_map, p_item); + /* Insert the item into the destination map. */ + p_item2 = + cl_qmap_insert(p_dest_map, cl_qmap_key(p_item), p_item); + /* Check that the item was successfully inserted. */ + if (p_item2 != p_item) { + /* Put the item in back in the source map. */ + p_item2 = + cl_qmap_insert(p_src_map, cl_qmap_key(p_item), + p_item); + assert(p_item2 == p_item); + } + p_item = p_next; + } +} + +static void __cl_qmap_delta_move(cl_qmap_t * const p_dest, + cl_qmap_t * const p_src, + cl_map_item_t ** const pp_item) +{ + cl_map_item_t __attribute__((__unused__)) *p_temp; + cl_map_item_t *p_next; + + /* + * Get the next item so that we can ensure that pp_item points to + * a valid item upon return from the function. + */ + p_next = cl_qmap_next(*pp_item); + /* Move the old item from its current map the the old map. */ + cl_qmap_remove_item(p_src, *pp_item); + p_temp = cl_qmap_insert(p_dest, cl_qmap_key(*pp_item), *pp_item); + /* We should never have duplicates. */ + assert(p_temp == *pp_item); + /* Point pp_item to a valid item in the source map. */ + (*pp_item) = p_next; +} + +void cl_qmap_delta(cl_qmap_t * const p_map1, + cl_qmap_t * const p_map2, + cl_qmap_t * const p_new, cl_qmap_t * const p_old) +{ + cl_map_item_t *p_item1, *p_item2; + uint64_t key1, key2; + + assert(p_map1); + assert(p_map2); + assert(p_new); + assert(p_old); + assert(cl_is_qmap_empty(p_new)); + assert(cl_is_qmap_empty(p_old)); + + p_item1 = cl_qmap_head(p_map1); + p_item2 = cl_qmap_head(p_map2); + + while (p_item1 != cl_qmap_end(p_map1) && p_item2 != cl_qmap_end(p_map2)) { + key1 = cl_qmap_key(p_item1); + key2 = cl_qmap_key(p_item2); + if (key1 < key2) { + /* We found an old item. */ + __cl_qmap_delta_move(p_old, p_map1, &p_item1); + } else if (key1 > key2) { + /* We found a new item. */ + __cl_qmap_delta_move(p_new, p_map2, &p_item2); + } else { + /* Move both forward since they have the same key. */ + p_item1 = cl_qmap_next(p_item1); + p_item2 = cl_qmap_next(p_item2); + } + } + + /* Process the remainder if the end of either source map was reached. */ + while (p_item2 != cl_qmap_end(p_map2)) + __cl_qmap_delta_move(p_new, p_map2, &p_item2); + + while (p_item1 != cl_qmap_end(p_map1)) + __cl_qmap_delta_move(p_old, p_map1, &p_item1); +} diff --git a/util/cl_qmap.h b/util/cl_qmap.h new file mode 100644 index 00000000000000..1a800f2c8fecd6 --- /dev/null +++ b/util/cl_qmap.h @@ -0,0 +1,970 @@ +/* + * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + +/* + * Abstract: + * Declaration of quick map, a binary tree where the caller always provides + * all necessary storage. + */ + +#ifndef _CL_QMAP_H_ +#define _CL_QMAP_H_ + +#include +#include +#include +#include + +typedef struct _cl_list_item { + struct _cl_list_item *p_next; + struct _cl_list_item *p_prev; +} cl_list_item_t; + +typedef struct _cl_pool_item { + cl_list_item_t list_item; +} cl_pool_item_t; + +/****h* Component Library/Quick Map +* NAME +* Quick Map +* +* DESCRIPTION +* Quick map implements a binary tree that stores user provided cl_map_item_t +* structures. Each item stored in a quick map has a unique 64-bit key +* (duplicates are not allowed). Quick map provides the ability to +* efficiently search for an item given a key. +* +* Quick map does not allocate any memory, and can therefore not fail +* any operations due to insufficient memory. Quick map can thus be useful +* in minimizing the error paths in code. +* +* Quick map is not thread safe, and users must provide serialization when +* adding and removing items from the map. +* +* The quick map functions operate on a cl_qmap_t structure which should be +* treated as opaque and should be manipulated only through the provided +* functions. +* +* SEE ALSO +* Structures: +* cl_qmap_t, cl_map_item_t, cl_map_obj_t +* +* Callbacks: +* cl_pfn_qmap_apply_t +* +* Item Manipulation: +* cl_qmap_set_obj, cl_qmap_obj, cl_qmap_key +* +* Initialization: +* cl_qmap_init +* +* Iteration: +* cl_qmap_end, cl_qmap_head, cl_qmap_tail, cl_qmap_next, cl_qmap_prev +* +* Manipulation: +* cl_qmap_insert, cl_qmap_get, cl_qmap_remove_item, cl_qmap_remove, +* cl_qmap_remove_all, cl_qmap_merge, cl_qmap_delta, cl_qmap_get_next +* +* Search: +* cl_qmap_apply_func +* +* Attributes: +* cl_qmap_count, cl_is_qmap_empty, +*********/ +/****i* Component Library: Quick Map/cl_map_color_t +* NAME +* cl_map_color_t +* +* DESCRIPTION +* The cl_map_color_t enumerated type is used to note the color of +* nodes in a map. +* +* SYNOPSIS +*/ +typedef enum _cl_map_color { + CL_MAP_RED, + CL_MAP_BLACK +} cl_map_color_t; +/* +* VALUES +* CL_MAP_RED +* The node in the map is red. +* +* CL_MAP_BLACK +* The node in the map is black. +* +* SEE ALSO +* Quick Map, cl_map_item_t +*********/ + +/****s* Component Library: Quick Map/cl_map_item_t +* NAME +* cl_map_item_t +* +* DESCRIPTION +* The cl_map_item_t structure is used by maps to store objects. +* +* The cl_map_item_t structure should be treated as opaque and should +* be manipulated only through the provided functions. +* +* SYNOPSIS +*/ +typedef struct _cl_map_item { + /* Must be first to allow casting. */ + cl_pool_item_t pool_item; + struct _cl_map_item *p_left; + struct _cl_map_item *p_right; + struct _cl_map_item *p_up; + cl_map_color_t color; + uint64_t key; +#ifdef _DEBUG_ + struct _cl_qmap *p_map; +#endif +} cl_map_item_t; +/* +* FIELDS +* pool_item +* Used to store the item in a doubly linked list, allowing more +* efficient map traversal. +* +* p_left +* Pointer to the map item that is a child to the left of the node. +* +* p_right +* Pointer to the map item that is a child to the right of the node. +* +* p_up +* Pointer to the map item that is the parent of the node. +* +* color +* Indicates whether a node is red or black in the map. +* +* key +* Value that uniquely represents a node in a map. This value is +* set by calling cl_qmap_insert and can be retrieved by calling +* cl_qmap_key. +* +* NOTES +* None of the fields of this structure should be manipulated by users, as +* they are crititcal to the proper operation of the map in which they +* are stored. +* +* To allow storing items in either a quick list, a quick pool, or a quick +* map, the map implementation guarantees that the map item can be safely +* cast to a pool item used for storing an object in a quick pool, or cast +* to a list item used for storing an object in a quick list. This removes +* the need to embed a map item, a list item, and a pool item in objects +* that need to be stored in a quick list, a quick pool, and a quick map. +* +* SEE ALSO +* Quick Map, cl_qmap_insert, cl_qmap_key, cl_pool_item_t, cl_list_item_t +*********/ + +/****s* Component Library: Quick Map/cl_map_obj_t +* NAME +* cl_map_obj_t +* +* DESCRIPTION +* The cl_map_obj_t structure is used to store objects in maps. +* +* The cl_map_obj_t structure should be treated as opaque and should +* be manipulated only through the provided functions. +* +* SYNOPSIS +*/ +typedef struct _cl_map_obj { + cl_map_item_t item; + const void *p_object; +} cl_map_obj_t; +/* +* FIELDS +* item +* Map item used by internally by the map to store an object. +* +* p_object +* User defined context. Users should not access this field directly. +* Use cl_qmap_set_obj and cl_qmap_obj to set and retrieve the value +* of this field. +* +* NOTES +* None of the fields of this structure should be manipulated by users, as +* they are crititcal to the proper operation of the map in which they +* are stored. +* +* Use cl_qmap_set_obj and cl_qmap_obj to set and retrieve the object +* stored in a map item, respectively. +* +* SEE ALSO +* Quick Map, cl_qmap_set_obj, cl_qmap_obj, cl_map_item_t +*********/ + +/****s* Component Library: Quick Map/cl_qmap_t +* NAME +* cl_qmap_t +* +* DESCRIPTION +* Quick map structure. +* +* The cl_qmap_t structure should be treated as opaque and should +* be manipulated only through the provided functions. +* +* SYNOPSIS +*/ +typedef struct _cl_qmap { + cl_map_item_t root; + cl_map_item_t nil; + size_t count; +} cl_qmap_t; +/* +* PARAMETERS +* root +* Map item that serves as root of the map. The root is set up to +* always have itself as parent. The left pointer is set to point +* to the item at the root. +* +* nil +* Map item that serves as terminator for all leaves, as well as +* providing the list item used as quick list for storing map items +* in a list for faster traversal. +* +* state +* State of the map, used to verify that operations are permitted. +* +* count +* Number of items in the map. +* +* SEE ALSO +* Quick Map +*********/ + +/****d* Component Library: Quick Map/cl_pfn_qmap_apply_t +* NAME +* cl_pfn_qmap_apply_t +* +* DESCRIPTION +* The cl_pfn_qmap_apply_t function type defines the prototype for +* functions used to iterate items in a quick map. +* +* SYNOPSIS +*/ +typedef void + (*cl_pfn_qmap_apply_t) (cl_map_item_t * const p_map_item, void *context); +/* +* PARAMETERS +* p_map_item +* [in] Pointer to a cl_map_item_t structure. +* +* context +* [in] Value passed to the callback function. +* +* RETURN VALUE +* This function does not return a value. +* +* NOTES +* This function type is provided as function prototype reference for the +* function provided by users as a parameter to the cl_qmap_apply_func +* function. +* +* SEE ALSO +* Quick Map, cl_qmap_apply_func +*********/ + +/****f* Component Library: Quick Map/cl_qmap_count +* NAME +* cl_qmap_count +* +* DESCRIPTION +* The cl_qmap_count function returns the number of items stored +* in a quick map. +* +* SYNOPSIS +*/ +static inline uint32_t cl_qmap_count(const cl_qmap_t * const p_map) +{ + assert(p_map); + return ((uint32_t) p_map->count); +} + +/* +* PARAMETERS +* p_map +* [in] Pointer to a cl_qmap_t structure whose item count to return. +* +* RETURN VALUE +* Returns the number of items stored in the map. +* +* SEE ALSO +* Quick Map, cl_is_qmap_empty +*********/ + +/****f* Component Library: Quick Map/cl_is_qmap_empty +* NAME +* cl_is_qmap_empty +* +* DESCRIPTION +* The cl_is_qmap_empty function returns whether a quick map is empty. +* +* SYNOPSIS +*/ +static inline bool cl_is_qmap_empty(const cl_qmap_t * const p_map) +{ + assert(p_map); + + return (p_map->count == 0); +} + +/* +* PARAMETERS +* p_map +* [in] Pointer to a cl_qmap_t structure to test for emptiness. +* +* RETURN VALUES +* TRUE if the quick map is empty. +* +* FALSE otherwise. +* +* SEE ALSO +* Quick Map, cl_qmap_count, cl_qmap_remove_all +*********/ + +/****f* Component Library: Quick Map/cl_qmap_set_obj +* NAME +* cl_qmap_set_obj +* +* DESCRIPTION +* The cl_qmap_set_obj function sets the object stored in a map object. +* +* SYNOPSIS +*/ +static inline void +cl_qmap_set_obj(cl_map_obj_t * const p_map_obj, + const void *const p_object) +{ + assert(p_map_obj); + p_map_obj->p_object = p_object; +} + +/* +* PARAMETERS +* p_map_obj +* [in] Pointer to a map object stucture whose object pointer +* is to be set. +* +* p_object +* [in] User defined context. +* +* RETURN VALUE +* This function does not return a value. +* +* SEE ALSO +* Quick Map, cl_qmap_obj +*********/ + +/****f* Component Library: Quick Map/cl_qmap_obj +* NAME +* cl_qmap_obj +* +* DESCRIPTION +* The cl_qmap_obj function returns the object stored in a map object. +* +* SYNOPSIS +*/ +static inline void *cl_qmap_obj(const cl_map_obj_t * const p_map_obj) +{ + assert(p_map_obj); + return ((void *)p_map_obj->p_object); +} + +/* +* PARAMETERS +* p_map_obj +* [in] Pointer to a map object stucture whose object pointer to return. +* +* RETURN VALUE +* Returns the value of the object pointer stored in the map object. +* +* SEE ALSO +* Quick Map, cl_qmap_set_obj +*********/ + +/****f* Component Library: Quick Map/cl_qmap_key +* NAME +* cl_qmap_key +* +* DESCRIPTION +* The cl_qmap_key function retrieves the key value of a map item. +* +* SYNOPSIS +*/ +static inline uint64_t cl_qmap_key(const cl_map_item_t * const p_item) +{ + assert(p_item); + return (p_item->key); +} + +/* +* PARAMETERS +* p_item +* [in] Pointer to a map item whose key value to return. +* +* RETURN VALUE +* Returns the 64-bit key value for the specified map item. +* +* NOTES +* The key value is set in a call to cl_qmap_insert. +* +* SEE ALSO +* Quick Map, cl_qmap_insert +*********/ + +/****f* Component Library: Quick Map/cl_qmap_init +* NAME +* cl_qmap_init +* +* DESCRIPTION +* The cl_qmap_init function initialized a quick map for use. +* +* SYNOPSIS +*/ +void cl_qmap_init(cl_qmap_t * const p_map); +/* +* PARAMETERS +* p_map +* [in] Pointer to a cl_qmap_t structure to initialize. +* +* RETURN VALUES +* This function does not return a value. +* +* NOTES +* Allows calling quick map manipulation functions. +* +* SEE ALSO +* Quick Map, cl_qmap_insert, cl_qmap_remove +*********/ + +/****f* Component Library: Quick Map/cl_qmap_end +* NAME +* cl_qmap_end +* +* DESCRIPTION +* The cl_qmap_end function returns the end of a quick map. +* +* SYNOPSIS +*/ +static inline const cl_map_item_t *cl_qmap_end(const cl_qmap_t * const p_map) +{ + assert(p_map); + /* Nil is the end of the map. */ + return (&p_map->nil); +} + +/* +* PARAMETERS +* p_map +* [in] Pointer to a cl_qmap_t structure whose end to return. +* +* RETURN VALUE +* Pointer to the end of the map. +* +* NOTES +* cl_qmap_end is useful for determining the validity of map items returned +* by cl_qmap_head, cl_qmap_tail, cl_qmap_next, or cl_qmap_prev. If the +* map item pointer returned by any of these functions compares to the end, +* the end of the map was encoutered. +* When using cl_qmap_head or cl_qmap_tail, this condition indicates that +* the map is empty. +* +* SEE ALSO +* Quick Map, cl_qmap_head, cl_qmap_tail, cl_qmap_next, cl_qmap_prev +*********/ + +/****f* Component Library: Quick Map/cl_qmap_head +* NAME +* cl_qmap_head +* +* DESCRIPTION +* The cl_qmap_head function returns the map item with the lowest key +* value stored in a quick map. +* +* SYNOPSIS +*/ +static inline cl_map_item_t *cl_qmap_head(const cl_qmap_t * const p_map) +{ + assert(p_map); + return ((cl_map_item_t *) p_map->nil.pool_item.list_item.p_next); +} + +/* +* PARAMETERS +* p_map +* [in] Pointer to a cl_qmap_t structure whose item with the lowest +* key is returned. +* +* RETURN VALUES +* Pointer to the map item with the lowest key in the quick map. +* +* Pointer to the map end if the quick map was empty. +* +* NOTES +* cl_qmap_head does not remove the item from the map. +* +* SEE ALSO +* Quick Map, cl_qmap_tail, cl_qmap_next, cl_qmap_prev, cl_qmap_end, +* cl_qmap_item_t +*********/ + +/****f* Component Library: Quick Map/cl_qmap_tail +* NAME +* cl_qmap_tail +* +* DESCRIPTION +* The cl_qmap_tail function returns the map item with the highest key +* value stored in a quick map. +* +* SYNOPSIS +*/ +static inline cl_map_item_t *cl_qmap_tail(const cl_qmap_t * const p_map) +{ + assert(p_map); + return ((cl_map_item_t *) p_map->nil.pool_item.list_item.p_prev); +} + +/* +* PARAMETERS +* p_map +* [in] Pointer to a cl_qmap_t structure whose item with the +* highest key is returned. +* +* RETURN VALUES +* Pointer to the map item with the highest key in the quick map. +* +* Pointer to the map end if the quick map was empty. +* +* NOTES +* cl_qmap_end does not remove the item from the map. +* +* SEE ALSO +* Quick Map, cl_qmap_head, cl_qmap_next, cl_qmap_prev, cl_qmap_end, +* cl_qmap_item_t +*********/ + +/****f* Component Library: Quick Map/cl_qmap_next +* NAME +* cl_qmap_next +* +* DESCRIPTION +* The cl_qmap_next function returns the map item with the next higher +* key value than a specified map item. +* +* SYNOPSIS +*/ +static inline cl_map_item_t *cl_qmap_next(const cl_map_item_t * const p_item) +{ + assert(p_item); + return ((cl_map_item_t *) p_item->pool_item.list_item.p_next); +} + +/* +* PARAMETERS +* p_item +* [in] Pointer to a map item whose successor to return. +* +* RETURN VALUES +* Pointer to the map item with the next higher key value in a quick map. +* +* Pointer to the map end if the specified item was the last item in +* the quick map. +* +* SEE ALSO +* Quick Map, cl_qmap_head, cl_qmap_tail, cl_qmap_prev, cl_qmap_end, +* cl_map_item_t +*********/ + +/****f* Component Library: Quick Map/cl_qmap_prev +* NAME +* cl_qmap_prev +* +* DESCRIPTION +* The cl_qmap_prev function returns the map item with the next lower +* key value than a precified map item. +* +* SYNOPSIS +*/ +static inline cl_map_item_t *cl_qmap_prev(const cl_map_item_t * const p_item) +{ + assert(p_item); + return ((cl_map_item_t *) p_item->pool_item.list_item.p_prev); +} + +/* +* PARAMETERS +* p_item +* [in] Pointer to a map item whose predecessor to return. +* +* RETURN VALUES +* Pointer to the map item with the next lower key value in a quick map. +* +* Pointer to the map end if the specifid item was the first item in +* the quick map. +* +* SEE ALSO +* Quick Map, cl_qmap_head, cl_qmap_tail, cl_qmap_next, cl_qmap_end, +* cl_map_item_t +*********/ + +/****f* Component Library: Quick Map/cl_qmap_insert +* NAME +* cl_qmap_insert +* +* DESCRIPTION +* The cl_qmap_insert function inserts a map item into a quick map. +* NOTE: Only if such a key does not alerady exist in the map !!!! +* +* SYNOPSIS +*/ +cl_map_item_t *cl_qmap_insert(cl_qmap_t * const p_map, + const uint64_t key, + cl_map_item_t * const p_item); +/* +* PARAMETERS +* p_map +* [in] Pointer to a cl_qmap_t structure into which to add the item. +* +* key +* [in] Value to assign to the item. +* +* p_item +* [in] Pointer to a cl_map_item_t stucture to insert into the quick map. +* +* RETURN VALUE +* Pointer to the item in the map with the specified key. If insertion +* was successful, this is the pointer to the item. If an item with the +* specified key already exists in the map, the pointer to that item is +* returned - but the new key is NOT inserted... +* +* NOTES +* Insertion operations may cause the quick map to rebalance. +* +* SEE ALSO +* Quick Map, cl_qmap_remove, cl_map_item_t +*********/ + +/****f* Component Library: Quick Map/cl_qmap_get +* NAME +* cl_qmap_get +* +* DESCRIPTION +* The cl_qmap_get function returns the map item associated with a key. +* +* SYNOPSIS +*/ +cl_map_item_t *cl_qmap_get(const cl_qmap_t * const p_map, + const uint64_t key); +/* +* PARAMETERS +* p_map +* [in] Pointer to a cl_qmap_t structure from which to retrieve the +* item with the specified key. +* +* key +* [in] Key value used to search for the desired map item. +* +* RETURN VALUES +* Pointer to the map item with the desired key value. +* +* Pointer to the map end if there was no item with the desired key value +* stored in the quick map. +* +* NOTES +* cl_qmap_get does not remove the item from the quick map. +* +* SEE ALSO +* Quick Map, cl_qmap_get_next, cl_qmap_remove +*********/ + +/****f* Component Library: Quick Map/cl_qmap_get_next +* NAME +* cl_qmap_get_next +* +* DESCRIPTION +* The cl_qmap_get_next function returns the first map item associated with a +* key > the key specified. +* +* SYNOPSIS +*/ +cl_map_item_t *cl_qmap_get_next(const cl_qmap_t * const p_map, + const uint64_t key); +/* +* PARAMETERS +* p_map +* [in] Pointer to a cl_qmap_t structure from which to retrieve the +* first item with a key > the specified key. +* +* key +* [in] Key value used to search for the desired map item. +* +* RETURN VALUES +* Pointer to the first map item with a key > the desired key value. +* +* Pointer to the map end if there was no item with a key > the desired key +* value stored in the quick map. +* +* NOTES +* cl_qmap_get_next does not remove the item from the quick map. +* +* SEE ALSO +* Quick Map, cl_qmap_get, cl_qmap_remove +*********/ + +/****f* Component Library: Quick Map/cl_qmap_remove_item +* NAME +* cl_qmap_remove_item +* +* DESCRIPTION +* The cl_qmap_remove_item function removes the specified map item +* from a quick map. +* +* SYNOPSIS +*/ +void +cl_qmap_remove_item(cl_qmap_t * const p_map, + cl_map_item_t * const p_item); +/* +* PARAMETERS +* p_map +* [in] Pointer to a cl_qmap_t structure from which to +* remove item. +* +* p_item +* [in] Pointer to a map item to remove from its quick map. +* +* RETURN VALUES +* This function does not return a value. +* +* In a debug build, cl_qmap_remove_item asserts that the item being removed +* is in the specified map. +* +* NOTES +* Removes the map item pointed to by p_item from its quick map. +* +* SEE ALSO +* Quick Map, cl_qmap_remove, cl_qmap_remove_all, cl_qmap_insert +*********/ + +/****f* Component Library: Quick Map/cl_qmap_remove +* NAME +* cl_qmap_remove +* +* DESCRIPTION +* The cl_qmap_remove function removes the map item with the specified key +* from a quick map. +* +* SYNOPSIS +*/ +cl_map_item_t *cl_qmap_remove(cl_qmap_t * const p_map, + const uint64_t key); +/* +* PARAMETERS +* p_map +* [in] Pointer to a cl_qmap_t structure from which to remove the item +* with the specified key. +* +* key +* [in] Key value used to search for the map item to remove. +* +* RETURN VALUES +* Pointer to the removed map item if it was found. +* +* Pointer to the map end if no item with the specified key exists in the +* quick map. +* +* SEE ALSO +* Quick Map, cl_qmap_remove_item, cl_qmap_remove_all, cl_qmap_insert +*********/ + +/****f* Component Library: Quick Map/cl_qmap_remove_all +* NAME +* cl_qmap_remove_all +* +* DESCRIPTION +* The cl_qmap_remove_all function removes all items in a quick map, +* leaving it empty. +* +* SYNOPSIS +*/ +static inline void cl_qmap_remove_all(cl_qmap_t * const p_map) +{ + assert(p_map); + + p_map->root.p_left = &p_map->nil; + p_map->nil.pool_item.list_item.p_next = &p_map->nil.pool_item.list_item; + p_map->nil.pool_item.list_item.p_prev = &p_map->nil.pool_item.list_item; + p_map->count = 0; +} + +/* +* PARAMETERS +* p_map +* [in] Pointer to a cl_qmap_t structure to empty. +* +* RETURN VALUES +* This function does not return a value. +* +* SEE ALSO +* Quick Map, cl_qmap_remove, cl_qmap_remove_item +*********/ + +/****f* Component Library: Quick Map/cl_qmap_merge +* NAME +* cl_qmap_merge +* +* DESCRIPTION +* The cl_qmap_merge function moves all items from one map to another, +* excluding duplicates. +* +* SYNOPSIS +*/ +void +cl_qmap_merge(cl_qmap_t * const p_dest_map, + cl_qmap_t * const p_src_map); +/* +* PARAMETERS +* p_dest_map +* [out] Pointer to a cl_qmap_t structure to which items should be added. +* +* p_src_map +* [in/out] Pointer to a cl_qmap_t structure whose items to add +* to p_dest_map. +* +* RETURN VALUES +* This function does not return a value. +* +* NOTES +* Items are evaluated based on their keys only. +* +* Upon return from cl_qmap_merge, the quick map referenced by p_src_map +* contains all duplicate items. +* +* SEE ALSO +* Quick Map, cl_qmap_delta +*********/ + +/****f* Component Library: Quick Map/cl_qmap_delta +* NAME +* cl_qmap_delta +* +* DESCRIPTION +* The cl_qmap_delta function computes the differences between two maps. +* +* SYNOPSIS +*/ +void +cl_qmap_delta(cl_qmap_t * const p_map1, + cl_qmap_t * const p_map2, + cl_qmap_t * const p_new, cl_qmap_t * const p_old); +/* +* PARAMETERS +* p_map1 +* [in/out] Pointer to the first of two cl_qmap_t structures whose +* differences to compute. +* +* p_map2 +* [in/out] Pointer to the second of two cl_qmap_t structures whose +* differences to compute. +* +* p_new +* [out] Pointer to an empty cl_qmap_t structure that contains the +* items unique to p_map2 upon return from the function. +* +* p_old +* [out] Pointer to an empty cl_qmap_t structure that contains the +* items unique to p_map1 upon return from the function. +* +* RETURN VALUES +* This function does not return a value. +* +* NOTES +* Items are evaluated based on their keys. Items that exist in both +* p_map1 and p_map2 remain in their respective maps. Items that +* exist only p_map1 are moved to p_old. Likewise, items that exist only +* in p_map2 are moved to p_new. This function can be useful in evaluating +* changes between two maps. +* +* Both maps pointed to by p_new and p_old must be empty on input. This +* requirement removes the possibility of failures. +* +* SEE ALSO +* Quick Map, cl_qmap_merge +*********/ + +/****f* Component Library: Quick Map/cl_qmap_apply_func +* NAME +* cl_qmap_apply_func +* +* DESCRIPTION +* The cl_qmap_apply_func function executes a specified function +* for every item stored in a quick map. +* +* SYNOPSIS +*/ +void +cl_qmap_apply_func(const cl_qmap_t * const p_map, + cl_pfn_qmap_apply_t pfn_func, + const void *const context); +/* +* PARAMETERS +* p_map +* [in] Pointer to a cl_qmap_t structure. +* +* pfn_func +* [in] Function invoked for every item in the quick map. +* See the cl_pfn_qmap_apply_t function type declaration for +* details about the callback function. +* +* context +* [in] Value to pass to the callback functions to provide context. +* +* RETURN VALUE +* This function does not return a value. +* +* NOTES +* The function provided must not perform any map operations, as these +* would corrupt the quick map. +* +* SEE ALSO +* Quick Map, cl_pfn_qmap_apply_t +*********/ + +#endif /* _CL_QMAP_H_ */ From patchwork Tue May 14 23:49:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10944123 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EDC2C912 for ; Wed, 15 May 2019 00:11:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D42A728906 for ; Wed, 15 May 2019 00:11:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1863289B9; Wed, 15 May 2019 00:11:16 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 EC71A289A7 for ; Wed, 15 May 2019 00:11:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726793AbfEOALM (ORCPT ); Tue, 14 May 2019 20:11:12 -0400 Received: from mail-qt1-f174.google.com ([209.85.160.174]:47028 "EHLO mail-qt1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726707AbfEOALL (ORCPT ); Tue, 14 May 2019 20:11:11 -0400 Received: by mail-qt1-f174.google.com with SMTP id z19so1214577qtz.13 for ; Tue, 14 May 2019 17:11:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9iL4btfW1JDPJE0nL3RNr/j4JPZIC1PYOfKuP797678=; b=kFk0DBLxYKJi/r68ewzZupWfI61Or9diIXHogqR+KljTW0zTMmB/dgz/WfZejqjTPO h/tHP1lJhkBmQG0YJiQyM3BMkJAXr+Ugnb/9fHwHu4+An189YssJF4bJrNWZh/+6I8ZW O4Z2GvSicClRbMZk4YC+YWe26TYVpCVNBK+Bb1xMuU8eyhvOhtz32d3Kx3z3WsQsgaJQ ok8X/zdhaIyhV1ISJTFkaVbylF3PhJPzYe2qE1hJJSCKcKffk5OJSah+qAKPy5xva+gY 64WHAcPLk9Ogw7sVCSpLM6xm8ppwX+GFkly6+RcgfLJV4qpIslGysgCbp2OPQyIgO0UH QYXQ== 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:mime-version:content-transfer-encoding; bh=9iL4btfW1JDPJE0nL3RNr/j4JPZIC1PYOfKuP797678=; b=LhizbPm0md+eVRX7LLI1Z9GfwdkreN5/LSQ8MSqPoAIGpWJhbuPlkONYGWCTYGhI/M 2iuBoQZlPPOBEvWOMB9sHQw0d4kG5NhLjLvXTstYLPyApTFmJM9bRmBpdkHuAXc0E8lE pjOwPQp82zTBpA8hMV1YcHF3G2otOYgZc/6lDxHgK5EyCr4/umc/IdrdQKsn2HUvDfMk ki05A3dvorT4qc4HJjn9rUDkGI6knouxYN7P0rGTMI85VxDX3TfdNrItXQjGqd6BfaP9 VlyBDd7eTeti4M7U17A8xBOhpabKZ0UfC6sJQk/PNHBsibLTohOa4I56LyO9FL2HnidU 6fhA== X-Gm-Message-State: APjAAAVIGeWo+GmYOFWkBAFQdwuwS2kgfQjPPORFHTPm1qKJowjP6lJF gFwOb3vh76Dl3Od/y8TTFnz/i/mPv5U= X-Google-Smtp-Source: APXvYqwQ+nAIesSe6fNJ2JUVhLVvmyFYBiAfWyXf/b5Xn9zGZcNgs10jqy71JtA1vlmoE5dvmkuwNw== X-Received: by 2002:ac8:3884:: with SMTP id f4mr33541401qtc.300.1557879067360; Tue, 14 May 2019 17:11:07 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id t58sm296590qtj.4.2019.05.14.17.11.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 17:11:06 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hQhAx-0001NV-2A; Tue, 14 May 2019 20:49:39 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 09/20] ibdiags: Copy part of ib_types.h from opensm Date: Tue, 14 May 2019 20:49:25 -0300 Message-Id: <20190514234936.5175-10-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514234936.5175-1-jgg@ziepe.ca> References: <20190514234936.5175-1-jgg@ziepe.ca> MIME-Version: 1.0 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: Jason Gunthorpe This is used extensively, rework it to match rdma-core's coding convention and include it directly. This version is copied from opensm commit 6d49a7e3c02a ("libvendor/osm_vendor_mlx_sim.c: In osmv_transport_init, fix memory leaks on error") Signed-off-by: Jason Gunthorpe --- ibdiags/include/ibdiag_common.h | 52 +- ibdiags/include/ibdiag_sa.h | 2 +- ibdiags/libibmad/src/CMakeLists.txt | 4 + ibdiags/libibmad/src/iba_types.h | 1734 +++++++++++++++++ .../include/infiniband/ibnetdisc.h | 1 - ibdiags/libibnetdisc/src/CMakeLists.txt | 3 - ibdiags/libibnetdisc/src/ibnetdisc.c | 2 + ibdiags/src/CMakeLists.txt | 3 - ibdiags/src/ibsendtrap.c | 1 - ibdiags/src/mcm_rereg_test.c | 1 - ibdiags/src/perfquery.c | 1 - ibdiags/src/saquery.c | 1 - ibtypes.py | 61 + 13 files changed, 1803 insertions(+), 63 deletions(-) create mode 100644 ibdiags/libibmad/src/iba_types.h create mode 100644 ibtypes.py diff --git a/ibdiags/include/ibdiag_common.h b/ibdiags/include/ibdiag_common.h index 966d1599451a25..bee40789ee6a2a 100644 --- a/ibdiags/include/ibdiag_common.h +++ b/ibdiags/include/ibdiag_common.h @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include @@ -74,56 +74,6 @@ extern char *ibd_nd_format; #define NOT_DISPLAYED_STR "" -/* not all versions of ib_types.h will have this define */ -#ifndef IB_PM_PC_XMIT_WAIT_SUP -#define IB_PM_PC_XMIT_WAIT_SUP (htobe16(((uint16_t)1)<<12)) -#endif - -/* PM ClassPortInfo CapabilityMask Bits */ -#ifndef IS_PM_RSFEC_COUNTERS_SUP -#define IS_PM_RSFEC_COUNTERS_SUP (htobe16(((uint16_t)1)<<14)) -#endif - -#ifndef IB_PM_IS_QP1_DROP_SUP -#define IB_PM_IS_QP1_DROP_SUP (htobe16(((uint16_t)1)<<15)) -#endif - -/* PM ClassPortInfo CapabilityMask2 Bits */ -#ifndef IB_PM_IS_ADDL_PORT_CTRS_EXT_SUP -#define IB_PM_IS_ADDL_PORT_CTRS_EXT_SUP (htobe32(((uint32_t)1)<<1)) -#endif - -/* SM PortInfo CapabilityMask2 Bits */ -#ifndef IB_PORT_CAP2_IS_PORT_INFO_EXT_SUPPORTED -#define IB_PORT_CAP2_IS_PORT_INFO_EXT_SUPPORTED (htobe16(0x0002)) -#endif - -/* SM PortInfoExtended Fec Mode Bits */ -#ifndef IB_PORT_EXT_NO_FEC_MODE_ACTIVE -#define IB_PORT_EXT_NO_FEC_MODE_ACTIVE 0 -#endif - -#ifndef IB_PORT_EXT_FIRE_CODE_FEC_MODE_ACTIVE -#define IB_PORT_EXT_FIRE_CODE_FEC_MODE_ACTIVE (htobe16(0x0001)) -#endif - -#ifndef IB_PORT_EXT_RS_FEC_MODE_ACTIVE -#define IB_PORT_EXT_RS_FEC_MODE_ACTIVE (htobe16(0x0002)) -#endif - -#ifndef IB_PORT_EXT_LOW_LATENCY_RS_FEC_MODE_ACTIVE -#define IB_PORT_EXT_LOW_LATENCY_RS_FEC_MODE_ACTIVE (htobe16(0x0003)) -#endif - -#ifndef IB_PORT_EXT_RS_FEC2_MODE_ACTIVE -#define IB_PORT_EXT_RS_FEC2_MODE_ACTIVE (htobe16(0x0004)) -#endif - -/* SM PortInfoExtended CapabilityMask Bits */ -#ifndef IB_PORT_EXT_CAP_IS_FEC_MODE_SUPPORTED -#define IB_PORT_EXT_CAP_IS_FEC_MODE_SUPPORTED (htobe32(0x00000001)) -#endif - struct ibdiag_opt { const char *name; char letter; diff --git a/ibdiags/include/ibdiag_sa.h b/ibdiags/include/ibdiag_sa.h index 886e963cf7ef36..f0347c8f426b02 100644 --- a/ibdiags/include/ibdiag_sa.h +++ b/ibdiags/include/ibdiag_sa.h @@ -40,7 +40,7 @@ #define _IBDIAG_SA_H_ #include -#include +#include /* define an SA query structure to be common * This is by no means optimal but it moves the saquery functionality out of diff --git a/ibdiags/libibmad/src/CMakeLists.txt b/ibdiags/libibmad/src/CMakeLists.txt index 37da71a336324a..81fa4a366fc3c7 100644 --- a/ibdiags/libibmad/src/CMakeLists.txt +++ b/ibdiags/libibmad/src/CMakeLists.txt @@ -3,6 +3,10 @@ publish_headers(infiniband ../include/infiniband/mad_osd.h ) +publish_internal_headers(util + iba_types.h + ) + rdma_library(ibmad libibmad.map # See Documentation/versioning.md 5 5.3.${PACKAGE_VERSION} diff --git a/ibdiags/libibmad/src/iba_types.h b/ibdiags/libibmad/src/iba_types.h new file mode 100644 index 00000000000000..0805aa9d586d4e --- /dev/null +++ b/ibdiags/libibmad/src/iba_types.h @@ -0,0 +1,1734 @@ +/* + * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved. + * Copyright (c) 2002-2019 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. + * Copyright (c) 2009 HNR Consulting. All rights reserved. + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + +#ifndef __LIBIBMAD_IB_TYPES_H__ +#define __LIBIBMAD_IB_TYPES_H__ + +#include +#include +#include +#include +#include + +#define MAD_BLOCK_SIZE 256 +#define MAD_RMPP_HDR_SIZE 36 +#define MAD_BLOCK_GRH_SIZE 296 +#define IB_LID_PERMISSIVE 0xFFFF +#define IB_DEFAULT_PKEY 0xFFFF +#define IB_QP1_WELL_KNOWN_Q_KEY htobe32(0x80010000) +#define IB_QP0 0 +#define IB_QP1 htobe32(1) +#define IB_QP_PRIVILEGED_Q_KEY htobe32(0x80000000) +#define IB_LID_UCAST_START_HO 0x0001 +#define IB_LID_UCAST_START htobe16(IB_LID_UCAST_START_HO) +#define IB_LID_UCAST_END_HO 0xBFFF +#define IB_LID_UCAST_END htobe16(IB_LID_UCAST_END_HO) +#define IB_LID_MCAST_START_HO 0xC000 +#define IB_LID_MCAST_START htobe16(IB_LID_MCAST_START_HO) +#define IB_LID_MCAST_END_HO 0xFFFE +#define IB_LID_MCAST_END htobe16(IB_LID_MCAST_END_HO) +#define IB_DEFAULT_SUBNET_PREFIX htobe64(0xFE80000000000000ULL) +#define IB_DEFAULT_SUBNET_PREFIX_HO 0xFE80000000000000ULL +#define IB_NODE_NUM_PORTS_MAX 0xFE +#define IB_INVALID_PORT_NUM 0xFF +#define IB_SUBNET_PATH_HOPS_MAX 64 +#define IB_HOPLIMIT_MAX 255 +#define IB_MC_SCOPE_LINK_LOCAL 0x2 +#define IB_MC_SCOPE_SITE_LOCAL 0x5 +#define IB_MC_SCOPE_ORG_LOCAL 0x8 +#define IB_MC_SCOPE_GLOBAL 0xE +#define IB_PKEY_MAX_BLOCKS 2048 +#define IB_MCAST_MAX_BLOCK_ID 511 +#define IB_MCAST_BLOCK_ID_MASK_HO 0x000001FF +#define IB_MCAST_BLOCK_SIZE 32 +#define IB_MCAST_MASK_SIZE 16 +#define IB_MCAST_POSITION_MASK_HO 0xF0000000 +#define IB_MCAST_POSITION_MAX 0xF +#define IB_MCAST_POSITION_SHIFT 28 +#define IB_PKEY_BASE_MASK htobe16(0x7FFF) +#define IB_PKEY_TYPE_MASK htobe16(0x8000) +#define IB_DEFAULT_PARTIAL_PKEY htobe16(0x7FFF) +#define IB_MCLASS_SUBN_LID 0x01 +#define IB_MCLASS_SUBN_DIR 0x81 +#define IB_MCLASS_SUBN_ADM 0x03 +#define IB_MCLASS_PERF 0x04 +#define IB_MCLASS_BM 0x05 +#define IB_MCLASS_DEV_MGMT 0x06 +#define IB_MCLASS_COMM_MGMT 0x07 +#define IB_MCLASS_SNMP 0x08 +#define IB_MCLASS_VENDOR_LOW_RANGE_MIN 0x09 +#define IB_MCLASS_VENDOR_LOW_RANGE_MAX 0x0F +#define IB_MCLASS_DEV_ADM 0x10 +#define IB_MCLASS_BIS 0x12 +#define IB_MCLASS_CC 0x21 +#define IB_MCLASS_VENDOR_HIGH_RANGE_MIN 0x30 +#define IB_MCLASS_VENDOR_HIGH_RANGE_MAX 0x4F +#define IB_MAX_METHODS 128 +#define IB_MAD_METHOD_RESP_MASK 0x80 +#define IB_MAD_METHOD_GET 0x01 +#define IB_MAD_METHOD_SET 0x02 +#define IB_MAD_METHOD_GET_RESP 0x81 +#define IB_MAD_METHOD_DELETE 0x15 +#define IB_MAD_METHOD_GETTABLE 0x12 +#define IB_MAD_METHOD_GETTABLE_RESP 0x92 +#define IB_MAD_METHOD_GETTRACETABLE 0x13 +#define IB_MAD_METHOD_GETMULTI 0x14 +#define IB_MAD_METHOD_GETMULTI_RESP 0x94 +#define IB_MAD_METHOD_SEND 0x03 +#define IB_MAD_METHOD_TRAP 0x05 +#define IB_MAD_METHOD_REPORT 0x06 +#define IB_MAD_METHOD_REPORT_RESP 0x86 +#define IB_MAD_METHOD_TRAP_REPRESS 0x07 +#define IB_MAD_STATUS_BUSY htobe16(0x0001) +#define IB_MAD_STATUS_REDIRECT htobe16(0x0002) +#define IB_MAD_STATUS_UNSUP_CLASS_VER htobe16(0x0004) +#define IB_MAD_STATUS_UNSUP_METHOD htobe16(0x0008) +#define IB_MAD_STATUS_UNSUP_METHOD_ATTR htobe16(0x000C) +#define IB_MAD_STATUS_INVALID_FIELD htobe16(0x001C) +#define IB_MAD_STATUS_CLASS_MASK htobe16(0xFF00) +#define IB_SA_MAD_STATUS_SUCCESS 0x0000 +#define IB_SA_MAD_STATUS_NO_RESOURCES htobe16(0x0100) +#define IB_SA_MAD_STATUS_REQ_INVALID htobe16(0x0200) +#define IB_SA_MAD_STATUS_NO_RECORDS htobe16(0x0300) +#define IB_SA_MAD_STATUS_TOO_MANY_RECORDS htobe16(0x0400) +#define IB_SA_MAD_STATUS_INVALID_GID htobe16(0x0500) +#define IB_SA_MAD_STATUS_INSUF_COMPS htobe16(0x0600) +#define IB_SA_MAD_STATUS_DENIED htobe16(0x0700) +#define IB_SA_MAD_STATUS_PRIO_SUGGESTED htobe16(0x0800) +#define IB_DM_MAD_STATUS_NO_IOC_RESP htobe16(0x0100) +#define IB_DM_MAD_STATUS_NO_SVC_ENTRIES htobe16(0x0200) +#define IB_DM_MAD_STATUS_IOC_FAILURE htobe16(0x8000) +#define IB_MAD_ATTR_CLASS_PORT_INFO htobe16(0x0001) +#define IB_MAD_ATTR_NOTICE htobe16(0x0002) +#define IB_MAD_ATTR_INFORM_INFO htobe16(0x0003) +#define IB_MAD_ATTR_NODE_DESC htobe16(0x0010) +#define IB_MAD_ATTR_PORT_SMPL_CTRL htobe16(0x0010) +#define IB_MAD_ATTR_NODE_INFO htobe16(0x0011) +#define IB_MAD_ATTR_PORT_SMPL_RSLT htobe16(0x0011) +#define IB_MAD_ATTR_SWITCH_INFO htobe16(0x0012) +#define IB_MAD_ATTR_PORT_CNTRS htobe16(0x0012) +#define IB_MAD_ATTR_PORT_CNTRS_EXT htobe16(0x001D) +#define IB_MAD_ATTR_PORT_XMIT_DATA_SL htobe16(0x0036) +#define IB_MAD_ATTR_PORT_RCV_DATA_SL htobe16(0x0037) +#define IB_MAD_ATTR_GUID_INFO htobe16(0x0014) +#define IB_MAD_ATTR_PORT_INFO htobe16(0x0015) +#define IB_MAD_ATTR_P_KEY_TABLE htobe16(0x0016) +#define IB_MAD_ATTR_SLVL_TABLE htobe16(0x0017) +#define IB_MAD_ATTR_VL_ARBITRATION htobe16(0x0018) +#define IB_MAD_ATTR_LIN_FWD_TBL htobe16(0x0019) +#define IB_MAD_ATTR_RND_FWD_TBL htobe16(0x001A) +#define IB_MAD_ATTR_MCAST_FWD_TBL htobe16(0x001B) +#define IB_MAD_ATTR_NODE_RECORD htobe16(0x0011) +#define IB_MAD_ATTR_PORTINFO_RECORD htobe16(0x0012) +#define IB_MAD_ATTR_SWITCH_INFO_RECORD htobe16(0x0014) +#define IB_MAD_ATTR_LINK_RECORD htobe16(0x0020) +#define IB_MAD_ATTR_SM_INFO htobe16(0x0020) +#define IB_MAD_ATTR_SMINFO_RECORD htobe16(0x0018) +#define IB_MAD_ATTR_GUIDINFO_RECORD htobe16(0x0030) +#define IB_MAD_ATTR_VENDOR_DIAG htobe16(0x0030) +#define IB_MAD_ATTR_LED_INFO htobe16(0x0031) +#define IB_MAD_ATTR_MLNX_EXTENDED_PORT_INFO htobe16(0xFF90) +#define IB_MAD_ATTR_SERVICE_RECORD htobe16(0x0031) +#define IB_MAD_ATTR_LFT_RECORD htobe16(0x0015) +#define IB_MAD_ATTR_MFT_RECORD htobe16(0x0017) +#define IB_MAD_ATTR_PKEY_TBL_RECORD htobe16(0x0033) +#define IB_MAD_ATTR_PATH_RECORD htobe16(0x0035) +#define IB_MAD_ATTR_VLARB_RECORD htobe16(0x0036) +#define IB_MAD_ATTR_SLVL_RECORD htobe16(0x0013) +#define IB_MAD_ATTR_MCMEMBER_RECORD htobe16(0x0038) +#define IB_MAD_ATTR_TRACE_RECORD htobe16(0x0039) +#define IB_MAD_ATTR_MULTIPATH_RECORD htobe16(0x003A) +#define IB_MAD_ATTR_SVC_ASSOCIATION_RECORD htobe16(0x003B) +#define IB_MAD_ATTR_INFORM_INFO_RECORD htobe16(0x00F3) +#define IB_MAD_ATTR_IO_UNIT_INFO htobe16(0x0010) +#define IB_MAD_ATTR_IO_CONTROLLER_PROFILE htobe16(0x0011) +#define IB_MAD_ATTR_SERVICE_ENTRIES htobe16(0x0012) +#define IB_MAD_ATTR_DIAGNOSTIC_TIMEOUT htobe16(0x0020) +#define IB_MAD_ATTR_PREPARE_TO_TEST htobe16(0x0021) +#define IB_MAD_ATTR_TEST_DEVICE_ONCE htobe16(0x0022) +#define IB_MAD_ATTR_TEST_DEVICE_LOOP htobe16(0x0023) +#define IB_MAD_ATTR_DIAG_CODE htobe16(0x0024) +#define IB_MAD_ATTR_SVC_ASSOCIATION_RECORD htobe16(0x003B) +#define IB_MAD_ATTR_CONG_INFO htobe16(0x0011) +#define IB_MAD_ATTR_CONG_KEY_INFO htobe16(0x0012) +#define IB_MAD_ATTR_CONG_LOG htobe16(0x0013) +#define IB_MAD_ATTR_SW_CONG_SETTING htobe16(0x0014) +#define IB_MAD_ATTR_SW_PORT_CONG_SETTING htobe16(0x0015) +#define IB_MAD_ATTR_CA_CONG_SETTING htobe16(0x0016) +#define IB_MAD_ATTR_CC_TBL htobe16(0x0017) +#define IB_MAD_ATTR_TIME_STAMP htobe16(0x0018) +#define IB_NODE_TYPE_CA 0x01 +#define IB_NODE_TYPE_SWITCH 0x02 +#define IB_NODE_TYPE_ROUTER 0x03 +#define IB_NOTICE_PRODUCER_TYPE_CA htobe32(0x000001) +#define IB_NOTICE_PRODUCER_TYPE_SWITCH htobe32(0x000002) +#define IB_NOTICE_PRODUCER_TYPE_ROUTER htobe32(0x000003) +#define IB_NOTICE_PRODUCER_TYPE_CLASS_MGR htobe32(0x000004) +#define IB_MTU_LEN_256 1 +#define IB_MTU_LEN_512 2 +#define IB_MTU_LEN_1024 3 +#define IB_MTU_LEN_2048 4 +#define IB_MTU_LEN_4096 5 +#define IB_PATH_SELECTOR_GREATER_THAN 0 +#define IB_PATH_SELECTOR_LESS_THAN 1 +#define IB_PATH_SELECTOR_EXACTLY 2 +#define IB_PATH_SELECTOR_LARGEST 3 +#define IB_SMINFO_STATE_NOTACTIVE 0 +#define IB_SMINFO_STATE_DISCOVERING 1 +#define IB_SMINFO_STATE_STANDBY 2 +#define IB_SMINFO_STATE_MASTER 3 +#define IB_PATH_REC_SL_MASK 0x000F +#define IB_MULTIPATH_REC_SL_MASK 0x000F +#define IB_PATH_REC_QOS_CLASS_MASK 0xFFF0 +#define IB_MULTIPATH_REC_QOS_CLASS_MASK 0xFFF0 +#define IB_PATH_REC_SELECTOR_MASK 0xC0 +#define IB_MULTIPATH_REC_SELECTOR_MASK 0xC0 +#define IB_PATH_REC_BASE_MASK 0x3F +#define IB_MULTIPATH_REC_BASE_MASK 0x3F +#define IB_LINK_NO_CHANGE 0 +#define IB_LINK_DOWN 1 +#define IB_LINK_INIT 2 +#define IB_LINK_ARMED 3 +#define IB_LINK_ACTIVE 4 +#define IB_LINK_ACT_DEFER 5 +#define IB_JOIN_STATE_FULL 1 +#define IB_JOIN_STATE_NON 2 +#define IB_JOIN_STATE_SEND_ONLY 4 +#define IB_JOIN_STATE_SEND_ONLY_FULL 8 +typedef union { + uint8_t raw[16]; + struct _ib_gid_unicast { + __be64 prefix; + __be64 interface_id; + } __attribute__((packed)) unicast; + struct _ib_gid_multicast { + uint8_t header[2]; + uint8_t raw_group_id[14]; + } __attribute__((packed)) multicast; + struct _ib_gid_ip_multicast { + uint8_t header[2]; + __be16 signature; + __be16 p_key; + uint8_t group_id[10]; + } __attribute__((packed)) ip_multicast; +} __attribute__((packed)) ib_gid_t; +typedef struct { + __be64 service_id; + ib_gid_t dgid; + ib_gid_t sgid; + __be16 dlid; + __be16 slid; + __be32 hop_flow_raw; + uint8_t tclass; + uint8_t num_path; + __be16 pkey; + __be16 qos_class_sl; + uint8_t mtu; + uint8_t rate; + uint8_t pkt_life; + uint8_t preference; + uint8_t resv2[6]; +} __attribute__((packed)) ib_path_rec_t; +#define IB_PR_COMPMASK_SERVICEID_MSB htobe64(((uint64_t)1) << 0) +#define IB_PR_COMPMASK_SERVICEID_LSB htobe64(((uint64_t)1) << 1) +#define IB_PR_COMPMASK_DGID htobe64(((uint64_t)1) << 2) +#define IB_PR_COMPMASK_SGID htobe64(((uint64_t)1) << 3) +#define IB_PR_COMPMASK_DLID htobe64(((uint64_t)1) << 4) +#define IB_PR_COMPMASK_SLID htobe64(((uint64_t)1) << 5) +#define IB_PR_COMPMASK_RAWTRAFFIC htobe64(((uint64_t)1) << 6) +#define IB_PR_COMPMASK_RESV0 htobe64(((uint64_t)1) << 7) +#define IB_PR_COMPMASK_FLOWLABEL htobe64(((uint64_t)1) << 8) +#define IB_PR_COMPMASK_HOPLIMIT htobe64(((uint64_t)1) << 9) +#define IB_PR_COMPMASK_TCLASS htobe64(((uint64_t)1) << 10) +#define IB_PR_COMPMASK_REVERSIBLE htobe64(((uint64_t)1) << 11) +#define IB_PR_COMPMASK_NUMBPATH htobe64(((uint64_t)1) << 12) +#define IB_PR_COMPMASK_PKEY htobe64(((uint64_t)1) << 13) +#define IB_PR_COMPMASK_QOS_CLASS htobe64(((uint64_t)1) << 14) +#define IB_PR_COMPMASK_SL htobe64(((uint64_t)1) << 15) +#define IB_PR_COMPMASK_MTUSELEC htobe64(((uint64_t)1) << 16) +#define IB_PR_COMPMASK_MTU htobe64(((uint64_t)1) << 17) +#define IB_PR_COMPMASK_RATESELEC htobe64(((uint64_t)1) << 18) +#define IB_PR_COMPMASK_RATE htobe64(((uint64_t)1) << 19) +#define IB_PR_COMPMASK_PKTLIFETIMESELEC htobe64(((uint64_t)1) << 20) +#define IB_PR_COMPMASK_PKTLIFETIME htobe64(((uint64_t)1) << 21) +#define IB_LR_COMPMASK_FROM_LID htobe64(((uint64_t)1) << 0) +#define IB_LR_COMPMASK_FROM_PORT htobe64(((uint64_t)1) << 1) +#define IB_LR_COMPMASK_TO_PORT htobe64(((uint64_t)1) << 2) +#define IB_LR_COMPMASK_TO_LID htobe64(((uint64_t)1) << 3) +#define IB_VLA_COMPMASK_LID htobe64(((uint64_t)1) << 0) +#define IB_VLA_COMPMASK_OUT_PORT htobe64(((uint64_t)1) << 1) +#define IB_VLA_COMPMASK_BLOCK htobe64(((uint64_t)1) << 2) +#define IB_SLVL_COMPMASK_LID htobe64(((uint64_t)1) << 0) +#define IB_SLVL_COMPMASK_IN_PORT htobe64(((uint64_t)1) << 1) +#define IB_SLVL_COMPMASK_OUT_PORT htobe64(((uint64_t)1) << 2) +#define IB_PKEY_COMPMASK_LID htobe64(((uint64_t)1) << 0) +#define IB_PKEY_COMPMASK_BLOCK htobe64(((uint64_t)1) << 1) +#define IB_PKEY_COMPMASK_PORT htobe64(((uint64_t)1) << 2) +#define IB_SWIR_COMPMASK_LID htobe64(((uint64_t)1) << 0) +#define IB_SWIR_COMPMASK_RESERVED1 htobe64(((uint64_t)1) << 1) +#define IB_LFTR_COMPMASK_LID htobe64(((uint64_t)1) << 0) +#define IB_LFTR_COMPMASK_BLOCK htobe64(((uint64_t)1) << 1) +#define IB_MFTR_COMPMASK_LID htobe64(((uint64_t)1) << 0) +#define IB_MFTR_COMPMASK_POSITION htobe64(((uint64_t)1) << 1) +#define IB_MFTR_COMPMASK_RESERVED1 htobe64(((uint64_t)1) << 2) +#define IB_MFTR_COMPMASK_BLOCK htobe64(((uint64_t)1) << 3) +#define IB_MFTR_COMPMASK_RESERVED2 htobe64(((uint64_t)1) << 4) +#define IB_NR_COMPMASK_LID htobe64(((uint64_t)1) << 0) +#define IB_NR_COMPMASK_RESERVED1 htobe64(((uint64_t)1) << 1) +#define IB_NR_COMPMASK_BASEVERSION htobe64(((uint64_t)1) << 2) +#define IB_NR_COMPMASK_CLASSVERSION htobe64(((uint64_t)1) << 3) +#define IB_NR_COMPMASK_NODETYPE htobe64(((uint64_t)1) << 4) +#define IB_NR_COMPMASK_NUMPORTS htobe64(((uint64_t)1) << 5) +#define IB_NR_COMPMASK_SYSIMAGEGUID htobe64(((uint64_t)1) << 6) +#define IB_NR_COMPMASK_NODEGUID htobe64(((uint64_t)1) << 7) +#define IB_NR_COMPMASK_PORTGUID htobe64(((uint64_t)1) << 8) +#define IB_NR_COMPMASK_PARTCAP htobe64(((uint64_t)1) << 9) +#define IB_NR_COMPMASK_DEVID htobe64(((uint64_t)1) << 10) +#define IB_NR_COMPMASK_REV htobe64(((uint64_t)1) << 11) +#define IB_NR_COMPMASK_PORTNUM htobe64(((uint64_t)1) << 12) +#define IB_NR_COMPMASK_VENDID htobe64(((uint64_t)1) << 13) +#define IB_NR_COMPMASK_NODEDESC htobe64(((uint64_t)1) << 14) +#define IB_SR_COMPMASK_SID htobe64(((uint64_t)1) << 0) +#define IB_SR_COMPMASK_SGID htobe64(((uint64_t)1) << 1) +#define IB_SR_COMPMASK_SPKEY htobe64(((uint64_t)1) << 2) +#define IB_SR_COMPMASK_RES1 htobe64(((uint64_t)1) << 3) +#define IB_SR_COMPMASK_SLEASE htobe64(((uint64_t)1) << 4) +#define IB_SR_COMPMASK_SKEY htobe64(((uint64_t)1) << 5) +#define IB_SR_COMPMASK_SNAME htobe64(((uint64_t)1) << 6) +#define IB_SR_COMPMASK_SDATA8_0 htobe64(((uint64_t)1) << 7) +#define IB_SR_COMPMASK_SDATA8_1 htobe64(((uint64_t)1) << 8) +#define IB_SR_COMPMASK_SDATA8_2 htobe64(((uint64_t)1) << 9) +#define IB_SR_COMPMASK_SDATA8_3 htobe64(((uint64_t)1) << 10) +#define IB_SR_COMPMASK_SDATA8_4 htobe64(((uint64_t)1) << 11) +#define IB_SR_COMPMASK_SDATA8_5 htobe64(((uint64_t)1) << 12) +#define IB_SR_COMPMASK_SDATA8_6 htobe64(((uint64_t)1) << 13) +#define IB_SR_COMPMASK_SDATA8_7 htobe64(((uint64_t)1) << 14) +#define IB_SR_COMPMASK_SDATA8_8 htobe64(((uint64_t)1) << 15) +#define IB_SR_COMPMASK_SDATA8_9 htobe64(((uint64_t)1) << 16) +#define IB_SR_COMPMASK_SDATA8_10 htobe64(((uint64_t)1) << 17) +#define IB_SR_COMPMASK_SDATA8_11 htobe64(((uint64_t)1) << 18) +#define IB_SR_COMPMASK_SDATA8_12 htobe64(((uint64_t)1) << 19) +#define IB_SR_COMPMASK_SDATA8_13 htobe64(((uint64_t)1) << 20) +#define IB_SR_COMPMASK_SDATA8_14 htobe64(((uint64_t)1) << 21) +#define IB_SR_COMPMASK_SDATA8_15 htobe64(((uint64_t)1) << 22) +#define IB_SR_COMPMASK_SDATA16_0 htobe64(((uint64_t)1) << 23) +#define IB_SR_COMPMASK_SDATA16_1 htobe64(((uint64_t)1) << 24) +#define IB_SR_COMPMASK_SDATA16_2 htobe64(((uint64_t)1) << 25) +#define IB_SR_COMPMASK_SDATA16_3 htobe64(((uint64_t)1) << 26) +#define IB_SR_COMPMASK_SDATA16_4 htobe64(((uint64_t)1) << 27) +#define IB_SR_COMPMASK_SDATA16_5 htobe64(((uint64_t)1) << 28) +#define IB_SR_COMPMASK_SDATA16_6 htobe64(((uint64_t)1) << 29) +#define IB_SR_COMPMASK_SDATA16_7 htobe64(((uint64_t)1) << 30) +#define IB_SR_COMPMASK_SDATA32_0 htobe64(((uint64_t)1) << 31) +#define IB_SR_COMPMASK_SDATA32_1 htobe64(((uint64_t)1) << 32) +#define IB_SR_COMPMASK_SDATA32_2 htobe64(((uint64_t)1) << 33) +#define IB_SR_COMPMASK_SDATA32_3 htobe64(((uint64_t)1) << 34) +#define IB_SR_COMPMASK_SDATA64_0 htobe64(((uint64_t)1) << 35) +#define IB_SR_COMPMASK_SDATA64_1 htobe64(((uint64_t)1) << 36) +#define IB_PIR_COMPMASK_LID htobe64(((uint64_t)1) << 0) +#define IB_PIR_COMPMASK_PORTNUM htobe64(((uint64_t)1) << 1) +#define IB_PIR_COMPMASK_OPTIONS htobe64(((uint64_t)1) << 2) +#define IB_PIR_COMPMASK_MKEY htobe64(((uint64_t)1) << 3) +#define IB_PIR_COMPMASK_GIDPRE htobe64(((uint64_t)1) << 4) +#define IB_PIR_COMPMASK_BASELID htobe64(((uint64_t)1) << 5) +#define IB_PIR_COMPMASK_SMLID htobe64(((uint64_t)1) << 6) +#define IB_PIR_COMPMASK_CAPMASK htobe64(((uint64_t)1) << 7) +#define IB_PIR_COMPMASK_DIAGCODE htobe64(((uint64_t)1) << 8) +#define IB_PIR_COMPMASK_MKEYLEASEPRD htobe64(((uint64_t)1) << 9) +#define IB_PIR_COMPMASK_LOCALPORTNUM htobe64(((uint64_t)1) << 10) +#define IB_PIR_COMPMASK_LINKWIDTHENABLED htobe64(((uint64_t)1) << 11) +#define IB_PIR_COMPMASK_LNKWIDTHSUPPORT htobe64(((uint64_t)1) << 12) +#define IB_PIR_COMPMASK_LNKWIDTHACTIVE htobe64(((uint64_t)1) << 13) +#define IB_PIR_COMPMASK_LNKSPEEDSUPPORT htobe64(((uint64_t)1) << 14) +#define IB_PIR_COMPMASK_PORTSTATE htobe64(((uint64_t)1) << 15) +#define IB_PIR_COMPMASK_PORTPHYSTATE htobe64(((uint64_t)1) << 16) +#define IB_PIR_COMPMASK_LINKDWNDFLTSTATE htobe64(((uint64_t)1) << 17) +#define IB_PIR_COMPMASK_MKEYPROTBITS htobe64(((uint64_t)1) << 18) +#define IB_PIR_COMPMASK_RESV2 htobe64(((uint64_t)1) << 19) +#define IB_PIR_COMPMASK_LMC htobe64(((uint64_t)1) << 20) +#define IB_PIR_COMPMASK_LINKSPEEDACTIVE htobe64(((uint64_t)1) << 21) +#define IB_PIR_COMPMASK_LINKSPEEDENABLE htobe64(((uint64_t)1) << 22) +#define IB_PIR_COMPMASK_NEIGHBORMTU htobe64(((uint64_t)1) << 23) +#define IB_PIR_COMPMASK_MASTERSMSL htobe64(((uint64_t)1) << 24) +#define IB_PIR_COMPMASK_VLCAP htobe64(((uint64_t)1) << 25) +#define IB_PIR_COMPMASK_INITTYPE htobe64(((uint64_t)1) << 26) +#define IB_PIR_COMPMASK_VLHIGHLIMIT htobe64(((uint64_t)1) << 27) +#define IB_PIR_COMPMASK_VLARBHIGHCAP htobe64(((uint64_t)1) << 28) +#define IB_PIR_COMPMASK_VLARBLOWCAP htobe64(((uint64_t)1) << 29) +#define IB_PIR_COMPMASK_INITTYPEREPLY htobe64(((uint64_t)1) << 30) +#define IB_PIR_COMPMASK_MTUCAP htobe64(((uint64_t)1) << 31) +#define IB_PIR_COMPMASK_VLSTALLCNT htobe64(((uint64_t)1) << 32) +#define IB_PIR_COMPMASK_HOQLIFE htobe64(((uint64_t)1) << 33) +#define IB_PIR_COMPMASK_OPVLS htobe64(((uint64_t)1) << 34) +#define IB_PIR_COMPMASK_PARENFIN htobe64(((uint64_t)1) << 35) +#define IB_PIR_COMPMASK_PARENFOUT htobe64(((uint64_t)1) << 36) +#define IB_PIR_COMPMASK_FILTERRAWIN htobe64(((uint64_t)1) << 37) +#define IB_PIR_COMPMASK_FILTERRAWOUT htobe64(((uint64_t)1) << 38) +#define IB_PIR_COMPMASK_MKEYVIO htobe64(((uint64_t)1) << 39) +#define IB_PIR_COMPMASK_PKEYVIO htobe64(((uint64_t)1) << 40) +#define IB_PIR_COMPMASK_QKEYVIO htobe64(((uint64_t)1) << 41) +#define IB_PIR_COMPMASK_GUIDCAP htobe64(((uint64_t)1) << 42) +#define IB_PIR_COMPMASK_CLIENTREREG htobe64(((uint64_t)1) << 43) +#define IB_PIR_COMPMASK_RESV3 htobe64(((uint64_t)1) << 44) +#define IB_PIR_COMPMASK_SUBNTO htobe64(((uint64_t)1) << 45) +#define IB_PIR_COMPMASK_RESV4 htobe64(((uint64_t)1) << 46) +#define IB_PIR_COMPMASK_RESPTIME htobe64(((uint64_t)1) << 47) +#define IB_PIR_COMPMASK_LOCALPHYERR htobe64(((uint64_t)1) << 48) +#define IB_PIR_COMPMASK_OVERRUNERR htobe64(((uint64_t)1) << 49) +#define IB_PIR_COMPMASK_MAXCREDHINT htobe64(((uint64_t)1) << 50) +#define IB_PIR_COMPMASK_RESV5 htobe64(((uint64_t)1) << 51) +#define IB_PIR_COMPMASK_LINKRTLAT htobe64(((uint64_t)1) << 52) +#define IB_PIR_COMPMASK_CAPMASK2 htobe64(((uint64_t)1) << 53) +#define IB_PIR_COMPMASK_LINKSPDEXTACT htobe64(((uint64_t)1) << 54) +#define IB_PIR_COMPMASK_LINKSPDEXTSUPP htobe64(((uint64_t)1) << 55) +#define IB_PIR_COMPMASK_RESV7 htobe64(((uint64_t)1) << 56) +#define IB_PIR_COMPMASK_LINKSPDEXTENAB htobe64(((uint64_t)1) << 57) +#define IB_MCR_COMPMASK_GID htobe64(((uint64_t)1) << 0) +#define IB_MCR_COMPMASK_MGID htobe64(((uint64_t)1) << 0) +#define IB_MCR_COMPMASK_PORT_GID htobe64(((uint64_t)1) << 1) +#define IB_MCR_COMPMASK_QKEY htobe64(((uint64_t)1) << 2) +#define IB_MCR_COMPMASK_MLID htobe64(((uint64_t)1) << 3) +#define IB_MCR_COMPMASK_MTU_SEL htobe64(((uint64_t)1) << 4) +#define IB_MCR_COMPMASK_MTU htobe64(((uint64_t)1) << 5) +#define IB_MCR_COMPMASK_TCLASS htobe64(((uint64_t)1) << 6) +#define IB_MCR_COMPMASK_PKEY htobe64(((uint64_t)1) << 7) +#define IB_MCR_COMPMASK_RATE_SEL htobe64(((uint64_t)1) << 8) +#define IB_MCR_COMPMASK_RATE htobe64(((uint64_t)1) << 9) +#define IB_MCR_COMPMASK_LIFE_SEL htobe64(((uint64_t)1) << 10) +#define IB_MCR_COMPMASK_LIFE htobe64(((uint64_t)1) << 11) +#define IB_MCR_COMPMASK_SL htobe64(((uint64_t)1) << 12) +#define IB_MCR_COMPMASK_FLOW htobe64(((uint64_t)1) << 13) +#define IB_MCR_COMPMASK_HOP htobe64(((uint64_t)1) << 14) +#define IB_MCR_COMPMASK_SCOPE htobe64(((uint64_t)1) << 15) +#define IB_MCR_COMPMASK_JOIN_STATE htobe64(((uint64_t)1) << 16) +#define IB_MCR_COMPMASK_PROXY htobe64(((uint64_t)1) << 17) +#define IB_GIR_COMPMASK_LID htobe64(((uint64_t)1) << 0) +#define IB_GIR_COMPMASK_BLOCKNUM htobe64(((uint64_t)1) << 1) +#define IB_GIR_COMPMASK_RESV1 htobe64(((uint64_t)1) << 2) +#define IB_GIR_COMPMASK_RESV2 htobe64(((uint64_t)1) << 3) +#define IB_GIR_COMPMASK_GID0 htobe64(((uint64_t)1) << 4) +#define IB_GIR_COMPMASK_GID1 htobe64(((uint64_t)1) << 5) +#define IB_GIR_COMPMASK_GID2 htobe64(((uint64_t)1) << 6) +#define IB_GIR_COMPMASK_GID3 htobe64(((uint64_t)1) << 7) +#define IB_GIR_COMPMASK_GID4 htobe64(((uint64_t)1) << 8) +#define IB_GIR_COMPMASK_GID5 htobe64(((uint64_t)1) << 9) +#define IB_GIR_COMPMASK_GID6 htobe64(((uint64_t)1) << 10) +#define IB_GIR_COMPMASK_GID7 htobe64(((uint64_t)1) << 11) +#define IB_MPR_COMPMASK_RAWTRAFFIC htobe64(((uint64_t)1) << 0) +#define IB_MPR_COMPMASK_RESV0 htobe64(((uint64_t)1) << 1) +#define IB_MPR_COMPMASK_FLOWLABEL htobe64(((uint64_t)1) << 2) +#define IB_MPR_COMPMASK_HOPLIMIT htobe64(((uint64_t)1) << 3) +#define IB_MPR_COMPMASK_TCLASS htobe64(((uint64_t)1) << 4) +#define IB_MPR_COMPMASK_REVERSIBLE htobe64(((uint64_t)1) << 5) +#define IB_MPR_COMPMASK_NUMBPATH htobe64(((uint64_t)1) << 6) +#define IB_MPR_COMPMASK_PKEY htobe64(((uint64_t)1) << 7) +#define IB_MPR_COMPMASK_QOS_CLASS htobe64(((uint64_t)1) << 8) +#define IB_MPR_COMPMASK_SL htobe64(((uint64_t)1) << 9) +#define IB_MPR_COMPMASK_MTUSELEC htobe64(((uint64_t)1) << 10) +#define IB_MPR_COMPMASK_MTU htobe64(((uint64_t)1) << 11) +#define IB_MPR_COMPMASK_RATESELEC htobe64(((uint64_t)1) << 12) +#define IB_MPR_COMPMASK_RATE htobe64(((uint64_t)1) << 13) +#define IB_MPR_COMPMASK_PKTLIFETIMESELEC htobe64(((uint64_t)1) << 14) +#define IB_MPR_COMPMASK_PKTLIFETIME htobe64(((uint64_t)1) << 15) +#define IB_MPR_COMPMASK_SERVICEID_MSB htobe64(((uint64_t)1) << 16) +#define IB_MPR_COMPMASK_INDEPSELEC htobe64(((uint64_t)1) << 17) +#define IB_MPR_COMPMASK_RESV3 htobe64(((uint64_t)1) << 18) +#define IB_MPR_COMPMASK_SGIDCOUNT htobe64(((uint64_t)1) << 19) +#define IB_MPR_COMPMASK_DGIDCOUNT htobe64(((uint64_t)1) << 20) +#define IB_MPR_COMPMASK_SERVICEID_LSB htobe64(((uint64_t)1) << 21) +#define IB_SMIR_COMPMASK_LID htobe64(((uint64_t)1) << 0) +#define IB_SMIR_COMPMASK_RESV0 htobe64(((uint64_t)1) << 1) +#define IB_SMIR_COMPMASK_GUID htobe64(((uint64_t)1) << 2) +#define IB_SMIR_COMPMASK_SMKEY htobe64(((uint64_t)1) << 3) +#define IB_SMIR_COMPMASK_ACTCOUNT htobe64(((uint64_t)1) << 4) +#define IB_SMIR_COMPMASK_PRIORITY htobe64(((uint64_t)1) << 5) +#define IB_SMIR_COMPMASK_SMSTATE htobe64(((uint64_t)1) << 6) +#define IB_IIR_COMPMASK_SUBSCRIBERGID htobe64(((uint64_t)1) << 0) +#define IB_IIR_COMPMASK_ENUM htobe64(((uint64_t)1) << 1) +#define IB_IIR_COMPMASK_RESV0 htobe64(((uint64_t)1) << 2) +#define IB_IIR_COMPMASK_GID htobe64(((uint64_t)1) << 3) +#define IB_IIR_COMPMASK_LIDRANGEBEGIN htobe64(((uint64_t)1) << 4) +#define IB_IIR_COMPMASK_LIDRANGEEND htobe64(((uint64_t)1) << 5) +#define IB_IIR_COMPMASK_RESV1 htobe64(((uint64_t)1) << 6) +#define IB_IIR_COMPMASK_ISGENERIC htobe64(((uint64_t)1) << 7) +#define IB_IIR_COMPMASK_SUBSCRIBE htobe64(((uint64_t)1) << 8) +#define IB_IIR_COMPMASK_TYPE htobe64(((uint64_t)1) << 9) +#define IB_IIR_COMPMASK_TRAPNUMB htobe64(((uint64_t)1) << 10) +#define IB_IIR_COMPMASK_DEVICEID htobe64(((uint64_t)1) << 10) +#define IB_IIR_COMPMASK_QPN htobe64(((uint64_t)1) << 11) +#define IB_IIR_COMPMASK_RESV2 htobe64(((uint64_t)1) << 12) +#define IB_IIR_COMPMASK_RESPTIME htobe64(((uint64_t)1) << 13) +#define IB_IIR_COMPMASK_RESV3 htobe64(((uint64_t)1) << 14) +#define IB_IIR_COMPMASK_PRODTYPE htobe64(((uint64_t)1) << 15) +#define IB_IIR_COMPMASK_VENDID htobe64(((uint64_t)1) << 15) +#define IB_CLASS_CAP_TRAP 0x0001 +#define IB_CLASS_CAP_GETSET 0x0002 +#define IB_CLASS_CAP_CAPMASK2 0x0004 +#define IB_CLASS_ENH_PORT0_CC_MASK 0x0100 +#define IB_CLASS_RESP_TIME_MASK 0x1F +#define IB_CLASS_CAPMASK2_SHIFT 5 +typedef struct { + uint8_t base_ver; + uint8_t class_ver; + __be16 cap_mask; + __be32 cap_mask2_resp_time; + ib_gid_t redir_gid; + __be32 redir_tc_sl_fl; + __be16 redir_lid; + __be16 redir_pkey; + __be32 redir_qp; + __be32 redir_qkey; + ib_gid_t trap_gid; + __be32 trap_tc_sl_fl; + __be16 trap_lid; + __be16 trap_pkey; + __be32 trap_hop_qp; + __be32 trap_qkey; +} __attribute__((packed)) ib_class_port_info_t; +#define IB_PM_ALL_PORT_SELECT htobe16(1 << 8) +#define IB_PM_EXT_WIDTH_SUPPORTED htobe16(1 << 9) +#define IB_PM_EXT_WIDTH_NOIETF_SUP htobe16(1 << 10) +#define IB_PM_SAMPLES_ONLY_SUP htobe16(1 << 11) +#define IB_PM_PC_XMIT_WAIT_SUP htobe16(1 << 12) +#define IS_PM_INH_LMTD_PKEY_MC_CONSTR_ERR htobe16(1 << 13) +#define IS_PM_RSFEC_COUNTERS_SUP htobe16(1 << 14) +#define IB_PM_IS_QP1_DROP_SUP htobe16(1 << 15) +#define IB_PM_IS_PM_KEY_SUPPORTED htobe32(1 << 0) +#define IB_PM_IS_ADDL_PORT_CTRS_EXT_SUP htobe32(1 << 1) +typedef struct { + __be64 guid; + __be64 sm_key; + __be32 act_count; + uint8_t pri_state; +} __attribute__((packed)) ib_sm_info_t; +typedef struct { + uint8_t base_ver; + uint8_t mgmt_class; + uint8_t class_ver; + uint8_t method; + __be16 status; + __be16 class_spec; + __be64 trans_id; + __be16 attr_id; + __be16 resv; + __be32 attr_mod; +} __attribute__((packed)) ib_mad_t; +typedef struct { + ib_mad_t common_hdr; + uint8_t rmpp_version; + uint8_t rmpp_type; + uint8_t rmpp_flags; + uint8_t rmpp_status; + __be32 seg_num; + __be32 paylen_newwin; +} __attribute__((packed)) ib_rmpp_mad_t; +#define IB_RMPP_TYPE_DATA 1 +#define IB_RMPP_TYPE_ACK 2 +#define IB_RMPP_TYPE_STOP 3 +#define IB_RMPP_TYPE_ABORT 4 +#define IB_RMPP_NO_RESP_TIME 0x1F +#define IB_RMPP_FLAG_ACTIVE 0x01 +#define IB_RMPP_FLAG_FIRST 0x02 +#define IB_RMPP_FLAG_LAST 0x04 +#define IB_RMPP_STATUS_SUCCESS 0 +#define IB_RMPP_STATUS_RESX 1 +#define IB_RMPP_STATUS_T2L 118 +#define IB_RMPP_STATUS_BAD_LEN 119 +#define IB_RMPP_STATUS_BAD_SEG 120 +#define IB_RMPP_STATUS_BADT 121 +#define IB_RMPP_STATUS_W2S 122 +#define IB_RMPP_STATUS_S2B 123 +#define IB_RMPP_STATUS_BAD_STATUS 124 +#define IB_RMPP_STATUS_UNV 125 +#define IB_RMPP_STATUS_TMR 126 +#define IB_RMPP_STATUS_UNSPEC 127 +#define IB_SMP_DIRECTION_HO 0x8000 +#define IB_SMP_DIRECTION htobe16(IB_SMP_DIRECTION_HO) +#define IB_SMP_STATUS_MASK_HO 0x7FFF +#define IB_SMP_STATUS_MASK htobe16(IB_SMP_STATUS_MASK_HO) +#define IB_SMP_DATA_SIZE 64 +typedef struct { + uint8_t base_ver; + uint8_t mgmt_class; + uint8_t class_ver; + uint8_t method; + __be16 status; + uint8_t hop_ptr; + uint8_t hop_count; + __be64 trans_id; + __be16 attr_id; + __be16 resv; + __be32 attr_mod; + __be64 m_key; + __be16 dr_slid; + __be16 dr_dlid; + uint32_t resv1[7]; + uint8_t data[IB_SMP_DATA_SIZE]; + uint8_t initial_path[IB_SUBNET_PATH_HOPS_MAX]; + uint8_t return_path[IB_SUBNET_PATH_HOPS_MAX]; +} __attribute__((packed)) ib_smp_t; +typedef struct { + uint8_t base_version; + uint8_t class_version; + uint8_t node_type; + uint8_t num_ports; + __be64 sys_guid; + __be64 node_guid; + __be64 port_guid; + __be16 partition_cap; + __be16 device_id; + __be32 revision; + __be32 port_num_vendor_id; +} __attribute__((packed)) ib_node_info_t; +#define IB_SA_DATA_SIZE 200 +typedef struct { + uint8_t base_ver; + uint8_t mgmt_class; + uint8_t class_ver; + uint8_t method; + __be16 status; + __be16 resv; + __be64 trans_id; + __be16 attr_id; + __be16 resv1; + __be32 attr_mod; + uint8_t rmpp_version; + uint8_t rmpp_type; + uint8_t rmpp_flags; + uint8_t rmpp_status; + __be32 seg_num; + __be32 paylen_newwin; + __be64 sm_key; + __be16 attr_offset; + __be16 resv3; + __be64 comp_mask; + uint8_t data[IB_SA_DATA_SIZE]; +} __attribute__((packed)) ib_sa_mad_t; +#define IB_NODE_INFO_PORT_NUM_MASK htobe32(0xFF000000) +#define IB_NODE_INFO_VEND_ID_MASK htobe32(0x00FFFFFF) +#define IB_NODE_DESCRIPTION_SIZE 64 +typedef struct { + // Node String is an array of UTF-8 characters + // that describe the node in text format + // Note that this string is NOT NULL TERMINATED! + uint8_t description[IB_NODE_DESCRIPTION_SIZE]; +} __attribute__((packed)) ib_node_desc_t; +typedef struct { + __be16 lid; + __be16 resv; + ib_node_info_t node_info; + ib_node_desc_t node_desc; + uint8_t pad[4]; +} __attribute__((packed)) ib_node_record_t; +typedef struct { + __be64 m_key; + __be64 subnet_prefix; + __be16 base_lid; + __be16 master_sm_base_lid; + __be32 capability_mask; + __be16 diag_code; + __be16 m_key_lease_period; + uint8_t local_port_num; + uint8_t link_width_enabled; + uint8_t link_width_supported; + uint8_t link_width_active; + uint8_t state_info1; /* LinkSpeedSupported and PortState */ + uint8_t state_info2; /* PortPhysState and LinkDownDefaultState */ + uint8_t mkey_lmc; /* M_KeyProtectBits and LMC */ + uint8_t link_speed; /* LinkSpeedEnabled and LinkSpeedActive */ + uint8_t mtu_smsl; + uint8_t vl_cap; /* VLCap and InitType */ + uint8_t vl_high_limit; + uint8_t vl_arb_high_cap; + uint8_t vl_arb_low_cap; + uint8_t mtu_cap; + uint8_t vl_stall_life; + uint8_t vl_enforce; + __be16 m_key_violations; + __be16 p_key_violations; + __be16 q_key_violations; + uint8_t guid_cap; + uint8_t subnet_timeout; /* cli_rereg(1b), mcast_pkey_trap_suppr(2b), timeout(5b) */ + uint8_t resp_time_value; /* reserv(3b), rtv(5b) */ + uint8_t error_threshold; /* local phy errors(4b), overrun errors(4b) */ + __be16 max_credit_hint; + __be32 link_rt_latency; /* reserv(8b), link round trip lat(24b) */ + __be16 capability_mask2; + uint8_t link_speed_ext; /* LinkSpeedExtActive and LinkSpeedExtSupported */ + uint8_t link_speed_ext_enabled; /* reserv(3b), LinkSpeedExtEnabled(5b) */ +} __attribute__((packed)) ib_port_info_t; +#define IB_PORT_STATE_MASK 0x0F +#define IB_PORT_LMC_MASK 0x07 +#define IB_PORT_LMC_MAX 0x07 +#define IB_PORT_MPB_MASK 0xC0 +#define IB_PORT_MPB_SHIFT 6 +#define IB_PORT_LINK_SPEED_SHIFT 4 +#define IB_PORT_LINK_SPEED_SUPPORTED_MASK 0xF0 +#define IB_PORT_LINK_SPEED_ACTIVE_MASK 0xF0 +#define IB_PORT_LINK_SPEED_ENABLED_MASK 0x0F +#define IB_PORT_PHYS_STATE_MASK 0xF0 +#define IB_PORT_PHYS_STATE_SHIFT 4 +#define IB_PORT_PHYS_STATE_NO_CHANGE 0 +#define IB_PORT_PHYS_STATE_SLEEP 1 +#define IB_PORT_PHYS_STATE_POLLING 2 +#define IB_PORT_PHYS_STATE_DISABLED 3 +#define IB_PORT_PHYS_STATE_PORTCONFTRAIN 4 +#define IB_PORT_PHYS_STATE_LINKUP 5 +#define IB_PORT_PHYS_STATE_LINKERRRECOVER 6 +#define IB_PORT_PHYS_STATE_PHYTEST 7 +#define IB_PORT_LNKDWNDFTSTATE_MASK 0x0F +#define IB_PORT_CAP_RESV0 htobe32(0x00000001) +#define IB_PORT_CAP_IS_SM htobe32(0x00000002) +#define IB_PORT_CAP_HAS_NOTICE htobe32(0x00000004) +#define IB_PORT_CAP_HAS_TRAP htobe32(0x00000008) +#define IB_PORT_CAP_HAS_IPD htobe32(0x00000010) +#define IB_PORT_CAP_HAS_AUTO_MIG htobe32(0x00000020) +#define IB_PORT_CAP_HAS_SL_MAP htobe32(0x00000040) +#define IB_PORT_CAP_HAS_NV_MKEY htobe32(0x00000080) +#define IB_PORT_CAP_HAS_NV_PKEY htobe32(0x00000100) +#define IB_PORT_CAP_HAS_LED_INFO htobe32(0x00000200) +#define IB_PORT_CAP_SM_DISAB htobe32(0x00000400) +#define IB_PORT_CAP_HAS_SYS_IMG_GUID htobe32(0x00000800) +#define IB_PORT_CAP_HAS_PKEY_SW_EXT_PORT_TRAP htobe32(0x00001000) +#define IB_PORT_CAP_HAS_CABLE_INFO htobe32(0x00002000) +#define IB_PORT_CAP_HAS_EXT_SPEEDS htobe32(0x00004000) +#define IB_PORT_CAP_HAS_CAP_MASK2 htobe32(0x00008000) +#define IB_PORT_CAP_HAS_COM_MGT htobe32(0x00010000) +#define IB_PORT_CAP_HAS_SNMP htobe32(0x00020000) +#define IB_PORT_CAP_REINIT htobe32(0x00040000) +#define IB_PORT_CAP_HAS_DEV_MGT htobe32(0x00080000) +#define IB_PORT_CAP_HAS_VEND_CLS htobe32(0x00100000) +#define IB_PORT_CAP_HAS_DR_NTC htobe32(0x00200000) +#define IB_PORT_CAP_HAS_CAP_NTC htobe32(0x00400000) +#define IB_PORT_CAP_HAS_BM htobe32(0x00800000) +#define IB_PORT_CAP_HAS_LINK_RT_LATENCY htobe32(0x01000000) +#define IB_PORT_CAP_HAS_CLIENT_REREG htobe32(0x02000000) +#define IB_PORT_CAP_HAS_OTHER_LOCAL_CHANGES_NTC htobe32(0x04000000) +#define IB_PORT_CAP_HAS_LINK_SPEED_WIDTH_PAIRS_TBL htobe32(0x08000000) +#define IB_PORT_CAP_HAS_VEND_MADS htobe32(0x10000000) +#define IB_PORT_CAP_HAS_MCAST_PKEY_TRAP_SUPPRESS htobe32(0x20000000) +#define IB_PORT_CAP_HAS_MCAST_FDB_TOP htobe32(0x40000000) +#define IB_PORT_CAP_HAS_HIER_INFO htobe32(0x80000000) +#define IB_PORT_CAP2_IS_SET_NODE_DESC_SUPPORTED htobe16(0x0001) +#define IB_PORT_CAP2_IS_PORT_INFO_EXT_SUPPORTED htobe16(0x0002) +#define IB_PORT_CAP2_IS_VIRT_SUPPORTED htobe16(0x0004) +#define IB_PORT_CAP2_IS_SWITCH_PORT_STATE_TBL_SUPP htobe16(0x0008) +#define IB_PORT_CAP2_IS_LINK_WIDTH_2X_SUPPORTED htobe16(0x0010) +#define IB_PORT_CAP2_IS_LINK_SPEED_HDR_SUPPORTED htobe16(0x0020) +typedef struct { + __be32 cap_mask; + __be16 fec_mode_active; + __be16 fdr_fec_mode_sup; + __be16 fdr_fec_mode_enable; + __be16 edr_fec_mode_sup; + __be16 edr_fec_mode_enable; + __be16 hdr_fec_mode_sup; + __be16 hdr_fec_mode_enable; + uint8_t reserved[46]; +} __attribute__((packed)) ib_port_info_ext_t; +#define IB_PORT_EXT_NO_FEC_MODE_ACTIVE 0 +#define IB_PORT_EXT_FIRE_CODE_FEC_MODE_ACTIVE htobe16(0x0001) +#define IB_PORT_EXT_RS_FEC_MODE_ACTIVE htobe16(0x0002) +#define IB_PORT_EXT_LOW_LATENCY_RS_FEC_MODE_ACTIVE htobe16(0x0003) +#define IB_PORT_EXT_CAP_IS_FEC_MODE_SUPPORTED htobe32(0x00000001) +#define IB_LINK_WIDTH_ACTIVE_1X 1 +#define IB_LINK_WIDTH_ACTIVE_4X 2 +#define IB_LINK_WIDTH_ACTIVE_8X 4 +#define IB_LINK_WIDTH_ACTIVE_12X 8 +#define IB_LINK_WIDTH_ACTIVE_2X 16 +#define IB_LINK_WIDTH_SET_LWS 255 +#define IB_LINK_SPEED_ACTIVE_EXTENDED 0 +#define IB_LINK_SPEED_ACTIVE_2_5 1 +#define IB_LINK_SPEED_ACTIVE_5 2 +#define IB_LINK_SPEED_ACTIVE_10 4 +#define IB_LINK_SPEED_SET_LSS 15 +#define IB_LINK_SPEED_EXT_ACTIVE_NONE 0 +#define IB_LINK_SPEED_EXT_ACTIVE_14 1 +#define IB_LINK_SPEED_EXT_ACTIVE_25 2 +#define IB_LINK_SPEED_EXT_ACTIVE_50 4 +#define IB_LINK_SPEED_EXT_DISABLE 30 +#define IB_LINK_SPEED_EXT_SET_LSES 31 +#define IB_PATH_RECORD_RATE_2_5_GBS 2 +#define IB_PATH_RECORD_RATE_10_GBS 3 +#define IB_PATH_RECORD_RATE_30_GBS 4 +#define IB_PATH_RECORD_RATE_5_GBS 5 +#define IB_PATH_RECORD_RATE_20_GBS 6 +#define IB_PATH_RECORD_RATE_40_GBS 7 +#define IB_PATH_RECORD_RATE_60_GBS 8 +#define IB_PATH_RECORD_RATE_80_GBS 9 +#define IB_PATH_RECORD_RATE_120_GBS 10 +#define IB_PATH_RECORD_RATE_14_GBS 11 +#define IB_PATH_RECORD_RATE_56_GBS 12 +#define IB_PATH_RECORD_RATE_112_GBS 13 +#define IB_PATH_RECORD_RATE_168_GBS 14 +#define IB_PATH_RECORD_RATE_25_GBS 15 +#define IB_PATH_RECORD_RATE_100_GBS 16 +#define IB_PATH_RECORD_RATE_200_GBS 17 +#define IB_PATH_RECORD_RATE_300_GBS 18 +#define IB_PATH_RECORD_RATE_28_GBS 19 +#define IB_PATH_RECORD_RATE_50_GBS 20 +#define IB_PATH_RECORD_RATE_400_GBS 21 +#define IB_PATH_RECORD_RATE_600_GBS 22 +#define FDR10 0x01 +typedef struct { + uint8_t resvd1[3]; + uint8_t state_change_enable; + uint8_t resvd2[3]; + uint8_t link_speed_supported; + uint8_t resvd3[3]; + uint8_t link_speed_enabled; + uint8_t resvd4[3]; + uint8_t link_speed_active; + uint8_t resvd5[48]; +} __attribute__((packed)) ib_mlnx_ext_port_info_t; +typedef struct { + __be64 service_id; + ib_gid_t service_gid; + __be16 service_pkey; + __be16 resv; + __be32 service_lease; + uint8_t service_key[16]; + uint8_t service_name[64]; + uint8_t service_data8[16]; + __be16 service_data16[8]; + __be32 service_data32[4]; + __be64 service_data64[2]; +} __attribute__((packed)) ib_service_record_t; +typedef struct { + __be16 lid; + uint8_t port_num; + uint8_t options; + ib_port_info_t port_info; + uint8_t pad[4]; +} __attribute__((packed)) ib_portinfo_record_t; +typedef struct { + __be16 lid; + uint8_t port_num; + uint8_t options; + ib_port_info_ext_t port_info_ext; +} __attribute__((packed)) ib_portinfoext_record_t; +typedef struct { + __be16 from_lid; + uint8_t from_port_num; + uint8_t to_port_num; + __be16 to_lid; + uint8_t pad[2]; +} __attribute__((packed)) ib_link_record_t; +typedef struct { + __be16 lid; + uint16_t resv0; + ib_sm_info_t sm_info; + uint8_t pad[7]; +} __attribute__((packed)) ib_sminfo_record_t; +typedef struct { + __be16 lid; + __be16 block_num; + uint32_t resv0; + uint8_t lft[64]; +} __attribute__((packed)) ib_lft_record_t; +typedef struct { + __be16 lid; + __be16 position_block_num; + uint32_t resv0; + __be16 mft[IB_MCAST_BLOCK_SIZE]; +} __attribute__((packed)) ib_mft_record_t; +typedef struct { + __be16 lin_cap; + __be16 rand_cap; + __be16 mcast_cap; + __be16 lin_top; + uint8_t def_port; + uint8_t def_mcast_pri_port; + uint8_t def_mcast_not_port; + uint8_t life_state; + __be16 lids_per_port; + __be16 enforce_cap; + uint8_t flags; + uint8_t resvd; + __be16 mcast_top; +} __attribute__((packed)) ib_switch_info_t; +typedef struct { + __be16 lid; + uint16_t resv0; + ib_switch_info_t switch_info; +} __attribute__((packed)) ib_switch_info_record_t; +#define IB_SWITCH_PSC 0x04 +#define GUID_TABLE_MAX_ENTRIES 8 +typedef struct { + __be64 guid[GUID_TABLE_MAX_ENTRIES]; +} __attribute__((packed)) ib_guid_info_t; +typedef struct { + __be16 lid; + uint8_t block_num; + uint8_t resv; + uint32_t reserved; + ib_guid_info_t guid_info; +} __attribute__((packed)) ib_guidinfo_record_t; +#define IB_MULTIPATH_MAX_GIDS 11 +typedef struct { + __be32 hop_flow_raw; + uint8_t tclass; + uint8_t num_path; + __be16 pkey; + __be16 qos_class_sl; + uint8_t mtu; + uint8_t rate; + uint8_t pkt_life; + uint8_t service_id_8msb; + uint8_t independence; /* formerly resv2 */ + uint8_t sgid_count; + uint8_t dgid_count; + uint8_t service_id_56lsb[7]; + ib_gid_t gids[IB_MULTIPATH_MAX_GIDS]; +} __attribute__((packed)) ib_multipath_rec_t; +#define IB_NUM_PKEY_ELEMENTS_IN_BLOCK 32 +typedef struct { + __be16 pkey_entry[IB_NUM_PKEY_ELEMENTS_IN_BLOCK]; +} ib_pkey_table_t; +typedef struct { + __be16 lid; // for CA: lid of port, for switch lid of port 0 + __be16 block_num; + uint8_t port_num; // for switch: port number, for CA: reserved + uint8_t reserved1; + uint16_t reserved2; + ib_pkey_table_t pkey_tbl; +} ib_pkey_table_record_t; +#define IB_DROP_VL 15 +#define IB_MAX_NUM_VLS 16 +typedef struct { + uint8_t raw_vl_by_sl[IB_MAX_NUM_VLS / 2]; +} __attribute__((packed)) ib_slvl_table_t; +typedef struct { + __be16 lid; // for CA: lid of port, for switch lid of port 0 + uint8_t in_port_num; // reserved for CAs + uint8_t out_port_num; // reserved for CAs + uint32_t resv; + ib_slvl_table_t slvl_tbl; +} __attribute__((packed)) ib_slvl_table_record_t; +typedef struct { + uint8_t vl; + uint8_t weight; +} __attribute__((packed)) ib_vl_arb_element_t; +#define IB_NUM_VL_ARB_ELEMENTS_IN_BLOCK 32 +typedef struct { + ib_vl_arb_element_t vl_entry[IB_NUM_VL_ARB_ELEMENTS_IN_BLOCK]; +} __attribute__((packed)) ib_vl_arb_table_t; +typedef struct { + __be16 lid; // for CA: lid of port, for switch lid of port 0 + uint8_t port_num; + uint8_t block_num; + uint32_t reserved; + ib_vl_arb_table_t vl_arb_tbl; +} __attribute__((packed)) ib_vl_arb_table_record_t; +typedef struct { + __be32 ver_class_flow; + __be16 resv1; + uint8_t resv2; + uint8_t hop_limit; + ib_gid_t src_gid; + ib_gid_t dest_gid; +} __attribute__((packed)) ib_grh_t; +typedef struct { + ib_gid_t mgid; + ib_gid_t port_gid; + __be32 qkey; + __be16 mlid; + uint8_t mtu; + uint8_t tclass; + __be16 pkey; + uint8_t rate; + uint8_t pkt_life; + __be32 sl_flow_hop; + uint8_t scope_state; + uint8_t proxy_join : 1; + uint8_t reserved[2]; + uint8_t pad[4]; +} __attribute__((packed)) ib_member_rec_t; +#define IB_MC_REC_STATE_FULL_MEMBER 0x01 +#define IB_MC_REC_STATE_NON_MEMBER 0x02 +#define IB_MC_REC_STATE_SEND_ONLY_NON_MEMBER 0x04 +#define IB_MC_REC_STATE_SEND_ONLY_FULL_MEMBER 0x08 +#define IB_NOTICE_TYPE_FATAL 0x00 +#define IB_NOTICE_TYPE_URGENT 0x01 +#define IB_NOTICE_TYPE_SECURITY 0x02 +#define IB_NOTICE_TYPE_SUBN_MGMT 0x03 +#define IB_NOTICE_TYPE_INFO 0x04 +#define IB_NOTICE_TYPE_EMPTY 0x7F +#define SM_GID_IN_SERVICE_TRAP 64 +#define SM_GID_OUT_OF_SERVICE_TRAP 65 +#define SM_MGID_CREATED_TRAP 66 +#define SM_MGID_DESTROYED_TRAP 67 +#define SM_UNPATH_TRAP 68 +#define SM_REPATH_TRAP 69 +#define SM_LINK_STATE_CHANGED_TRAP 128 +#define SM_LINK_INTEGRITY_THRESHOLD_TRAP 129 +#define SM_BUFFER_OVERRUN_THRESHOLD_TRAP 130 +#define SM_WATCHDOG_TIMER_EXPIRED_TRAP 131 +#define SM_LOCAL_CHANGES_TRAP 144 +#define SM_SYS_IMG_GUID_CHANGED_TRAP 145 +#define SM_BAD_MKEY_TRAP 256 +#define SM_BAD_PKEY_TRAP 257 +#define SM_BAD_QKEY_TRAP 258 +#define SM_BAD_SWITCH_PKEY_TRAP 259 +typedef struct { + uint8_t generic_type; // 1 1 + union _notice_g_or_v { + struct _notice_generic // 5 6 + { + uint8_t prod_type_msb; + __be16 prod_type_lsb; + __be16 trap_num; + } __attribute__((packed)) generic; + struct _notice_vend { + uint8_t vend_id_msb; + __be16 vend_id_lsb; + __be16 dev_id; + } __attribute__((packed)) vend; + } g_or_v; + __be16 issuer_lid; // 2 8 + __be16 toggle_count; // 2 10 + union _data_details // 54 64 + { + struct _raw_data { + uint8_t details[54]; + } __attribute__((packed)) raw_data; + struct _ntc_64_67 { + uint8_t res[6]; + ib_gid_t gid; // the Node or Multicast Group that came in/out + } __attribute__((packed)) ntc_64_67; + struct _ntc_128 { + __be16 sw_lid; // the sw lid of which link state changed + } __attribute__((packed)) ntc_128; + struct _ntc_129_131 { + __be16 pad; + __be16 lid; // lid and port number of the violation + uint8_t port_num; + } __attribute__((packed)) ntc_129_131; + struct _ntc_144 { + __be16 pad1; + __be16 lid; // lid where change occured + uint8_t pad2; // reserved + uint8_t local_changes; // 7b reserved 1b local changes + __be32 new_cap_mask; // new capability mask + __be16 change_flgs; // 10b reserved 6b change flags + __be16 cap_mask2; + } __attribute__((packed)) ntc_144; + struct _ntc_145 { + __be16 pad1; + __be16 lid; // lid where sys guid changed + __be16 pad2; + __be64 new_sys_guid; // new system image guid + } __attribute__((packed)) ntc_145; + struct _ntc_256 { // total: 54 + __be16 pad1; // 2 + __be16 lid; // 2 + __be16 dr_slid; // 2 + uint8_t method; // 1 + uint8_t pad2; // 1 + __be16 attr_id; // 2 + __be32 attr_mod; // 4 + __be64 mkey; // 8 + uint8_t pad3; // 1 + uint8_t dr_trunc_hop; // 1 + uint8_t dr_rtn_path[30]; // 30 + } __attribute__((packed)) ntc_256; + struct _ntc_257_258 // violation of p/q_key // 49 + { + __be16 pad1; // 2 + __be16 lid1; // 2 + __be16 lid2; // 2 + __be32 key; // 4 + __be32 qp1; // 4b sl, 4b pad, 24b qp1 + __be32 qp2; // 8b pad, 24b qp2 + ib_gid_t gid1; // 16 + ib_gid_t gid2; // 16 + } __attribute__((packed)) ntc_257_258; + struct _ntc_259 // pkey violation from switch 51 + { + __be16 data_valid; // 2 + __be16 lid1; // 2 + __be16 lid2; // 2 + __be16 pkey; // 2 + __be32 sl_qp1; // 4b sl, 4b pad, 24b qp1 + __be32 qp2; // 8b pad, 24b qp2 + ib_gid_t gid1; // 16 + ib_gid_t gid2; // 16 + __be16 sw_lid; // 2 + uint8_t port_no; // 1 + } __attribute__((packed)) ntc_259; + struct _ntc_bkey_259 // bkey violation + { + __be16 lidaddr; + uint8_t method; + uint8_t reserved; + __be16 attribute_id; + __be32 attribute_modifier; + __be32 qp; // qp is low 24 bits + __be64 bkey; + ib_gid_t gid; + } __attribute__((packed)) ntc_bkey_259; + struct _ntc_cckey_0 // CC key violation + { + __be16 slid; // source LID from offending packet LRH + uint8_t method; // method, from common MAD header + uint8_t resv0; + __be16 attribute_id; // Attribute ID, from common MAD header + __be16 resv1; + __be32 attribute_modifier; // Attribute Modif, from common MAD header + __be32 qp; // 8b pad, 24b dest QP from BTH + __be64 cc_key; // CC key of the offending packet + ib_gid_t source_gid; // GID from GRH of the offending packet + uint8_t padding[14]; // Padding - ignored on read + } __attribute__((packed)) ntc_cckey_0; + } data_details; + ib_gid_t issuer_gid; // 16 80 +} __attribute__((packed)) ib_mad_notice_attr_t; +#define TRAP_259_MASK_SL htobe32(0xF0000000) +#define TRAP_259_MASK_QP htobe32(0x00FFFFFF) +#define TRAP_144_MASK_OTHER_LOCAL_CHANGES 0x01 +#define TRAP_144_MASK_CAPABILITY_MASK2_CHANGE htobe16(0x0020) +#define TRAP_144_MASK_HIERARCHY_INFO_CHANGE htobe16(0x0010) +#define TRAP_144_MASK_SM_PRIORITY_CHANGE htobe16(0x0008) +#define TRAP_144_MASK_LINK_SPEED_ENABLE_CHANGE htobe16(0x0004) +#define TRAP_144_MASK_LINK_WIDTH_ENABLE_CHANGE htobe16(0x0002) +#define TRAP_144_MASK_NODE_DESCRIPTION_CHANGE htobe16(0x0001) +typedef struct { + ib_gid_t gid; + __be16 lid_range_begin; + __be16 lid_range_end; + __be16 reserved1; + uint8_t is_generic; + uint8_t subscribe; + __be16 trap_type; + union _inform_g_or_v { + struct _inform_generic { + __be16 trap_num; + __be32 qpn_resp_time_val; + uint8_t reserved2; + uint8_t node_type_msb; + __be16 node_type_lsb; + } __attribute__((packed)) generic; + struct _inform_vend { + __be16 dev_id; + __be32 qpn_resp_time_val; + uint8_t reserved2; + uint8_t vendor_id_msb; + __be16 vendor_id_lsb; + } __attribute__((packed)) vend; + } __attribute__((packed)) g_or_v; +} __attribute__((packed)) ib_inform_info_t; +typedef struct { + ib_gid_t subscriber_gid; + __be16 subscriber_enum; + uint8_t reserved[6]; + ib_inform_info_t inform_info; + uint8_t pad[4]; +} __attribute__((packed)) ib_inform_info_record_t; +typedef struct { + ib_mad_t header; + uint8_t resv[40]; +#define IB_PM_DATA_SIZE 192 + uint8_t data[IB_PM_DATA_SIZE]; +} __attribute__((packed)) ib_perfmgt_mad_t; +typedef struct { + uint8_t reserved; + uint8_t port_select; + __be16 counter_select; + __be16 symbol_err_cnt; + uint8_t link_err_recover; + uint8_t link_downed; + __be16 rcv_err; + __be16 rcv_rem_phys_err; + __be16 rcv_switch_relay_err; + __be16 xmit_discards; + uint8_t xmit_constraint_err; + uint8_t rcv_constraint_err; + uint8_t counter_select2; + uint8_t link_int_buffer_overrun; + __be16 qp1_dropped; + __be16 vl15_dropped; + __be32 xmit_data; + __be32 rcv_data; + __be32 xmit_pkts; + __be32 rcv_pkts; + __be32 xmit_wait; +} __attribute__((packed)) ib_port_counters_t; +typedef struct { + uint8_t reserved; + uint8_t port_select; + __be16 counter_select; + __be32 counter_select2; + __be64 xmit_data; + __be64 rcv_data; + __be64 xmit_pkts; + __be64 rcv_pkts; + __be64 unicast_xmit_pkts; + __be64 unicast_rcv_pkts; + __be64 multicast_xmit_pkts; + __be64 multicast_rcv_pkts; + __be64 symbol_err_cnt; + __be64 link_err_recover; + __be64 link_downed; + __be64 rcv_err; + __be64 rcv_rem_phys_err; + __be64 rcv_switch_relay_err; + __be64 xmit_discards; + __be64 xmit_constraint_err; + __be64 rcv_constraint_err; + __be64 link_integrity_err; + __be64 buffer_overrun; + __be64 vl15_dropped; + __be64 xmit_wait; + __be64 qp1_dropped; +} __attribute__((packed)) ib_port_counters_ext_t; +typedef struct { + uint8_t op_code; + uint8_t port_select; + uint8_t tick; + uint8_t counter_width; /* 5 bits res : 3bits counter_width */ + __be32 counter_mask; /* 2 bits res : 3 bits counter_mask : 27 bits counter_masks_1to9 */ + __be16 counter_mask_10to14; /* 1 bits res : 15 bits counter_masks_10to14 */ + uint8_t sample_mech; + uint8_t sample_status; /* 6 bits res : 2 bits sample_status */ + __be64 option_mask; + __be64 vendor_mask; + __be32 sample_start; + __be32 sample_interval; + __be16 tag; + __be16 counter_select0; + __be16 counter_select1; + __be16 counter_select2; + __be16 counter_select3; + __be16 counter_select4; + __be16 counter_select5; + __be16 counter_select6; + __be16 counter_select7; + __be16 counter_select8; + __be16 counter_select9; + __be16 counter_select10; + __be16 counter_select11; + __be16 counter_select12; + __be16 counter_select13; + __be16 counter_select14; +} __attribute__((packed)) ib_port_samples_control_t; +#define IB_CS_PORT_XMIT_DATA htobe16(0x0001) +#define IB_CS_PORT_RCV_DATA htobe16(0x0002) +#define IB_CS_PORT_XMIT_PKTS htobe16(0x0003) +#define IB_CS_PORT_RCV_PKTS htobe16(0x0004) +#define IB_CS_PORT_XMIT_WAIT htobe16(0x0005) +typedef struct { + __be16 tag; + __be16 sample_status; /* 14 bits res : 2 bits sample_status */ + __be32 counter0; + __be32 counter1; + __be32 counter2; + __be32 counter3; + __be32 counter4; + __be32 counter5; + __be32 counter6; + __be32 counter7; + __be32 counter8; + __be32 counter9; + __be32 counter10; + __be32 counter11; + __be32 counter12; + __be32 counter13; + __be32 counter14; +} __attribute__((packed)) ib_port_samples_result_t; +typedef struct { + uint8_t reserved; + uint8_t port_select; + __be16 counter_select; + __be32 port_xmit_data_sl[16]; + uint8_t resv[124]; +} __attribute__((packed)) ib_port_xmit_data_sl_t; +typedef struct { + uint8_t reserved; + uint8_t port_select; + __be16 counter_select; + __be32 port_rcv_data_sl[16]; + uint8_t resv[124]; +} __attribute__((packed)) ib_port_rcv_data_sl_t; +typedef struct { + ib_mad_t header; + uint8_t resv[40]; +#define IB_DM_DATA_SIZE 192 + uint8_t data[IB_DM_DATA_SIZE]; +} __attribute__((packed)) ib_dm_mad_t; +typedef struct { + __be16 change_id; + uint8_t max_controllers; + uint8_t diag_rom; +#define IB_DM_CTRL_LIST_SIZE 128 + uint8_t controller_list[IB_DM_CTRL_LIST_SIZE]; +#define IOC_NOT_INSTALLED 0x0 +#define IOC_INSTALLED 0x1 +// Reserved values 0x02-0xE +#define SLOT_DOES_NOT_EXIST 0xF +} __attribute__((packed)) ib_iou_info_t; +typedef struct { + __be64 ioc_guid; + __be32 vend_id; + __be32 dev_id; + __be16 dev_ver; + __be16 resv2; + __be32 subsys_vend_id; + __be32 subsys_id; + __be16 io_class; + __be16 io_subclass; + __be16 protocol; + __be16 protocol_ver; + __be32 resv3; + __be16 send_msg_depth; + uint8_t resv4; + uint8_t rdma_read_depth; + __be32 send_msg_size; + __be32 rdma_size; + uint8_t ctrl_ops_cap; +#define CTRL_OPS_CAP_ST 0x01 +#define CTRL_OPS_CAP_SF 0x02 +#define CTRL_OPS_CAP_RT 0x04 +#define CTRL_OPS_CAP_RF 0x08 +#define CTRL_OPS_CAP_WT 0x10 +#define CTRL_OPS_CAP_WF 0x20 +#define CTRL_OPS_CAP_AT 0x40 +#define CTRL_OPS_CAP_AF 0x80 + uint8_t resv5; + uint8_t num_svc_entries; +#define MAX_NUM_SVC_ENTRIES 0xff + uint8_t resv6[9]; +#define CTRL_ID_STRING_LEN 64 + char id_string[CTRL_ID_STRING_LEN]; +} __attribute__((packed)) ib_ioc_profile_t; +typedef struct { +#define MAX_SVC_ENTRY_NAME_LEN 40 + char name[MAX_SVC_ENTRY_NAME_LEN]; + __be64 id; +} __attribute__((packed)) ib_svc_entry_t; +typedef struct { +#define SVC_ENTRY_COUNT 4 + ib_svc_entry_t service_entry[SVC_ENTRY_COUNT]; +} __attribute__((packed)) ib_svc_entries_t; +typedef struct { + __be64 module_guid; + __be64 iou_guid; + ib_ioc_profile_t ioc_profile; + __be64 access_key; + uint16_t initiators_conf; + uint8_t resv[38]; +} __attribute__((packed)) ib_ioc_info_t; +typedef struct { + bool cm; + bool snmp; + bool dev_mgmt; + bool vend; + bool sm; + bool sm_disable; + bool qkey_ctr; + bool pkey_ctr; + bool notice; + bool trap; + bool apm; + bool slmap; + bool pkey_nvram; + bool mkey_nvram; + bool sysguid; + bool dr_notice; + bool boot_mgmt; + bool capm_notice; + bool reinit; + bool ledinfo; + bool port_active; +} ib_port_cap_t; +#define IB_INIT_TYPE_NO_LOAD 0x01 +#define IB_INIT_TYPE_PRESERVE_CONTENT 0x02 +#define IB_INIT_TYPE_PRESERVE_PRESENCE 0x04 +#define IB_INIT_TYPE_DO_NOT_RESUSCITATE 0x08 +typedef struct { + uint8_t port_num; + uint8_t sl; + __be16 dlid; + bool grh_valid; + ib_grh_t grh; + uint8_t static_rate; + uint8_t path_bits; + struct _av_conn { + uint8_t path_mtu; + uint8_t local_ack_timeout; + uint8_t seq_err_retry_cnt; + uint8_t rnr_retry_cnt; + } conn; +} ib_av_attr_t; +#define IB_AC_RDMA_READ 0x00000001 +#define IB_AC_RDMA_WRITE 0x00000002 +#define IB_AC_ATOMIC 0x00000004 +#define IB_AC_LOCAL_WRITE 0x00000008 +#define IB_AC_MW_BIND 0x00000010 +#define IB_QPS_RESET 0x00000001 +#define IB_QPS_INIT 0x00000002 +#define IB_QPS_RTR 0x00000004 +#define IB_QPS_RTS 0x00000008 +#define IB_QPS_SQD 0x00000010 +#define IB_QPS_SQD_DRAINING 0x00000030 +#define IB_QPS_SQD_DRAINED 0x00000050 +#define IB_QPS_SQERR 0x00000080 +#define IB_QPS_ERROR 0x00000100 +#define IB_QPS_TIME_WAIT 0xDEAD0000 +#define IB_MOD_QP_ALTERNATE_AV 0x00000001 +#define IB_MOD_QP_PKEY 0x00000002 +#define IB_MOD_QP_APM_STATE 0x00000004 +#define IB_MOD_QP_PRIMARY_AV 0x00000008 +#define IB_MOD_QP_RNR_NAK_TIMEOUT 0x00000010 +#define IB_MOD_QP_RESP_RES 0x00000020 +#define IB_MOD_QP_INIT_DEPTH 0x00000040 +#define IB_MOD_QP_PRIMARY_PORT 0x00000080 +#define IB_MOD_QP_ACCESS_CTRL 0x00000100 +#define IB_MOD_QP_QKEY 0x00000200 +#define IB_MOD_QP_SQ_DEPTH 0x00000400 +#define IB_MOD_QP_RQ_DEPTH 0x00000800 +#define IB_MOD_QP_CURRENT_STATE 0x00001000 +#define IB_MOD_QP_RETRY_CNT 0x00002000 +#define IB_MOD_QP_LOCAL_ACK_TIMEOUT 0x00004000 +#define IB_MOD_QP_RNR_RETRY_CNT 0x00008000 +#define IB_MOD_EEC_ALTERNATE_AV 0x00000001 +#define IB_MOD_EEC_PKEY 0x00000002 +#define IB_MOD_EEC_APM_STATE 0x00000004 +#define IB_MOD_EEC_PRIMARY_AV 0x00000008 +#define IB_MOD_EEC_RNR 0x00000010 +#define IB_MOD_EEC_RESP_RES 0x00000020 +#define IB_MOD_EEC_OUTSTANDING 0x00000040 +#define IB_MOD_EEC_PRIMARY_PORT 0x00000080 +#define IB_SEND_OPT_IMMEDIATE 0x00000001 +#define IB_SEND_OPT_FENCE 0x00000002 +#define IB_SEND_OPT_SIGNALED 0x00000004 +#define IB_SEND_OPT_SOLICITED 0x00000008 +#define IB_SEND_OPT_INLINE 0x00000010 +#define IB_SEND_OPT_LOCAL 0x00000020 +#define IB_SEND_OPT_VEND_MASK 0xFFFF0000 +#define IB_RECV_OPT_IMMEDIATE 0x00000001 +#define IB_RECV_OPT_FORWARD 0x00000002 +#define IB_RECV_OPT_GRH_VALID 0x00000004 +#define IB_RECV_OPT_VEND_MASK 0xFFFF0000 +#define IB_CA_MOD_IS_CM_SUPPORTED 0x00000001 +#define IB_CA_MOD_IS_SNMP_SUPPORTED 0x00000002 +#define IB_CA_MOD_IS_DEV_MGMT_SUPPORTED 0x00000004 +#define IB_CA_MOD_IS_VEND_SUPPORTED 0x00000008 +#define IB_CA_MOD_IS_SM 0x00000010 +#define IB_CA_MOD_IS_SM_DISABLED 0x00000020 +#define IB_CA_MOD_QKEY_CTR 0x00000040 +#define IB_CA_MOD_PKEY_CTR 0x00000080 +#define IB_CA_MOD_IS_NOTICE_SUPPORTED 0x00000100 +#define IB_CA_MOD_IS_TRAP_SUPPORTED 0x00000200 +#define IB_CA_MOD_IS_APM_SUPPORTED 0x00000400 +#define IB_CA_MOD_IS_SLMAP_SUPPORTED 0x00000800 +#define IB_CA_MOD_IS_PKEY_NVRAM_SUPPORTED 0x00001000 +#define IB_CA_MOD_IS_MKEY_NVRAM_SUPPORTED 0x00002000 +#define IB_CA_MOD_IS_SYSGUID_SUPPORTED 0x00004000 +#define IB_CA_MOD_IS_DR_NOTICE_SUPPORTED 0x00008000 +#define IB_CA_MOD_IS_BOOT_MGMT_SUPPORTED 0x00010000 +#define IB_CA_MOD_IS_CAPM_NOTICE_SUPPORTED 0x00020000 +#define IB_CA_MOD_IS_REINIT_SUPORTED 0x00040000 +#define IB_CA_MOD_IS_LEDINFO_SUPPORTED 0x00080000 +#define IB_CA_MOD_SHUTDOWN_PORT 0x00100000 +#define IB_CA_MOD_INIT_TYPE_VALUE 0x00200000 +#define IB_CA_MOD_SYSTEM_IMAGE_GUID 0x00400000 +#define IB_MR_MOD_ADDR 0x00000001 +#define IB_MR_MOD_PD 0x00000002 +#define IB_MR_MOD_ACCESS 0x00000004 +#define IB_SMINFO_ATTR_MOD_HANDOVER htobe32(0x000001) +#define IB_SMINFO_ATTR_MOD_ACKNOWLEDGE htobe32(0x000002) +#define IB_SMINFO_ATTR_MOD_DISABLE htobe32(0x000003) +#define IB_SMINFO_ATTR_MOD_STANDBY htobe32(0x000004) +#define IB_SMINFO_ATTR_MOD_DISCOVER htobe32(0x000005) +#define IB_CC_LOG_DATA_SIZE 32 +#define IB_CC_MGT_DATA_SIZE 192 +typedef struct { + ib_mad_t header; + __be64 cc_key; + uint8_t log_data[IB_CC_LOG_DATA_SIZE]; + uint8_t mgt_data[IB_CC_MGT_DATA_SIZE]; +} __attribute__((packed)) ib_cc_mad_t; +typedef struct { + uint8_t cong_info; + uint8_t resv; + uint8_t ctrl_table_cap; +} __attribute__((packed)) ib_cong_info_t; +typedef struct { + __be64 cc_key; + __be16 protect_bit; + __be16 lease_period; + __be16 violations; +} __attribute__((packed)) ib_cong_key_info_t; +typedef struct { + __be16 slid; + __be16 dlid; + __be32 sl; + __be32 time_stamp; +} __attribute__((packed)) ib_cong_log_event_sw_t; +typedef struct { + __be32 local_qp_resv0; + __be32 remote_qp_sl_service_type; + __be16 remote_lid; + __be16 resv1; + __be32 time_stamp; +} __attribute__((packed)) ib_cong_log_event_ca_t; +typedef struct { + uint8_t log_type; + union _log_details { + struct _log_sw { + uint8_t cong_flags; + __be16 event_counter; + __be32 time_stamp; + uint8_t port_map[32]; + ib_cong_log_event_sw_t entry_list[15]; + } __attribute__((packed)) log_sw; + + struct _log_ca { + uint8_t cong_flags; + __be16 event_counter; + __be16 event_map; + __be16 resv; + __be32 time_stamp; + ib_cong_log_event_ca_t log_event[13]; + } __attribute__((packed)) log_ca; + + } log_details; +} __attribute__((packed)) ib_cong_log_t; +#define IB_CC_PORT_MASK_DATA_SIZE 32 +typedef struct { + __be32 control_map; + uint8_t victim_mask[IB_CC_PORT_MASK_DATA_SIZE]; + uint8_t credit_mask[IB_CC_PORT_MASK_DATA_SIZE]; + uint8_t threshold_resv; + uint8_t packet_size; + __be16 cs_threshold_resv; + __be16 cs_return_delay; + __be16 marking_rate; +} __attribute__((packed)) ib_sw_cong_setting_t; +typedef struct { + uint8_t valid_ctrl_type_res_threshold; + uint8_t packet_size; + __be16 cong_param; +} __attribute__((packed)) ib_sw_port_cong_setting_element_t; +#define IB_CC_SW_PORT_SETTING_ELEMENTS 32 +typedef struct { + ib_sw_port_cong_setting_element_t block[IB_CC_SW_PORT_SETTING_ELEMENTS]; +} __attribute__((packed)) ib_sw_port_cong_setting_t; +typedef struct { + __be16 ccti_timer; + uint8_t ccti_increase; + uint8_t trigger_threshold; + uint8_t ccti_min; + uint8_t resv0; + __be16 resv1; +} __attribute__((packed)) ib_ca_cong_entry_t; +#define IB_CA_CONG_ENTRY_DATA_SIZE 16 +typedef struct { + __be16 port_control; + __be16 control_map; + ib_ca_cong_entry_t entry_list[IB_CA_CONG_ENTRY_DATA_SIZE]; +} __attribute__((packed)) ib_ca_cong_setting_t; +typedef struct { + __be16 shift_multiplier; +} __attribute__((packed)) ib_cc_tbl_entry_t; +#define IB_CC_TBL_ENTRY_LIST_MAX 64 +typedef struct { + __be16 ccti_limit; + __be16 resv; + ib_cc_tbl_entry_t entry_list[IB_CC_TBL_ENTRY_LIST_MAX]; +} __attribute__((packed)) ib_cc_tbl_t; +typedef struct { + __be32 value; +} __attribute__((packed)) ib_time_stamp_t; + +#define IB_PM_PC_XMIT_WAIT_SUP htobe16(1 << 12) +#define IS_PM_RSFEC_COUNTERS_SUP htobe16(1 << 14) +#define IB_PM_IS_QP1_DROP_SUP htobe16(1 << 15) +#define IB_PM_IS_ADDL_PORT_CTRS_EXT_SUP htobe32(1 << 1) +#define IB_PORT_CAP2_IS_PORT_INFO_EXT_SUPPORTED htobe16(0x0002) +#define IB_PORT_EXT_NO_FEC_MODE_ACTIVE 0 +#define IB_PORT_EXT_FIRE_CODE_FEC_MODE_ACTIVE htobe16(0x0001) +#define IB_PORT_EXT_RS_FEC_MODE_ACTIVE htobe16(0x0002) +#define IB_PORT_EXT_LOW_LATENCY_RS_FEC_MODE_ACTIVE htobe16(0x0003) +#define IB_PORT_EXT_RS_FEC2_MODE_ACTIVE htobe16(0x0004) +#define IB_PORT_EXT_CAP_IS_FEC_MODE_SUPPORTED htobe32(0x00000001) + +static inline uint32_t ib_class_cap_mask2(const ib_class_port_info_t *p_cpi) +{ + return (be32toh(p_cpi->cap_mask2_resp_time) >> IB_CLASS_CAPMASK2_SHIFT); +} + +static inline uint8_t ib_class_resp_time_val(ib_class_port_info_t *p_cpi) +{ + return (uint8_t)(be32toh(p_cpi->cap_mask2_resp_time) & + IB_CLASS_RESP_TIME_MASK); +} + +static inline const char *ib_get_node_type_str(uint8_t node_type) +{ + static const char *const __ib_node_type_str[] = { + "UNKNOWN", + "Channel Adapter", + "Switch", + "Router", + }; + + if (node_type > IB_NODE_TYPE_ROUTER) + node_type = 0; + return (__ib_node_type_str[node_type]); +} + +static inline __be32 ib_inform_info_get_prod_type(const ib_inform_info_t *p_inf) +{ + uint32_t nt; + + nt = be16toh(p_inf->g_or_v.generic.node_type_lsb) | + (p_inf->g_or_v.generic.node_type_msb << 16); + return htobe32(nt); +} + +static inline void +ib_inform_info_get_qpn_resp_time(const __be32 qpn_resp_time_val, __be32 *p_qpn, + uint8_t *p_resp_time_val) +{ + uint32_t tmp = be32toh(qpn_resp_time_val); + + if (p_qpn) + *p_qpn = htobe32((tmp & 0xffffff00) >> 8); + if (p_resp_time_val) + *p_resp_time_val = (uint8_t)(tmp & 0x0000001f); +} + +static inline void ib_member_get_scope_state(const uint8_t scope_state, + uint8_t *p_scope, uint8_t *p_state) +{ + uint8_t tmp_scope_state; + + if (p_state) + *p_state = (uint8_t)(scope_state & 0x0f); + + tmp_scope_state = scope_state >> 4; + + if (p_scope) + *p_scope = (uint8_t)(tmp_scope_state & 0x0f); +} + +static inline void ib_member_get_sl_flow_hop(const __be32 sl_flow_hop, + uint8_t *p_sl, + uint32_t *p_flow_lbl, + uint8_t *p_hop) +{ + uint32_t tmp; + + tmp = be32toh(sl_flow_hop); + if (p_hop) + *p_hop = (uint8_t)tmp; + tmp >>= 8; + + if (p_flow_lbl) + *p_flow_lbl = (uint32_t)(tmp & 0xfffff); + tmp >>= 20; + + if (p_sl) + *p_sl = (uint8_t)tmp; +} + +static inline __be32 ib_member_set_sl_flow_hop(const uint8_t sl, + const uint32_t flow_label, + const uint8_t hop_limit) +{ + uint32_t tmp; + + tmp = (sl << 28) | ((flow_label & 0xfffff) << 8) | hop_limit; + return htobe32(tmp); +} + +static inline __be32 ib_node_info_get_vendor_id(const ib_node_info_t *p_ni) +{ + return ((__be32)(p_ni->port_num_vendor_id & IB_NODE_INFO_VEND_ID_MASK)); +} + +static inline uint8_t +ib_node_info_get_local_port_num(const ib_node_info_t *p_ni) +{ + return be32toh(p_ni->port_num_vendor_id & IB_NODE_INFO_PORT_NUM_MASK) >> + 24; +} + +static inline uint16_t ib_path_rec_qos_class(const ib_path_rec_t *p_rec) +{ + return (be16toh(p_rec->qos_class_sl) >> 4); +} + +static inline void ib_path_rec_set_qos_class(ib_path_rec_t *p_rec, + const uint16_t qos_class) +{ + p_rec->qos_class_sl = + (p_rec->qos_class_sl & htobe16(IB_PATH_REC_SL_MASK)) | + htobe16(qos_class << 4); +} + +static inline uint8_t ib_path_rec_sl(const ib_path_rec_t *p_rec) +{ + return (uint8_t)(be16toh(p_rec->qos_class_sl) & IB_PATH_REC_SL_MASK); +} + +static inline uint8_t ib_slvl_table_get(const ib_slvl_table_t *p_slvl_tbl, + uint8_t sl_index) +{ + uint8_t idx = sl_index / 2; + assert(sl_index <= 15); + + if (sl_index % 2) + /* this is an odd sl. Need to return the ls bits. */ + return (p_slvl_tbl->raw_vl_by_sl[idx] & 0x0F); + else + /* this is an even sl. Need to return the ms bits. */ + return ((p_slvl_tbl->raw_vl_by_sl[idx] & 0xF0) >> 4); +} + +static inline uint8_t ib_sminfo_get_priority(const ib_sm_info_t *p_smi) +{ + return ((uint8_t)((p_smi->pri_state & 0xF0) >> 4)); +} + +static inline uint8_t ib_sminfo_get_state(const ib_sm_info_t *p_smi) +{ + return ((uint8_t)(p_smi->pri_state & 0x0F)); +} + +#endif diff --git a/ibdiags/libibnetdisc/include/infiniband/ibnetdisc.h b/ibdiags/libibnetdisc/include/infiniband/ibnetdisc.h index 8bdc048459c3d2..0f39e8d5edac62 100644 --- a/ibdiags/libibnetdisc/include/infiniband/ibnetdisc.h +++ b/ibdiags/libibnetdisc/include/infiniband/ibnetdisc.h @@ -38,7 +38,6 @@ #include #include -#include #include diff --git a/ibdiags/libibnetdisc/src/CMakeLists.txt b/ibdiags/libibnetdisc/src/CMakeLists.txt index c93c9be8cc6cd6..ad8c09dc9722f6 100644 --- a/ibdiags/libibnetdisc/src/CMakeLists.txt +++ b/ibdiags/libibnetdisc/src/CMakeLists.txt @@ -15,8 +15,6 @@ target_link_libraries(ibnetdisc LINK_PRIVATE ibmad ibumad ) -# FIXME for osmcomp -target_include_directories(ibnetdisc PRIVATE "/usr/include/infiniband") rdma_pkg_config("ibnetdisc" "libibumad libibmad" "") rdma_test_executable(testleaks ../test/testleaks.c) @@ -24,4 +22,3 @@ target_link_libraries(testleaks LINK_PRIVATE ibmad ibnetdisc ) -target_include_directories(testleaks PRIVATE "/usr/include/infiniband") diff --git a/ibdiags/libibnetdisc/src/ibnetdisc.c b/ibdiags/libibnetdisc/src/ibnetdisc.c index 7425545b78f532..cc76e994042e21 100644 --- a/ibdiags/libibnetdisc/src/ibnetdisc.c +++ b/ibdiags/libibnetdisc/src/ibnetdisc.c @@ -37,6 +37,7 @@ #define _GNU_SOURCE #include #include +#include #include #include #include @@ -44,6 +45,7 @@ #include #include +#include #include diff --git a/ibdiags/src/CMakeLists.txt b/ibdiags/src/CMakeLists.txt index edce64f2106a3d..c12452f92c7c9c 100644 --- a/ibdiags/src/CMakeLists.txt +++ b/ibdiags/src/CMakeLists.txt @@ -7,7 +7,6 @@ add_library(ibdiags_tools STATIC ibdiag_common.c ibdiag_sa.c ) -target_include_directories(ibdiags_tools PRIVATE "/usr/include/infiniband") function(ibdiag_programs) foreach(I ${ARGN}) @@ -42,7 +41,5 @@ ibdiag_programs( rdma_test_executable(ibsendtrap "ibsendtrap.c") target_link_libraries(ibsendtrap PRIVATE ibumad ibmad ibdiags_tools) -target_include_directories(ibsendtrap PRIVATE "/usr/include/infiniband") rdma_test_executable(mcm_rereg_test "mcm_rereg_test.c") target_link_libraries(mcm_rereg_test PRIVATE ibumad ibmad ibdiags_tools) -target_include_directories(mcm_rereg_test PRIVATE "/usr/include/infiniband") diff --git a/ibdiags/src/ibsendtrap.c b/ibdiags/src/ibsendtrap.c index 69ec73112c841e..4c6bbd47365149 100644 --- a/ibdiags/src/ibsendtrap.c +++ b/ibdiags/src/ibsendtrap.c @@ -45,7 +45,6 @@ #define _GNU_SOURCE #include -#include #include "ibdiag_common.h" diff --git a/ibdiags/src/mcm_rereg_test.c b/ibdiags/src/mcm_rereg_test.c index 66c066b40e40cc..8c0b5ea2b6d714 100644 --- a/ibdiags/src/mcm_rereg_test.c +++ b/ibdiags/src/mcm_rereg_test.c @@ -38,7 +38,6 @@ #include #include -#include #include "ibdiag_common.h" diff --git a/ibdiags/src/perfquery.c b/ibdiags/src/perfquery.c index b921e3d402854c..7d4bba91223a56 100644 --- a/ibdiags/src/perfquery.c +++ b/ibdiags/src/perfquery.c @@ -41,7 +41,6 @@ #include #include -#include #include "ibdiag_common.h" diff --git a/ibdiags/src/saquery.c b/ibdiags/src/saquery.c index f50430818c7863..8c0f57ffe9ed4e 100644 --- a/ibdiags/src/saquery.c +++ b/ibdiags/src/saquery.c @@ -49,7 +49,6 @@ #include #include -#include #include #include "ibdiag_common.h" diff --git a/ibtypes.py b/ibtypes.py new file mode 100644 index 00000000000000..119a023e593591 --- /dev/null +++ b/ibtypes.py @@ -0,0 +1,61 @@ +import re +import sys + +def global_ln(ln): + g = re.match(r"^#define\s+(\S+)\s+CL_HTON(\d+)\((.*)\)",ln) + if g: + print("#define %s htobe%s(%s)"%(g.group(1),g.group(2),g.group(3))) + return global_ln + g = re.match(r"^#define\s+(\S+)\s+\(CL_HTON(\d+)\((.*)\)\)",ln) + if g: + print("#define %s htobe%s(%s)"%(g.group(1),g.group(2),g.group(3))) + return global_ln + g = re.match(r"^#define\s+(\S+)\s+(0x\w+)",ln) + if g: + print("#define %s %s"%(g.group(1),g.group(2))) + return global_ln + g = re.match(r"^#define\s+(\S+)\s+\((0x\w+)\)",ln) + if g: + print("#define %s %s"%(g.group(1),g.group(2))) + return global_ln + g = re.match(r"^#define\s+(\S+)\s+(\d+)",ln) + if g: + print("#define %s %s"%(g.group(1),g.group(2))) + return global_ln + g = re.match(r"^#define\s+(\S+)\s+\((\d+)\)",ln) + if g: + print("#define %s %s"%(g.group(1),g.group(2))) + return global_ln + + g = re.match(r"^typedef\s+(union|struct)\s+_\S+\s+{",ln); + if g: + print("typedef %s {"%(g.group(1))); + return in_struct; + + print(ln,file=FO); + return global_ln + +def in_struct(ln): + g = re.match(r"^}\s+PACK_SUFFIX\s+(\S+);",ln); + if g: + print("} __attribute__((packed)) %s;"%(g.group(1))); + return global_ln; + g = re.match(r"^}\s+(\S+);",ln); + if g: + print("} %s;"%(g.group(1))); + return global_ln; + + ln = ln.replace("PACK_SUFFIX","__attribute__((packed))"); + ln = ln.replace("ib_gid_prefix_t","__be64"); + ln = ln.replace("ib_net64_t","__be64"); + ln = ln.replace("ib_net32_t","__be32"); + ln = ln.replace("ib_net16_t","__be16"); + ln = ln.replace("boolean_t","bool"); + print(ln) + return in_struct; + +mode = global_ln +with open(sys.argv[1]) as FI, open(sys.argv[2],"wt") as FO: + for ln in FI: + ln = ln.rstrip(); + mode = mode(ln); From patchwork Tue May 14 23:49:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10944099 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D4CE61395 for ; Tue, 14 May 2019 23:49:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C429128987 for ; Tue, 14 May 2019 23:49:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B88DB2898D; Tue, 14 May 2019 23:49:47 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 C8A4E28987 for ; Tue, 14 May 2019 23:49:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726563AbfENXtp (ORCPT ); Tue, 14 May 2019 19:49:45 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:33728 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726482AbfENXto (ORCPT ); Tue, 14 May 2019 19:49:44 -0400 Received: by mail-qt1-f195.google.com with SMTP id m32so1264903qtf.0 for ; Tue, 14 May 2019 16:49:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9IViokkzoWRwsO0VggXEtxPjZSpWiYtH5t/zqD8CvWI=; b=JnzQP4vIjV2LyfjfnGrmcfrZ05TBVWk0lbnny0uzm2S3hbtxYrtjjUSujQO5+9Nmq6 qs1xZ7W+XsaSp8ZXlPwEoPhRtV++NJARkOHtzydDDXq7fAHblu/KMGBK0hNpmach8qzO ufDRxqGtzsau9IzMph6acGkrsonNBgJD9Phc/QXdwngsHvlcQbv53FyGh1bazVCeSePn UhO0Oh5IFLjF9MyWPPGi2BHXoQMQjshDb06MLdD/HY/VciHhaG79ylq0TP2GqrqZWNVp CnoXHRSWXnBsbn5fT+Y15fhLdlAnNADUEQWVQp9Y0amTY+4o3KBTwzUPDGLs76hHoOHA fsJw== 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:mime-version:content-transfer-encoding; bh=9IViokkzoWRwsO0VggXEtxPjZSpWiYtH5t/zqD8CvWI=; b=azN0V8rAaw99woLndnK0EIAklqidU5X4DEEyuYGbX8YZfyR9Tt9kV5f/78oCqhIqpK q8LnTUUbk1grNhGdfIZ0IYIQJ//1c2bS00VLCNZqn2Yh4Y644AuMWpED9ONxp3H1QPiR fVy9ja2QfmoVGkLMf3fwp+NQ9IppeVcKEzUhLsKAdQWfCuovfkSQGtp2zsGV6ix0qke1 2glGlCTupGyaD4A7v2hSrbjRoycERThn97wwMtJRAMLlczAc/4eiYDn4e96xUlSAFhfl 0s67OLjro/HlIGYiRdpl91JDGxsAqC5vFzQkU/wF5H0BsdFv4T0d9W4NpnaYzo4sGERg /sRQ== X-Gm-Message-State: APjAAAX5wWbFLIQBnAapBnTxZxOvQXCVvQ0AXWBETQCyEP6KI7a0sW8O 2ypc+TuTInh1iAOb39EJPy8qhaWGHgA= X-Google-Smtp-Source: APXvYqxb57WkXIm9ylaQ86tkZoUUzbVHi1toMOU4f5Pw60NSJMNhjgAeQysMTB9T8mCwWb+nFjvxgw== X-Received: by 2002:ac8:38eb:: with SMTP id g40mr33475513qtc.342.1557877782712; Tue, 14 May 2019 16:49:42 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id x47sm246387qth.68.2019.05.14.16.49.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 16:49:40 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hQhAx-0001Nb-3Z; Tue, 14 May 2019 20:49:39 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 10/20] ibdiags: Provide the cl_nodenamemap interface Date: Tue, 14 May 2019 20:49:26 -0300 Message-Id: <20190514234936.5175-11-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514234936.5175-1-jgg@ziepe.ca> References: <20190514234936.5175-1-jgg@ziepe.ca> MIME-Version: 1.0 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: Jason Gunthorpe Copy the implementation from opensm and match the style to rdma-core. This version is copied from opensm commit 6d49a7e3c02a ("libvendor/osm_vendor_mlx_sim.c: In osmv_transport_init, fix memory leaks on error") Signed-off-by: Jason Gunthorpe --- CMakeLists.txt | 1 + buildlib/config.h.in | 1 + ibdiags/src/CMakeLists.txt | 3 +- ibdiags/src/dump_fts.c | 2 +- ibdiags/src/iblinkinfo.c | 2 +- ibdiags/src/ibnetdiscover.c | 2 +- ibdiags/src/ibqueryerrors.c | 2 +- ibdiags/src/ibroute.c | 2 +- ibdiags/src/ibtracert.c | 2 +- ibdiags/src/saquery.c | 2 +- ibdiags/src/smpquery.c | 2 +- util/CMakeLists.txt | 2 + util/node_name_map.c | 222 ++++++++++++++++++++++++++++++++++++ util/node_name_map.h | 19 +++ 14 files changed, 254 insertions(+), 10 deletions(-) create mode 100644 util/node_name_map.c create mode 100644 util/node_name_map.h diff --git a/CMakeLists.txt b/CMakeLists.txt index c54cf6606e3c0d..e16b955991558a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,6 +104,7 @@ set(BUILD_ETC ${CMAKE_BINARY_DIR}/etc) set(BUILD_PYTHON ${CMAKE_BINARY_DIR}/python) set(IBDIAG_CONFIG_PATH "${CMAKE_INSTALL_FULL_SYSCONFDIR}/infiniband-diags") +set(IBDIAG_NODENAME_MAP_PATH "${CMAKE_INSTALL_FULL_SYSCONFDIR}/rdma/ib-node-name-map") set(CMAKE_INSTALL_INITDDIR "${CMAKE_INSTALL_SYSCONFDIR}/init.d" CACHE PATH "Location for init.d files") diff --git a/buildlib/config.h.in b/buildlib/config.h.in index b4cb669b7be4bf..2bac241ce1fdf1 100644 --- a/buildlib/config.h.in +++ b/buildlib/config.h.in @@ -32,6 +32,7 @@ #define IBACM_SERVER_PATH "@CMAKE_INSTALL_FULL_RUNDIR@/ibacm.sock" #define IBDIAG_CONFIG_PATH "@IBDIAG_CONFIG_PATH@" +#define IBDIAG_NODENAME_MAP_PATH "@IBDIAG_NODENAME_MAP_PATH@" #define VERBS_PROVIDER_DIR "@VERBS_PROVIDER_DIR@" #define VERBS_PROVIDER_SUFFIX "@IBVERBS_PROVIDER_SUFFIX@" diff --git a/ibdiags/src/CMakeLists.txt b/ibdiags/src/CMakeLists.txt index c12452f92c7c9c..b28f543f2f0699 100644 --- a/ibdiags/src/CMakeLists.txt +++ b/ibdiags/src/CMakeLists.txt @@ -11,8 +11,7 @@ add_library(ibdiags_tools STATIC function(ibdiag_programs) foreach(I ${ARGN}) rdma_sbin_executable(${I} "${I}.c") - target_link_libraries(${I} PRIVATE ${RT_LIBRARIES} ibumad ibmad ibdiags_tools ibnetdisc osmcomp) - target_include_directories(${I} PRIVATE "/usr/include/infiniband") + target_link_libraries(${I} PRIVATE ${RT_LIBRARIES} ibumad ibmad ibdiags_tools ibnetdisc) endforeach() endfunction() diff --git a/ibdiags/src/dump_fts.c b/ibdiags/src/dump_fts.c index 6aba80827d279c..14a9ae216dc070 100644 --- a/ibdiags/src/dump_fts.c +++ b/ibdiags/src/dump_fts.c @@ -43,7 +43,7 @@ #include #include -#include +#include #include diff --git a/ibdiags/src/iblinkinfo.c b/ibdiags/src/iblinkinfo.c index 557faad0b6f3bf..afd2f4e882c65b 100644 --- a/ibdiags/src/iblinkinfo.c +++ b/ibdiags/src/iblinkinfo.c @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include "ibdiag_common.h" diff --git a/ibdiags/src/ibnetdiscover.c b/ibdiags/src/ibnetdiscover.c index e8c8b19be4e592..88e44f18c9cb02 100644 --- a/ibdiags/src/ibnetdiscover.c +++ b/ibdiags/src/ibnetdiscover.c @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include "ibdiag_common.h" diff --git a/ibdiags/src/ibqueryerrors.c b/ibdiags/src/ibqueryerrors.c index 332b7ce764e097..48c9f17bb2625f 100644 --- a/ibdiags/src/ibqueryerrors.c +++ b/ibdiags/src/ibqueryerrors.c @@ -47,7 +47,7 @@ #include #include -#include +#include #include #include diff --git a/ibdiags/src/ibroute.c b/ibdiags/src/ibroute.c index 6a59d63483ad3f..114f476fe7b670 100644 --- a/ibdiags/src/ibroute.c +++ b/ibdiags/src/ibroute.c @@ -41,7 +41,7 @@ #include #include -#include +#include #include "ibdiag_common.h" diff --git a/ibdiags/src/ibtracert.c b/ibdiags/src/ibtracert.c index b7d383a8d48947..c1560107fd9e91 100644 --- a/ibdiags/src/ibtracert.c +++ b/ibdiags/src/ibtracert.c @@ -43,7 +43,7 @@ #include #include -#include +#include #include "ibdiag_common.h" diff --git a/ibdiags/src/saquery.c b/ibdiags/src/saquery.c index 8c0f57ffe9ed4e..37951595c603fd 100644 --- a/ibdiags/src/saquery.c +++ b/ibdiags/src/saquery.c @@ -49,7 +49,7 @@ #include #include -#include +#include #include "ibdiag_common.h" #include "ibdiag_sa.h" diff --git a/ibdiags/src/smpquery.c b/ibdiags/src/smpquery.c index 210bad41fdf88f..36988287442c9f 100644 --- a/ibdiags/src/smpquery.c +++ b/ibdiags/src/smpquery.c @@ -43,7 +43,7 @@ #include #include -#include +#include #include "ibdiag_common.h" diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt index 8b4f5d65c753f5..bb43ad444116d4 100644 --- a/util/CMakeLists.txt +++ b/util/CMakeLists.txt @@ -1,12 +1,14 @@ publish_internal_headers(util cl_qmap.h compiler.h + node_name_map.h symver.h util.h ) set(C_FILES cl_map.c + node_name_map.c util.c) if (HAVE_COHERENT_DMA) diff --git a/util/node_name_map.c b/util/node_name_map.c new file mode 100644 index 00000000000000..cd73bbc97a4809 --- /dev/null +++ b/util/node_name_map.c @@ -0,0 +1,222 @@ +/* + * Copyright (c) 2008 Voltaire, Inc. All rights reserved. + * Copyright (c) 2007 Lawrence Livermore National Lab + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#define PARSE_NODE_MAP_BUFLEN 256 + +typedef struct _name_map_item { + cl_map_item_t item; + uint64_t guid; + char *name; +} name_map_item_t; + +struct nn_map { + cl_qmap_t map; +}; + +static int map_name(void *cxt, uint64_t guid, char *p) +{ + cl_qmap_t *map = cxt; + name_map_item_t *item; + + p = strtok(p, "\"#"); + if (!p) + return 0; + + item = malloc(sizeof(*item)); + if (!item) + return -1; + item->guid = guid; + item->name = strdup(p); + cl_qmap_insert(map, item->guid, (cl_map_item_t *) item); + return 0; +} + +void close_node_name_map(nn_map_t * map) +{ + name_map_item_t *item = NULL; + + if (!map) + return; + + item = (name_map_item_t *) cl_qmap_head(&map->map); + while (item != (name_map_item_t *) cl_qmap_end(&map->map)) { + item = (name_map_item_t *) cl_qmap_remove(&map->map, item->guid); + free(item->name); + free(item); + item = (name_map_item_t *) cl_qmap_head(&map->map); + } + free(map); +} + +char *remap_node_name(nn_map_t * map, uint64_t target_guid, char *nodedesc) +{ + char *rc = NULL; + name_map_item_t *item = NULL; + + if (!map) + goto done; + + item = (name_map_item_t *) cl_qmap_get(&map->map, target_guid); + if (item != (name_map_item_t *) cl_qmap_end(&map->map)) + rc = strdup(item->name); + +done: + if (rc == NULL) + rc = strdup(clean_nodedesc(nodedesc)); + return (rc); +} + +char *clean_nodedesc(char *nodedesc) +{ + int i = 0; + + nodedesc[63] = '\0'; + while (nodedesc[i]) { + if (!isprint(nodedesc[i])) + nodedesc[i] = ' '; + i++; + } + + return (nodedesc); +} + +static int parse_node_map_wrap(const char *file_name, + int (*create) (void *, uint64_t, char *), + void *cxt, + char *linebuf, + unsigned int linebuflen) +{ + char line[PARSE_NODE_MAP_BUFLEN]; + FILE *f; + + if (!(f = fopen(file_name, "r"))) + return -1; + + while (fgets(line, sizeof(line), f)) { + uint64_t guid; + char *p, *e; + + p = line; + while (isspace(*p)) + p++; + if (*p == '\0' || *p == '\n' || *p == '#') + continue; + + guid = strtoull(p, &e, 0); + if (e == p || (!isspace(*e) && *e != '#' && *e != '\0')) { + fclose(f); + errno = EIO; + if (linebuf) { + memcpy(linebuf, line, + min_t(size_t, PARSE_NODE_MAP_BUFLEN, + linebuflen)); + e = strpbrk(linebuf, "\n"); + if (e) + *e = '\0'; + } + return -1; + } + + p = e; + while (isspace(*p)) + p++; + + e = strpbrk(p, "\n"); + if (e) + *e = '\0'; + + if (create(cxt, guid, p)) { + fclose(f); + return -1; + } + } + + fclose(f); + return 0; +} + +nn_map_t *open_node_name_map(const char *node_name_map) +{ + nn_map_t *map; + char linebuf[PARSE_NODE_MAP_BUFLEN + 1]; + + if (!node_name_map) { + struct stat buf; + node_name_map = IBDIAG_NODENAME_MAP_PATH; + if (stat(node_name_map, &buf)) + return NULL; + } + + map = malloc(sizeof(*map)); + if (!map) + return NULL; + cl_qmap_init(&map->map); + + memset(linebuf, '\0', PARSE_NODE_MAP_BUFLEN + 1); + if (parse_node_map_wrap(node_name_map, map_name, map, + linebuf, PARSE_NODE_MAP_BUFLEN)) { + if (errno == EIO) { + fprintf(stderr, + "WARNING failed to parse node name map " + "\"%s\"\n", + node_name_map); + fprintf(stderr, + "WARNING failed line: \"%s\"\n", + linebuf); + } + else + fprintf(stderr, + "WARNING failed to open node name map " + "\"%s\" (%s)\n", + node_name_map, strerror(errno)); + close_node_name_map(map); + return NULL; + } + + return map; +} diff --git a/util/node_name_map.h b/util/node_name_map.h new file mode 100644 index 00000000000000..e78d274b116ee3 --- /dev/null +++ b/util/node_name_map.h @@ -0,0 +1,19 @@ +/* Copyright (c) 2019 Mellanox Technologies. All rights reserved. + * + * Connect to opensm's cl_nodenamemap.h if it is available. + */ +#ifndef __LIBUTIL_NODE_NAME_MAP_H__ +#define __LIBUTIL_NODE_NAME_MAP_H__ + +#include + +struct nn_map; +typedef struct nn_map nn_map_t; + +nn_map_t *open_node_name_map(const char *node_name_map); +void close_node_name_map(nn_map_t *map); +/* NOTE: parameter "nodedesc" may be modified here. */ +char *remap_node_name(nn_map_t *map, uint64_t target_guid, char *nodedesc); +char *clean_nodedesc(char *nodedesc); + +#endif From patchwork Tue May 14 23:49:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10944101 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2FA931398 for ; Tue, 14 May 2019 23:49:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1EE75288DA for ; Tue, 14 May 2019 23:49:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1322828994; Tue, 14 May 2019 23:49:49 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 F3781288DA for ; Tue, 14 May 2019 23:49:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726482AbfENXtq (ORCPT ); Tue, 14 May 2019 19:49:46 -0400 Received: from mail-qt1-f180.google.com ([209.85.160.180]:33102 "EHLO mail-qt1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726281AbfENXto (ORCPT ); Tue, 14 May 2019 19:49:44 -0400 Received: by mail-qt1-f180.google.com with SMTP id m32so1264921qtf.0 for ; Tue, 14 May 2019 16:49:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=F7oSw4AKUy6PKK2e6zyJNZ6FZqtsZXo6IU+vDEIguvg=; b=NKKEwXZ8qOU3XFyb2v6YNUaLV6Qdty9kuh9s3qKZzADMirDFvgKR0oDtszdFD1t6eW 9uPdHw2OlvDllCCTUYkZpSVMaT6ciwHoNjUsLJJQYXiXTBt6WLJqQLVQjLXm57Aibxr1 CoOR+PmW2HEUhzF1AIwDNTbiiGISsA2KL6kq5PIfAVTGJV3JibnrMFtdtzpkAMsm+HVm hgEM1PKCfoNKDiBGMaBJtoVW3IEOxHBnjcH5LphNocXgaWKsi0QPALVZ2XSVDJV90wO3 cnuc7hptmQGMYHMAQJ3PMPLUVrYW2z8w2CKabEqB6Zz+J8Wv060R65Gsi+66pN1X6wjQ E+aQ== 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:mime-version:content-transfer-encoding; bh=F7oSw4AKUy6PKK2e6zyJNZ6FZqtsZXo6IU+vDEIguvg=; b=U0/AkqFTmX7h+vNawTmUITLXT39rlM3iLV58ELNVkCBHkinW7QfOvlyImL8b78J7xE LWuy7hrQSPC3+E0uzkj9iXryliHvy03a/NPIQTVUtdQFZkoJHUPh69/CGLy2hCZfBYVm 1y0+u1shtJAbVWU3Vm94Qb79qfxPAeQAcYh61xkV2+Kky3zdxWygGA/nfsp1c9c4MNLK KbX3dPvA9q/Asgzxpp68+xEPlZdARS+kU4Unf6AqQaEyy14N485CjrBCIrZQXPXuGwhY mkTYc9Enj+rjlFqSDB1TIbPLwRat1RIqSbhZemQY57pZ7Nu/UZAYzullpOhdHrLzUUoX 0mUA== X-Gm-Message-State: APjAAAURBBjbjM/lEHr5P/wHTJggi8bEdSpFF6kWJUodR1xeQl5J05Wg NnGw6mh+moVX19g08ayOAEWD1+OH0ek= X-Google-Smtp-Source: APXvYqxQs+ngdIsrVG6a2yLT2YBFl+VlJ+E0N8HWwR7sxhOwb/Ve3pPE1z3DZEcJEiv7u+LJMxP2jw== X-Received: by 2002:ac8:1d02:: with SMTP id d2mr7666588qtl.148.1557877783036; Tue, 14 May 2019 16:49:43 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id y13sm123420qka.82.2019.05.14.16.49.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 16:49:40 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hQhAx-0001Nh-4s; Tue, 14 May 2019 20:49:39 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 11/20] ibdiags: Add Debian packaging Date: Tue, 14 May 2019 20:49:27 -0300 Message-Id: <20190514234936.5175-12-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514234936.5175-1-jgg@ziepe.ca> References: <20190514234936.5175-1-jgg@ziepe.ca> MIME-Version: 1.0 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: Jason Gunthorpe This is largely copied from the latest Debian/Ubuntu release. Signed-off-by: Jason Gunthorpe --- debian/control | 101 +++++++++++++++++++++ debian/infiniband-diags.install | 64 +++++++++++++ debian/libibmad-dev.install | 5 ++ debian/libibmad5.install | 1 + debian/libibmad5.symbols | 154 ++++++++++++++++++++++++++++++++ debian/libibnetdisc-dev.install | 13 +++ debian/libibnetdisc5.install | 1 + debian/libibnetdisc5.symbols | 20 +++++ debian/rules | 4 +- 9 files changed, 362 insertions(+), 1 deletion(-) create mode 100644 debian/infiniband-diags.install create mode 100644 debian/libibmad-dev.install create mode 100644 debian/libibmad5.install create mode 100644 debian/libibmad5.symbols create mode 100644 debian/libibnetdisc-dev.install create mode 100644 debian/libibnetdisc5.install create mode 100644 debian/libibnetdisc5.symbols diff --git a/debian/control b/debian/control index f4480827bf86af..f0f43da0d641b8 100644 --- a/debian/control +++ b/debian/control @@ -337,3 +337,104 @@ Depends: rdma-core (>= 21), Provides: ${python3:Provides} Description: Pyverbs is a Python bindings for rdma-core It allows an easy development in Python language of RDMA applications. + +Package: infiniband-diags +Architecture: linux-any +Depends: libibnetdisc5 (= ${binary:Version}), + ${misc:Depends}, + ${perl:Depends}, + ${shlibs:Depends} +Description: InfiniBand diagnostic programs + InfiniBand is a switched fabric communications link used in + high-performance computing and enterprise data centers. Its features + include high throughput, low latency, quality of service and + failover, and it is designed to be scalable. + . + This package provides diagnostic programs and scripts needed to + diagnose an InfiniBand subnet. + +Package: libibmad5 +Section: libs +Architecture: linux-any +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Infiniband Management Datagram (MAD) library + libibmad provides low layer InfiniBand functions for use by the + Infiniband diagnostic and management programs. These include + Management Datagrams (MAD), Subnet Administration (SA), Subnet + Management Packets (SMP) and other basic functions. + . + This package contains the shared library. + +Package: libibmad5-dbg +Section: libs +Architecture: linux-any +Pre-Depends: ${misc:Pre-Depends} +Depends: libibmad5 (= ${binary:Version}), ${misc:Depends} +Description: Infiniband Management Datagram (MAD) library + libibmad provides low layer InfiniBand functions for use by the + Infiniband diagnostic and management programs. These include + Management Datagrams (MAD), Subnet Administration (SA), Subnet + Management Packets (SMP) and other basic functions. + . + This package contains the debug symbols associated with + libibmad5. They will automatically be used by gdb for debugging + libibmad-related issues. + +Package: libibmad-dev +Section: libdevel +Architecture: linux-any +Depends: libibmad5 (= ${binary:Version}), ${misc:Depends} +Description: Development files for libibmad + libibmad provides low layer Infiniband functions for use by the + InfiniBand diagnostic and management programs. These include + Management Datagrams (MAD), Subnet Administration (SA), Subnet + Management Packets (SMP) and other basic functions. + . + This package is needed to compile programs against libibmad5. + It contains the header files and static libraries (optionally) + needed for compiling. + +Package: libibnetdisc5 +Section: libs +Architecture: linux-any +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: InfiniBand diagnostics library + InfiniBand is a switched fabric communications link used in + high-performance computing and enterprise data centers. Its features + include high throughput, low latency, quality of service and + failover, and it is designed to be scalable. + . + This package provides libraries required by the InfiniBand + diagnostic programs. + +Package: libibnetdisc5-dbg +Section: libs +Architecture: linux-any +Depends: libibnetdisc5 (= ${binary:Version}), ${misc:Depends} +Description: InfiniBand diagnostics library + InfiniBand is a switched fabric communications link used in + high-performance computing and enterprise data centers. Its features + include high throughput, low latency, quality of service and + failover, and it is designed to be scalable. + . + This package contains the debug symbols associated with + libibnetdisc. They will automatically be used by gdb for debugging + libibnetdisc-related issues. + +Package: libibnetdisc-dev +Section: libdevel +Architecture: linux-any +Depends: libibnetdisc5 (= ${binary:Version}), ${misc:Depends} +Breaks: infiniband-diags (<< 2.0.0) +Replaces: infiniband-diags (<< 2.0.0) +Description: InfiniBand diagnostics library headers + InfiniBand is a switched fabric communications link used in + high-performance computing and enterprise data centers. Its features + include high throughput, low latency, quality of service and + failover, and it is designed to be scalable. + . + This package provides development files required to build + applications aginast the libibnetdisc5 InfiniBand diagnostic + libraries. diff --git a/debian/infiniband-diags.install b/debian/infiniband-diags.install new file mode 100644 index 00000000000000..5cbda3ae2d34f9 --- /dev/null +++ b/debian/infiniband-diags.install @@ -0,0 +1,64 @@ +etc/infiniband-diags/error_thresholds +etc/infiniband-diags/ibdiag.conf +usr/sbin/check_lft_balance +usr/sbin/dump_fts +usr/sbin/dump_lfts +usr/sbin/dump_mfts +usr/sbin/ibaddr +usr/sbin/ibcacheedit +usr/sbin/ibccconfig +usr/sbin/ibccquery +usr/sbin/ibfindnodesusing +usr/sbin/ibhosts +usr/sbin/ibidsverify +usr/sbin/iblinkinfo +usr/sbin/ibnetdiscover +usr/sbin/ibnodes +usr/sbin/ibping +usr/sbin/ibportstate +usr/sbin/ibqueryerrors +usr/sbin/ibroute +usr/sbin/ibrouters +usr/sbin/ibstat +usr/sbin/ibstatus +usr/sbin/ibswitches +usr/sbin/ibsysstat +usr/sbin/ibtracert +usr/sbin/perfquery +usr/sbin/saquery +usr/sbin/sminfo +usr/sbin/smpdump +usr/sbin/smpquery +usr/sbin/vendstat +usr/share/man/man8/check_lft_balance.8 +usr/share/man/man8/dump_fts.8 +usr/share/man/man8/dump_lfts.8 +usr/share/man/man8/dump_mfts.8 +usr/share/man/man8/ibaddr.8 +usr/share/man/man8/ibcacheedit.8 +usr/share/man/man8/ibccconfig.8 +usr/share/man/man8/ibccquery.8 +usr/share/man/man8/ibfindnodesusing.8 +usr/share/man/man8/ibhosts.8 +usr/share/man/man8/ibidsverify.8 +usr/share/man/man8/iblinkinfo.8 +usr/share/man/man8/ibnetdiscover.8 +usr/share/man/man8/ibnodes.8 +usr/share/man/man8/ibping.8 +usr/share/man/man8/ibportstate.8 +usr/share/man/man8/ibqueryerrors.8 +usr/share/man/man8/ibroute.8 +usr/share/man/man8/ibrouters.8 +usr/share/man/man8/ibstat.8 +usr/share/man/man8/ibstatus.8 +usr/share/man/man8/ibswitches.8 +usr/share/man/man8/ibsysstat.8 +usr/share/man/man8/ibtracert.8 +usr/share/man/man8/infiniband-diags.8 +usr/share/man/man8/perfquery.8 +usr/share/man/man8/saquery.8 +usr/share/man/man8/sminfo.8 +usr/share/man/man8/smpdump.8 +usr/share/man/man8/smpquery.8 +usr/share/man/man8/vendstat.8 +usr/share/perl5/IBswcountlimits.pm diff --git a/debian/libibmad-dev.install b/debian/libibmad-dev.install new file mode 100644 index 00000000000000..008365071fc15f --- /dev/null +++ b/debian/libibmad-dev.install @@ -0,0 +1,5 @@ +usr/include/infiniband/mad.h +usr/include/infiniband/mad_osd.h +usr/lib/*/libibmad*.a +usr/lib/*/libibmad*.so +usr/lib/*/pkgconfig/libibmad.pc diff --git a/debian/libibmad5.install b/debian/libibmad5.install new file mode 100644 index 00000000000000..d89b39373b8f79 --- /dev/null +++ b/debian/libibmad5.install @@ -0,0 +1 @@ +usr/lib/*/libibmad*.so.* diff --git a/debian/libibmad5.symbols b/debian/libibmad5.symbols new file mode 100644 index 00000000000000..c352e756edb39a --- /dev/null +++ b/debian/libibmad5.symbols @@ -0,0 +1,154 @@ +libibmad.so.5 libibmad5 #MINVER# + IBMAD_1.3@IBMAD_1.3 1.3.11 + bm_call_via@IBMAD_1.3 1.3.11 + cc_config_status_via@IBMAD_1.3 1.3.11 + cc_query_status_via@IBMAD_1.3 1.3.11 + drpath2str@IBMAD_1.3 1.3.11 + ib_node_query_via@IBMAD_1.3 1.3.11 + ib_path_query@IBMAD_1.3 1.3.11 + ib_path_query_via@IBMAD_1.3 1.3.11 + ib_resolve_gid_via@IBMAD_1.3 1.3.11 + ib_resolve_guid_via@IBMAD_1.3 1.3.11 + ib_resolve_portid_str@IBMAD_1.3 1.3.11 + ib_resolve_portid_str_via@IBMAD_1.3 1.3.11 + ib_resolve_self@IBMAD_1.3 1.3.11 + ib_resolve_self_via@IBMAD_1.3 1.3.11 + ib_resolve_smlid@IBMAD_1.3 1.3.11 + ib_resolve_smlid_via@IBMAD_1.3 1.3.11 + ib_vendor_call@IBMAD_1.3 1.3.11 + ib_vendor_call_via@IBMAD_1.3 1.3.11 + ibdebug@IBMAD_1.3 1.3.11 + mad_alloc@IBMAD_1.3 1.3.11 + mad_build_pkt@IBMAD_1.3 1.3.11 + mad_class_agent@IBMAD_1.3 1.3.11 + mad_decode_field@IBMAD_1.3 1.3.11 + mad_dump_array@IBMAD_1.3 1.3.11 + mad_dump_bitfield@IBMAD_1.3 1.3.11 + mad_dump_cc_cacongestionentry@IBMAD_1.3 1.3.11 + mad_dump_cc_cacongestionsetting@IBMAD_1.3 1.3.11 + mad_dump_cc_congestioncontroltable@IBMAD_1.3 1.3.11 + mad_dump_cc_congestioncontroltableentry@IBMAD_1.3 1.3.11 + mad_dump_cc_congestioninfo@IBMAD_1.3 1.3.11 + mad_dump_cc_congestionkeyinfo@IBMAD_1.3 1.3.11 + mad_dump_cc_congestionlog@IBMAD_1.3 1.3.11 + mad_dump_cc_congestionlogca@IBMAD_1.3 1.3.11 + mad_dump_cc_congestionlogentryca@IBMAD_1.3 1.3.11 + mad_dump_cc_congestionlogentryswitch@IBMAD_1.3 1.3.11 + mad_dump_cc_congestionlogswitch@IBMAD_1.3 1.3.11 + mad_dump_cc_switchcongestionsetting@IBMAD_1.3 1.3.11 + mad_dump_cc_switchportcongestionsettingelement@IBMAD_1.3 1.3.11 + mad_dump_cc_timestamp@IBMAD_1.3 1.3.11 + mad_dump_classportinfo@IBMAD_1.3 1.3.11 + mad_dump_field@IBMAD_1.3 1.3.11 + mad_dump_fields@IBMAD_1.3 1.3.11 + mad_dump_hex@IBMAD_1.3 1.3.11 + mad_dump_int@IBMAD_1.3 1.3.11 + mad_dump_linkdowndefstate@IBMAD_1.3 1.3.11 + mad_dump_linkspeed@IBMAD_1.3 1.3.11 + mad_dump_linkspeeden@IBMAD_1.3 1.3.11 + mad_dump_linkspeedext@IBMAD_1.3 1.3.11 + mad_dump_linkspeedexten@IBMAD_1.3 1.3.11 + mad_dump_linkspeedextsup@IBMAD_1.3 1.3.11 + mad_dump_linkspeedsup@IBMAD_1.3 1.3.11 + mad_dump_linkwidth@IBMAD_1.3 1.3.11 + mad_dump_linkwidthen@IBMAD_1.3 1.3.11 + mad_dump_linkwidthsup@IBMAD_1.3 1.3.11 + mad_dump_mlnx_ext_port_info@IBMAD_1.3 1.3.11 + mad_dump_mtu@IBMAD_1.3 1.3.11 + mad_dump_node_type@IBMAD_1.3 1.3.11 + mad_dump_nodedesc@IBMAD_1.3 1.3.11 + mad_dump_nodeinfo@IBMAD_1.3 1.3.11 + mad_dump_opervls@IBMAD_1.3 1.3.11 + mad_dump_perfcounters@IBMAD_1.3 1.3.11 + mad_dump_perfcounters_ext@IBMAD_1.3 1.3.11 + mad_dump_perfcounters_port_flow_ctl_counters@IBMAD_1.3 1.3.11 + mad_dump_perfcounters_port_op_rcv_counters@IBMAD_1.3 1.3.11 + mad_dump_perfcounters_port_vl_op_data@IBMAD_1.3 1.3.11 + mad_dump_perfcounters_port_vl_op_packet@IBMAD_1.3 1.3.11 + mad_dump_perfcounters_port_vl_xmit_flow_ctl_update_errors@IBMAD_1.3 1.3.11 + mad_dump_perfcounters_port_vl_xmit_wait_counters@IBMAD_1.3 1.3.11 + mad_dump_perfcounters_rcv_con_ctrl@IBMAD_1.3 1.3.11 + mad_dump_perfcounters_rcv_err@IBMAD_1.3 1.3.11 + mad_dump_perfcounters_rcv_sl@IBMAD_1.3 1.3.11 + mad_dump_perfcounters_sl_rcv_becn@IBMAD_1.3 1.3.11 + mad_dump_perfcounters_sl_rcv_fecn@IBMAD_1.3 1.3.11 + mad_dump_perfcounters_sw_port_vl_congestion@IBMAD_1.3 1.3.11 + mad_dump_perfcounters_vl_xmit_time_cong@IBMAD_1.3 1.3.11 + mad_dump_perfcounters_xmit_con_ctrl@IBMAD_1.3 1.3.11 + mad_dump_perfcounters_xmt_disc@IBMAD_1.3 1.3.11 + mad_dump_perfcounters_xmt_sl@IBMAD_1.3 1.3.11 + mad_dump_physportstate@IBMAD_1.3 1.3.11 + mad_dump_port_ext_speeds_counters@IBMAD_1.3 1.3.11 + mad_dump_port_ext_speeds_counters_rsfec_active@IBMAD_1.3 1.3.12 + mad_dump_portcapmask2@IBMAD_1.3 2.1.0 + mad_dump_portcapmask@IBMAD_1.3 1.3.11 + mad_dump_portinfo@IBMAD_1.3 1.3.11 + mad_dump_portinfo_ext@IBMAD_1.3 1.3.12 + mad_dump_portsamples_control@IBMAD_1.3 1.3.11 + mad_dump_portsamples_result@IBMAD_1.3 1.3.11 + mad_dump_portstate@IBMAD_1.3 1.3.11 + mad_dump_portstates@IBMAD_1.3 1.3.11 + mad_dump_rhex@IBMAD_1.3 1.3.11 + mad_dump_sltovl@IBMAD_1.3 1.3.11 + mad_dump_string@IBMAD_1.3 1.3.11 + mad_dump_switchinfo@IBMAD_1.3 1.3.11 + mad_dump_uint@IBMAD_1.3 1.3.11 + mad_dump_val@IBMAD_1.3 1.3.11 + mad_dump_vlarbitration@IBMAD_1.3 1.3.11 + mad_dump_vlcap@IBMAD_1.3 1.3.11 + mad_encode@IBMAD_1.3 1.3.11 + mad_encode_field@IBMAD_1.3 1.3.11 + mad_field_name@IBMAD_1.3 1.3.11 + mad_free@IBMAD_1.3 1.3.11 + mad_get_array@IBMAD_1.3 1.3.11 + mad_get_field64@IBMAD_1.3 1.3.11 + mad_get_field@IBMAD_1.3 1.3.11 + mad_get_retries@IBMAD_1.3 1.3.11 + mad_get_timeout@IBMAD_1.3 1.3.11 + mad_print_field@IBMAD_1.3 1.3.11 + mad_receive@IBMAD_1.3 1.3.11 + mad_receive_via@IBMAD_1.3 1.3.11 + mad_register_client@IBMAD_1.3 1.3.11 + mad_register_client_via@IBMAD_1.3 1.3.11 + mad_register_server@IBMAD_1.3 1.3.11 + mad_register_server_via@IBMAD_1.3 1.3.11 + mad_respond@IBMAD_1.3 1.3.11 + mad_respond_via@IBMAD_1.3 1.3.11 + mad_rpc@IBMAD_1.3 1.3.11 + mad_rpc_class_agent@IBMAD_1.3 1.3.11 + mad_rpc_close_port@IBMAD_1.3 1.3.11 + mad_rpc_open_port@IBMAD_1.3 1.3.11 + mad_rpc_portid@IBMAD_1.3 1.3.11 + mad_rpc_rmpp@IBMAD_1.3 1.3.11 + mad_rpc_set_retries@IBMAD_1.3 1.3.11 + mad_rpc_set_timeout@IBMAD_1.3 1.3.11 + mad_send@IBMAD_1.3 1.3.11 + mad_send_via@IBMAD_1.3 1.3.11 + mad_set_array@IBMAD_1.3 1.3.11 + mad_set_field64@IBMAD_1.3 1.3.11 + mad_set_field@IBMAD_1.3 1.3.11 + mad_trid@IBMAD_1.3 1.3.11 + madrpc@IBMAD_1.3 1.3.11 + madrpc_init@IBMAD_1.3 1.3.11 + madrpc_portid@IBMAD_1.3 1.3.11 + madrpc_rmpp@IBMAD_1.3 1.3.11 + madrpc_save_mad@IBMAD_1.3 1.3.11 + madrpc_set_retries@IBMAD_1.3 1.3.11 + madrpc_set_timeout@IBMAD_1.3 1.3.11 + madrpc_show_errors@IBMAD_1.3 1.3.11 + performance_reset_via@IBMAD_1.3 1.3.11 + pma_query_via@IBMAD_1.3 1.3.11 + portid2portnum@IBMAD_1.3 1.3.11 + portid2str@IBMAD_1.3 1.3.11 + sa_call@IBMAD_1.3 1.3.11 + sa_rpc_call@IBMAD_1.3 1.3.11 + smp_mkey_get@IBMAD_1.3 1.3.11 + smp_mkey_set@IBMAD_1.3 1.3.11 + smp_query@IBMAD_1.3 1.3.11 + smp_query_status_via@IBMAD_1.3 1.3.11 + smp_query_via@IBMAD_1.3 1.3.11 + smp_set@IBMAD_1.3 1.3.11 + smp_set_status_via@IBMAD_1.3 1.3.11 + smp_set_via@IBMAD_1.3 1.3.11 + str2drpath@IBMAD_1.3 1.3.11 + xdump@IBMAD_1.3 1.3.11 diff --git a/debian/libibnetdisc-dev.install b/debian/libibnetdisc-dev.install new file mode 100644 index 00000000000000..bd5f4c73b4f924 --- /dev/null +++ b/debian/libibnetdisc-dev.install @@ -0,0 +1,13 @@ +usr/include/infiniband/ibnetdisc* +usr/lib/*/libibnetdisc*.a +usr/lib/*/libibnetdisc*.so +usr/lib/*/pkgconfig/libibnetdisc.pc +usr/share/man/man3/ibnd_debug.3 +usr/share/man/man3/ibnd_destroy_fabric.3 +usr/share/man/man3/ibnd_discover_fabric.3 +usr/share/man/man3/ibnd_find_node_dr.3 +usr/share/man/man3/ibnd_find_node_guid.3 +usr/share/man/man3/ibnd_iter_nodes.3 +usr/share/man/man3/ibnd_iter_nodes_type.3 +usr/share/man/man3/ibnd_set_max_smps_on_wire.3 +usr/share/man/man3/ibnd_show_progress.3 diff --git a/debian/libibnetdisc5.install b/debian/libibnetdisc5.install new file mode 100644 index 00000000000000..54684fd3ccd9e3 --- /dev/null +++ b/debian/libibnetdisc5.install @@ -0,0 +1 @@ +usr/lib/*/libibnetdisc*.so.* diff --git a/debian/libibnetdisc5.symbols b/debian/libibnetdisc5.symbols new file mode 100644 index 00000000000000..ec8429c03c6b7d --- /dev/null +++ b/debian/libibnetdisc5.symbols @@ -0,0 +1,20 @@ +libibnetdisc.so.5 libibnetdisc5 #MINVER# + IBNETDISC_1.0@IBNETDISC_1.0 1.6.1 + ibnd_cache_fabric@IBNETDISC_1.0 1.6.1 + ibnd_destroy_fabric@IBNETDISC_1.0 1.6.1 + ibnd_discover_fabric@IBNETDISC_1.0 1.6.1 + ibnd_find_node_dr@IBNETDISC_1.0 1.6.1 + ibnd_find_node_guid@IBNETDISC_1.0 1.6.1 + ibnd_find_port_dr@IBNETDISC_1.0 1.6.1 + ibnd_find_port_guid@IBNETDISC_1.0 1.6.1 + ibnd_find_port_lid@IBNETDISC_1.0 1.6.4 + ibnd_get_chassis_guid@IBNETDISC_1.0 1.6.1 + ibnd_get_chassis_slot_str@IBNETDISC_1.0 1.6.1 + ibnd_get_chassis_type@IBNETDISC_1.0 1.6.1 + ibnd_is_xsigo_guid@IBNETDISC_1.0 1.6.1 + ibnd_is_xsigo_hca@IBNETDISC_1.0 1.6.1 + ibnd_is_xsigo_tca@IBNETDISC_1.0 1.6.1 + ibnd_iter_nodes@IBNETDISC_1.0 1.6.1 + ibnd_iter_nodes_type@IBNETDISC_1.0 1.6.1 + ibnd_iter_ports@IBNETDISC_1.0 1.6.1 + ibnd_load_fabric@IBNETDISC_1.0 1.6.1 diff --git a/debian/rules b/debian/rules index 744bf28c52f070..07c9c145ff090c 100755 --- a/debian/rules +++ b/debian/rules @@ -35,8 +35,8 @@ DH_AUTO_CONFIGURE := "--" \ "-DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=/var/lib" \ "-DCMAKE_INSTALL_RUNDIR:PATH=/run" \ "-DCMAKE_INSTALL_UDEV_RULESDIR:PATH=/lib/udev/rules.d" \ + "-DCMAKE_INSTALL_PERLDIR:PATH=/usr/share/perl5" \ "-DENABLE_STATIC=1" \ - "-DWITH_IBDIAGS:BOOL=False" \ $(EXTRA_CMAKE_FLAGS) override_dh_auto_configure: @@ -99,6 +99,8 @@ override_dh_makeshlibs: dh_makeshlibs $(SHLIBS_EXCLUDE) override_dh_strip: + dh_strip -plibibmad5 --dbg-package=libibmad5-dbg + dh_strip -plibibnetdisc5 --dbg-package=libibnetdisc5-dbg dh_strip -plibibumad3 --dbg-package=libibumad3-dbg dh_strip -plibibverbs1 --dbg-package=libibverbs1-dbg dh_strip -plibrdmacm1 --dbg-package=librdmacm1-dbg From patchwork Tue May 14 23:49:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10944093 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C8531515 for ; Tue, 14 May 2019 23:49:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5AD35288DA for ; Tue, 14 May 2019 23:49:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F67F28984; Tue, 14 May 2019 23:49:45 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 A0A61289A3 for ; Tue, 14 May 2019 23:49:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726383AbfENXtn (ORCPT ); Tue, 14 May 2019 19:49:43 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:42918 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726281AbfENXtn (ORCPT ); Tue, 14 May 2019 19:49:43 -0400 Received: by mail-qk1-f195.google.com with SMTP id d4so387249qkc.9 for ; Tue, 14 May 2019 16:49:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4st1/ft9+Etz/+zCC0IqUInccA6rB4kgtjxpZOOg6w4=; b=SQQkpjqc5sT22460lsHOUwmM3qXsc9tybmClro0CR1JuxcbeMhron4RZIut2xg0Ocx v8OliJbfo8AMHGrmI2hSMFkMEge+sufnDP14H0IVAjT1vkTwkG5sO1To5IVYAVp9s2Cz w1YlKTagL8INRGGVKrahRq4lrGY/nRPsXRc2BUX9K0mRHXBlIiq8yu4YkyQmDpJuGX+u lkUWgNtV0kjMXSg1UM4leBOz6QoOsOk/GBaQ9fN9wE1yxBu6Syeu9lXbQ1hX67rG6Cyu +KHnhlsSUN1ZXZ7lhLKKSFI8j3sssAgzJCmPaQYzFwIgQAqdng/AM6aFehjDREHO7JVa 9jmw== 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:mime-version:content-transfer-encoding; bh=4st1/ft9+Etz/+zCC0IqUInccA6rB4kgtjxpZOOg6w4=; b=SlbrLbd7K1qjyfZWw5Jq6FnEjEa9m5n/psqlrYlYV8aMrosbFSQ62yI2IwOWKgxt9+ Ptb/bhVR/6ysGNvCAyr4kMt49d1Vb6zLkDz5NXeCEGWTth7JtZ3E9hH0G0zzJcgoS5L3 OQDIkBLhEHmtJwQrdqh1EsrOOlhhWxRAx+u53vO1IWko+sD6OHJNEAk2JjmsPGtAs8hz uoqRqf5zPema1ymNngaO3fN3CeLH7w+7YUYjSf/24ouoLKFAY345/NqqxBVclrDmOyeR WN//7dbcVkOPPqllyTR1busN5eCj3Wgj8XbHn2CpgSzRYIUAGQa59Js3kh9afEiYpg4l SwRA== X-Gm-Message-State: APjAAAWLKDQBzhkh3ALYfayxJdpq1RbMCB0YBrZoBixj4TKDC/AgnMqb l2et5sCRTNlmKnrYlXGkehkJNi6WMBs= X-Google-Smtp-Source: APXvYqzM3HplL45GhqX+FNxEzMBo1zup1vvF8QTon9r2HGATw4tBodnoxAGnz+RQoQ0x2iE3QsMMfA== X-Received: by 2002:ae9:f70d:: with SMTP id s13mr30891683qkg.213.1557877781632; Tue, 14 May 2019 16:49:41 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id n190sm118622qkb.83.2019.05.14.16.49.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 16:49:40 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hQhAx-0001Nn-6F; Tue, 14 May 2019 20:49:39 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 12/20] ibdiags: Add Fedora packaging Date: Tue, 14 May 2019 20:49:28 -0300 Message-Id: <20190514234936.5175-13-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514234936.5175-1-jgg@ziepe.ca> References: <20190514234936.5175-1-jgg@ziepe.ca> MIME-Version: 1.0 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: Jason Gunthorpe This is copied from the FC30 spec file with infiniband-diags-devel rolled into rdma-core-devel. Signed-off-by: Jason Gunthorpe --- redhat/rdma-core.spec | 143 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 142 insertions(+), 1 deletion(-) diff --git a/redhat/rdma-core.spec b/redhat/rdma-core.spec index 29bf26531c97ab..72a05e58eda279 100644 --- a/redhat/rdma-core.spec +++ b/redhat/rdma-core.spec @@ -82,6 +82,11 @@ Obsoletes: librdmacm-devel < %{version}-%{release} Requires: ibacm = %{version}-%{release} Provides: ibacm-devel = %{version}-%{release} Obsoletes: ibacm-devel < %{version}-%{release} +Requires: infiniband-diags = %{version}-%{release} +Provides: infiniband-diags-devel = %{version}-%{release} +Obsoletes: infiniband-diags-devel < %{version}-%{release} +Provides: libibmad-devel = %{version}-%{release} +Obsoletes: libibmad-devel < %{version}-%{release} %if %{with_static} # Since our pkg-config files include private references to these packages they # need to have their .pc files installed too, even for dynamic linking, or @@ -93,6 +98,27 @@ BuildRequires: pkgconfig(libnl-route-3.0) %description devel RDMA core development libraries and headers. +%package -n infiniband-diags +Summary: InfiniBand Diagnostic Tools +Provides: perl(IBswcountlimits) +Provides: libibmad = %{version}-%{release} +Obsoletes: libibmad < %{version}-%{release} +Obsoletes: openib-diags < 1.3 + +%description -n infiniband-diags +This package provides IB diagnostic programs and scripts needed to diagnose an +IB subnet. infiniband-diags now also provides libibmad. libibmad provides +low layer IB functions for use by the IB diagnostic and management +programs. These include MAD, SA, SMP, and other basic IB functions. + +%package -n infiniband-diags-compat +Summary: OpenFabrics Alliance InfiniBand Diagnostic Tools + +%description -n infiniband-diags-compat +Deprecated scripts and utilities which provide duplicated functionality, most +often at a reduced performance. These are maintained for the time being for +compatibility reasons. + %package -n libibverbs Summary: A library and drivers for direct userspace use of RDMA (InfiniBand/iWARP/RoCE) hardware Requires(post): /sbin/ldconfig @@ -259,7 +285,8 @@ easy, object-oriented access to IB verbs. -DCMAKE_INSTALL_RUNDIR:PATH=%{_rundir} \ -DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir}/%{name}-%{version} \ -DCMAKE_INSTALL_UDEV_RULESDIR:PATH=%{_udevrulesdir} \ - -DWITH_IBDIAGS:BOOL=False \ + -DCMAKE_INSTALL_PERLDIR:PATH=%{perl_vendorlib} \ + -DWITH_IBDIAGS_COMPAT:BOOL=True \ %if %{with_static} -DENABLE_STATIC=1 \ %endif @@ -307,6 +334,10 @@ install -D -m0644 ibacm_opts.cfg %{buildroot}%{_sysconfdir}/rdma/ rm -rf %{buildroot}/%{_initrddir}/ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh +# infiniband-diags +%post -n infiniband-diags -p /sbin/ldconfig +%postun -n infiniband-diags -p /sbin/ldconfig + # libibverbs %post -n libibverbs -p /sbin/ldconfig %postun -n libibverbs -p /sbin/ldconfig @@ -407,6 +438,116 @@ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh %{_mandir}/man3/mlx4dv* %{_mandir}/man7/mlx5dv* %{_mandir}/man7/mlx4dv* +%{_mandir}/man3/ibnd_* + +%files -n infiniband-diags-compat +%{_sbindir}/ibcheckerrs +%{_mandir}/man8/ibcheckerrs* +%{_sbindir}/ibchecknet +%{_mandir}/man8/ibchecknet* +%{_sbindir}/ibchecknode +%{_mandir}/man8/ibchecknode* +%{_sbindir}/ibcheckport +%{_mandir}/man8/ibcheckport.* +%{_sbindir}/ibcheckportwidth +%{_mandir}/man8/ibcheckportwidth* +%{_sbindir}/ibcheckportstate +%{_mandir}/man8/ibcheckportstate* +%{_sbindir}/ibcheckwidth +%{_mandir}/man8/ibcheckwidth* +%{_sbindir}/ibcheckstate +%{_mandir}/man8/ibcheckstate* +%{_sbindir}/ibcheckerrors +%{_mandir}/man8/ibcheckerrors* +%{_sbindir}/ibdatacounts +%{_mandir}/man8/ibdatacounts* +%{_sbindir}/ibdatacounters +%{_mandir}/man8/ibdatacounters* +%{_sbindir}/ibdiscover.pl +%{_mandir}/man8/ibdiscover* +%{_sbindir}/ibswportwatch.pl +%{_mandir}/man8/ibswportwatch* +%{_sbindir}/ibqueryerrors.pl +%{_sbindir}/iblinkinfo.pl +%{_sbindir}/ibprintca.pl +%{_mandir}/man8/ibprintca* +%{_sbindir}/ibprintswitch.pl +%{_mandir}/man8/ibprintswitch* +%{_sbindir}/ibprintrt.pl +%{_mandir}/man8/ibprintrt* +%{_sbindir}/set_nodedesc.sh + +%files -n infiniband-diags +%{_sbindir}/ibaddr +%{_mandir}/man8/ibaddr* +%{_sbindir}/ibnetdiscover +%{_mandir}/man8/ibnetdiscover* +%{_sbindir}/ibping +%{_mandir}/man8/ibping* +%{_sbindir}/ibportstate +%{_mandir}/man8/ibportstate* +%{_sbindir}/ibroute +%{_mandir}/man8/ibroute.* +%{_sbindir}/ibstat +%{_mandir}/man8/ibstat.* +%{_sbindir}/ibsysstat +%{_mandir}/man8/ibsysstat* +%{_sbindir}/ibtracert +%{_mandir}/man8/ibtracert* +%{_sbindir}/perfquery +%{_mandir}/man8/perfquery* +%{_sbindir}/sminfo +%{_mandir}/man8/sminfo* +%{_sbindir}/smpdump +%{_mandir}/man8/smpdump* +%{_sbindir}/smpquery +%{_mandir}/man8/smpquery* +%{_sbindir}/saquery +%{_mandir}/man8/saquery* +%{_sbindir}/vendstat +%{_mandir}/man8/vendstat* +%{_sbindir}/iblinkinfo +%{_mandir}/man8/iblinkinfo* +%{_sbindir}/ibqueryerrors +%{_mandir}/man8/ibqueryerrors* +%{_sbindir}/ibcacheedit +%{_mandir}/man8/ibcacheedit* +%{_sbindir}/ibccquery +%{_mandir}/man8/ibccquery* +%{_sbindir}/ibccconfig +%{_mandir}/man8/ibccconfig* +%{_sbindir}/dump_fts +%{_mandir}/man8/dump_fts* +%{_sbindir}/ibhosts +%{_mandir}/man8/ibhosts* +%{_sbindir}/ibswitches +%{_mandir}/man8/ibswitches* +%{_sbindir}/ibnodes +%{_mandir}/man8/ibnodes* +%{_sbindir}/ibrouters +%{_mandir}/man8/ibrouters* +%{_sbindir}/ibfindnodesusing.pl +%{_mandir}/man8/ibfindnodesusing* +%{_sbindir}/ibidsverify.pl +%{_mandir}/man8/ibidsverify* +%{_sbindir}/check_lft_balance.pl +%{_mandir}/man8/check_lft_balance* +%{_sbindir}/dump_lfts.sh +%{_mandir}/man8/dump_lfts* +%{_sbindir}/dump_mfts.sh +%{_mandir}/man8/dump_mfts* +%{_sbindir}/ibclearerrors +%{_mandir}/man8/ibclearerrors* +%{_sbindir}/ibclearcounters +%{_mandir}/man8/ibclearcounters* +%{_sbindir}/ibstatus +%{_mandir}/man8/ibstatus* +%{_mandir}/man8/infiniband-diags* +%{_libdir}/libibmad*.so.* +%{_libdir}/libibnetdisc*.so.* +%{perl_vendorlib}/IBswcountlimits.pm +%config(noreplace) %{_sysconfdir}/infiniband-diags/error_thresholds +%config(noreplace) %{_sysconfdir}/infiniband-diags/ibdiag.conf %files -n libibverbs %dir %{_sysconfdir}/libibverbs.d From patchwork Tue May 14 23:49:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10944097 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E845A1398 for ; Tue, 14 May 2019 23:49:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D719D288DA for ; Tue, 14 May 2019 23:49:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB4F92898B; Tue, 14 May 2019 23:49:46 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 20357288DA for ; Tue, 14 May 2019 23:49:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726369AbfENXto (ORCPT ); Tue, 14 May 2019 19:49:44 -0400 Received: from mail-qk1-f174.google.com ([209.85.222.174]:39130 "EHLO mail-qk1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726461AbfENXtn (ORCPT ); Tue, 14 May 2019 19:49:43 -0400 Received: by mail-qk1-f174.google.com with SMTP id z128so398227qkb.6 for ; Tue, 14 May 2019 16:49:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/EbjoA80E7TwbBGI5fHJ/wmV814+rYmSj5+48yVgSYA=; b=Vxmql7AqsYfTJcpfG3Kl1JbqWXd1a3ZD24Z+Vb6HP48oHCKHUdPGKd7ZS37/NN79AT Y1HpzBm8wIN0QZCqQfMjrKUds6ftjtNx2GQXZEvRI74UvugDniwZBBsOeLk593BrS6vN 5dzk3r0ByMTN203UAwwgm6syGpCiSpLiq1GHbcLrsvZXTEzMZRYV4O2bb69GUO5bWasR n5gezFyGABXNKo/6LSxJttenCEzn0qFGED6Hi2MBY5etOOYoIqf6VENXPD4YTGoOprAq ioknDuOq80H469ibUsZn4K2W/cnd+oV0wUo3YTS0kyJ6mY6frs6NJndXGsPHK8lINq6c FKIA== 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:mime-version:content-transfer-encoding; bh=/EbjoA80E7TwbBGI5fHJ/wmV814+rYmSj5+48yVgSYA=; b=i+66GXwBTNnA6dp0esodG47OkrLqv1NMsW/TQxkrJK16P4MGlGbwqcK7c3oQwkt/KD bxgaDzXoKGMAybPPv1Y0+UiDrkfOJQKf2lsro0MR04hVpoHMGsBFyxwChn1Yn9ZV3gPB 5wJhWgyXlfdesTYq2f0Ts40728YQYGKcLB+NUK6VLqXf0bJRkt7RwZMqoJE0/ay1dx1A cNCJmjC58AZ4vALHlnvwAdzjOL8ZiMu9R3xicn855yjKBpuUxDdEJHTVntpHH8RmKWib e29x1FzBkH6NymNTREkmCp2+30+80zblUIV8AQWmUSoOJrJLpFVe1qSbURS9fo3vrij0 uUWQ== X-Gm-Message-State: APjAAAXkKUWp3eQAsP287lLyCs/aVbqtL9S7XTL8rEScTcDUgCzJN8Pn 4FR4SrYvqNWtvxfcUM3+xelBAoaqANE= X-Google-Smtp-Source: APXvYqz4qXmgIcqiKOsFQXqPeR4DEZLYKU+G8u0Qda103RHbvPXExmL2q5cF/UDVvYqKlc8vIqajjg== X-Received: by 2002:a37:9e44:: with SMTP id h65mr17476032qke.196.1557877782430; Tue, 14 May 2019 16:49:42 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id s7sm142916qkg.70.2019.05.14.16.49.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 16:49:40 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hQhAx-0001Nu-8Q; Tue, 14 May 2019 20:49:39 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 13/20] ibdiags: Add suse packaging Date: Tue, 14 May 2019 20:49:29 -0300 Message-Id: <20190514234936.5175-14-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514234936.5175-1-jgg@ziepe.ca> References: <20190514234936.5175-1-jgg@ziepe.ca> MIME-Version: 1.0 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: Jason Gunthorpe This is copied from the Factor spec file (rev 10) with infiniband-diags-devel rolled into rdma-core-devel. Signed-off-by: Jason Gunthorpe --- CMakeLists.txt | 6 --- suse/rdma-core.spec | 116 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 115 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e16b955991558a..fd9355787291c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,8 +45,6 @@ # -DNO_PYVERBS=1 (default, build pyverbs) # Invoke cython to build pyverbs. Usually you will run with this option # is set, but it will be disabled for travis runs. -# -DWITH_IBDIAGS=False (default True) -# Do not build infiniband-diags components # -DWITH_IBDIAGS_COMPAT=True (default False) # Include obsolete scripts. These scripts are replaced by C programs with # a different interface now. @@ -160,8 +158,6 @@ endif() set(DISTRO_FLAVOUR "None" CACHE STRING "Flavour of distribution to install for. This primarily impacts the init.d scripts installed.") -set(WITH_IBDIAGS "True" CACHE BOOL "Build infiniband-diags stuff too") - #------------------------- # Load CMake components set(BUILDLIB "${CMAKE_SOURCE_DIR}/buildlib") @@ -621,7 +617,6 @@ add_subdirectory(providers/ipathverbs) add_subdirectory(providers/rxe) add_subdirectory(providers/rxe/man) -if (WITH_IBDIAGS) add_subdirectory(ibdiags/libibmad/src) add_subdirectory(ibdiags/libibnetdisc/src) add_subdirectory(ibdiags/libibnetdisc/man) @@ -629,7 +624,6 @@ add_subdirectory(ibdiags/src) add_subdirectory(ibdiags/scripts) add_subdirectory(ibdiags/man) add_subdirectory(ibdiags/doc/rst) -endif() if (CYTHON_EXECUTABLE) add_subdirectory(pyverbs) diff --git a/suse/rdma-core.spec b/suse/rdma-core.spec index c0d4922658cb6a..a4614646fb2de9 100644 --- a/suse/rdma-core.spec +++ b/suse/rdma-core.spec @@ -34,6 +34,8 @@ Group: Productivity/Networking/Other %define umad_so_major 3 %define mlx4_so_major 1 %define mlx5_so_major 1 +%define ibnetdisc_major 5 +%define mad_major 5 %define verbs_lname libibverbs%{verbs_so_major} %define rdmacm_lname librdmacm%{rdmacm_so_major} @@ -160,6 +162,10 @@ BuildRequires: pkgconfig(libnl-3.0) BuildRequires: pkgconfig(libnl-route-3.0) %endif +Requires: infiniband-diags = %{version}-%{release} +Provides: infiniband-diags-devel = %{version}-%{release} +Obsoletes: infiniband-diags-devel < %{version}-%{release} + %description devel RDMA core development libraries and headers. @@ -232,6 +238,14 @@ Group: System/Libraries %description -n %mlx5_lname This package contains the mlx5 runtime library. +%package -n libibnetdisc%{ibnetdisc_major} +Summary: Infiniband Net Discovery runtime library +Group: System/Libraries + +%description -n libibnetdisc%{ibnetdisc_major} +This package contains the Infiniband Net Discovery runtime library needed +mainly by infiniband-diags. + %package -n libibverbs-utils Summary: Examples for the libibverbs library Group: Productivity/Networking/Other @@ -259,6 +273,23 @@ user applications need not know about this daemon as long as their app uses librdmacm to handle connection bring up/tear down. The librdmacm library knows how to talk directly to the ibacm daemon to retrieve data. +%package -n infiniband-diags +Summary: InfiniBand Diagnostic Tools +Group: Productivity/Networking/Diagnostic + +%description -n infiniband-diags +diags provides IB diagnostic programs and scripts needed to diagnose an +IB subnet. + +%package -n libibmad%{mad_major} +Summary: Libibmad runtime library +Group: System/Libraries + +%description -n libibmad%{mad_major} +Libibmad provides low layer IB functions for use by the IB diagnostic +and management programs. These include MAD, SA, SMP, and other basic IB +functions. This package contains the runtime library. + %package -n iwpmd Summary: Userspace iWarp Port Mapper daemon Group: Development/Libraries/C and C++ @@ -372,7 +403,7 @@ easy, object-oriented access to IB verbs. -DCMAKE_INSTALL_RUNDIR:PATH=%{_rundir} \ -DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir}/%{name}-%{version} \ -DCMAKE_INSTALL_UDEV_RULESDIR:PATH=%{_udevrulesdir} \ - -DWITH_IBDIAGS:BOOL=False \ + -DCMAKE_INSTALL_PERLDIR:PATH=%{perl_vendorlib} \ %if %{with_static} -DENABLE_STATIC=1 \ %endif @@ -444,6 +475,12 @@ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh %post -n %rdmacm_lname -p /sbin/ldconfig %postun -n %rdmacm_lname -p /sbin/ldconfig +%post -n libibnetdisc%{ibnetdisc_major} -p /sbin/ldconfig +%postun -n libibnetdisc%{ibnetdisc_major} -p /sbin/ldconfig + +%post -n libibmad%{mad_major} -p /sbin/ldconfig +%postun -n libibmad%{mad_major} -p /sbin/ldconfig + %post # we ship udev rules, so trigger an update. /sbin/udevadm trigger --subsystem-match=infiniband --action=change || true @@ -567,6 +604,7 @@ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh %endif %{_libdir}/lib*.so %{_libdir}/pkgconfig/*.pc +%{_mandir}/man3/ibnd_* %{_mandir}/man3/ibv_* %{_mandir}/man3/rdma* %{_mandir}/man3/umad* @@ -592,6 +630,14 @@ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh %{_mandir}/man7/rxe* %{_mandir}/man8/rxe* +%files -n libibnetdisc%{ibnetdisc_major} +%defattr(-, root, root) +%{_libdir}/libibnetdisc.so.* + +%files -n libibmad%{mad_major} +%defattr(-, root, root) +%{_libdir}/libibmad.so.* + %files -n %verbs_lname %defattr(-,root,root) %{_libdir}/libibverbs*.so.* @@ -627,6 +673,74 @@ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh %{_sbindir}/rcibacm %doc %{_docdir}/%{name}-%{version}/ibacm.md +%files -n infiniband-diags +%defattr(-, root, root) +%config %{_sysconfdir}/infiniband-diags/error_thresholds +%dir %{_sysconfdir}/infiniband-diags +%config(noreplace) %{_sysconfdir}/infiniband-diags/* +%{_sbindir}/ibaddr +%{_mandir}/man8/ibaddr* +%{_sbindir}/ibnetdiscover +%{_mandir}/man8/ibnetdiscover* +%{_sbindir}/ibping +%{_mandir}/man8/ibping* +%{_sbindir}/ibportstate +%{_mandir}/man8/ibportstate* +%{_sbindir}/ibroute +%{_mandir}/man8/ibroute.* +%{_sbindir}/ibstat +%{_mandir}/man8/ibstat.* +%{_sbindir}/ibsysstat +%{_mandir}/man8/ibsysstat* +%{_sbindir}/ibtracert +%{_mandir}/man8/ibtracert* +%{_sbindir}/perfquery +%{_mandir}/man8/perfquery* +%{_sbindir}/sminfo +%{_mandir}/man8/sminfo* +%{_sbindir}/smpdump +%{_mandir}/man8/smpdump* +%{_sbindir}/smpquery +%{_mandir}/man8/smpquery* +%{_sbindir}/saquery +%{_mandir}/man8/saquery* +%{_sbindir}/vendstat +%{_mandir}/man8/vendstat* +%{_sbindir}/iblinkinfo +%{_mandir}/man8/iblinkinfo* +%{_sbindir}/ibqueryerrors +%{_mandir}/man8/ibqueryerrors* +%{_sbindir}/ibcacheedit +%{_mandir}/man8/ibcacheedit* +%{_sbindir}/ibccquery +%{_mandir}/man8/ibccquery* +%{_sbindir}/ibccconfig +%{_mandir}/man8/ibccconfig* +%{_sbindir}/dump_fts +%{_mandir}/man8/dump_fts* +%{_sbindir}/ibhosts +%{_mandir}/man8/ibhosts* +%{_sbindir}/ibswitches +%{_mandir}/man8/ibswitches* +%{_sbindir}/ibnodes +%{_mandir}/man8/ibnodes* +%{_sbindir}/ibrouters +%{_mandir}/man8/ibrouters* +%{_sbindir}/ibfindnodesusing.pl +%{_mandir}/man8/ibfindnodesusing* +%{_sbindir}/ibidsverify.pl +%{_mandir}/man8/ibidsverify* +%{_sbindir}/check_lft_balance.pl +%{_mandir}/man8/check_lft_balance* +%{_sbindir}/dump_lfts.sh +%{_mandir}/man8/dump_lfts* +%{_sbindir}/dump_mfts.sh +%{_mandir}/man8/dump_mfts* +%{_sbindir}/ibstatus +%{_mandir}/man8/ibstatus* +%{_mandir}/man8/infiniband-diags* +%{perl_vendorlib}/IBswcountlimits.pm + %files -n iwpmd %defattr(-,root,root) %dir %{_sysconfdir}/rdma From patchwork Tue May 14 23:49:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10944121 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D7351390 for ; Wed, 15 May 2019 00:11:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D32F288CA for ; Wed, 15 May 2019 00:11:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 61CD2289D0; Wed, 15 May 2019 00:11: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 E2CD6288CA for ; Wed, 15 May 2019 00:11:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726783AbfEOALN (ORCPT ); Tue, 14 May 2019 20:11:13 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:42919 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726791AbfEOALM (ORCPT ); Tue, 14 May 2019 20:11:12 -0400 Received: by mail-qk1-f193.google.com with SMTP id d4so414296qkc.9 for ; Tue, 14 May 2019 17:11:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nNqDgtCqZVyfQ2EwawOl6xMn4dWOVkWKcnC+Xx6E71M=; b=TVRd076zGXN3z5268XQYt7cj3ohCmHQUXMNAVbzASa8sLpzCW5QYbcTZ3iN7586Yil r5hAl1mcMH0ooJ17FsXC/RdTCoQ92UME2GFTs4vWxiwpwXuml1LKT5dHqNDjfqFPxfLV gEaxwPG1phBnH+1siXJVaBAlx6aaUxjnhMNkxTrXCf2qRsIj2OKnoNdjBvArcjH9ckKH CF2BEDYfECEuPjl9D+SYMCv1QPknRgnnke3Nyy+PNngJqdK6FFEud/SceHQ1JsvnQRhd 6ez6t7MyBX7IPAkALX4uq2bQ6Toqfy8tzK3Hj506r1+91H1j94kD7ZORVCE8BgcjP+Sp sHfA== 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:mime-version:content-transfer-encoding; bh=nNqDgtCqZVyfQ2EwawOl6xMn4dWOVkWKcnC+Xx6E71M=; b=JJkVAuCFtEFswZvA5pDJpm0TyL0IZVMeYH3fCMuQya/YLNhE/856m6U6rxqEcr0zpY zr155sDlLpmEBa6SgMYSaKG/tusPkbVC5NDTaMkGBeWEwfu1SZhTZOuTBFi1wci5LPvR KyHpvmqQBCI4Wlyw1av+E4xiQXvwLDD0j3JS0DUzzZ2QqmSGD+FmdEciVPRiTaiF85XS 5gtPYN7jGtSqu4zByHaGAgAGwwTobDKjkibeMCNYTpwkOZD1SyMquJnkzmVytruwY11w IRvYxf9BmuruPQi8/IBopq747sKBEplkypMzeJFkw1y5yxFQasJGFoREu2drVi5bJYwp WDSg== X-Gm-Message-State: APjAAAVtAxpaHDQWebdPjR5hWQRLxazJgkBjYxe8xs1DXuaFmFuErBEj USfO0kWLcNEWRNp84IotIfzwaqq0RlE= X-Google-Smtp-Source: APXvYqwK1QHqdm3PoO2yrHjJjOBaXFqsUFYXSBeAR2Pr5bTBxWFSt2ZAB3bp2sc9W4qXhfBsNs0qAA== X-Received: by 2002:a37:6c84:: with SMTP id h126mr31564946qkc.168.1557879071517; Tue, 14 May 2019 17:11:11 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id o10sm249584qtg.5.2019.05.14.17.11.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 17:11:11 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hQhAx-0001O0-9Y; Tue, 14 May 2019 20:49:39 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 14/20] ibdiags: Obsolete mad_osd.h Date: Tue, 14 May 2019 20:49:30 -0300 Message-Id: <20190514234936.5175-15-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514234936.5175-1-jgg@ziepe.ca> References: <20190514234936.5175-1-jgg@ziepe.ca> MIME-Version: 1.0 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: Jason Gunthorpe No need for this public header included in only one place with definitions that should not even exist in the public namespace. Signed-off-by: Jason Gunthorpe --- ibdiags/libibmad/include/infiniband/mad.h | 13 ++++- ibdiags/libibmad/include/infiniband/mad_osd.h | 50 +------------------ 2 files changed, 13 insertions(+), 50 deletions(-) diff --git a/ibdiags/libibmad/include/infiniband/mad.h b/ibdiags/libibmad/include/infiniband/mad.h index c95f1b10d08610..b36544988bfafd 100644 --- a/ibdiags/libibmad/include/infiniband/mad.h +++ b/ibdiags/libibmad/include/infiniband/mad.h @@ -35,7 +35,18 @@ #ifndef _MAD_H_ #define _MAD_H_ -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MAD_EXPORT +#define DEPRECATED __attribute__ ((deprecated)) #ifdef __cplusplus # define BEGIN_C_DECLS extern "C" { diff --git a/ibdiags/libibmad/include/infiniband/mad_osd.h b/ibdiags/libibmad/include/infiniband/mad_osd.h index 923be55ef95c93..061001bb8f82a6 100644 --- a/ibdiags/libibmad/include/infiniband/mad_osd.h +++ b/ibdiags/libibmad/include/infiniband/mad_osd.h @@ -1,49 +1 @@ -/* - * Copyright (c) 2004-2009 Voltaire Inc. All rights reserved. - * - * This software is available to you under a choice of one of two - * licenses. You may choose to be licensed under the terms of the GNU - * General Public License (GPL) Version 2, available from the file - * COPYING in the main directory of this source tree, or the - * OpenIB.org BSD license below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */ -#ifndef _MAD_OSD_H_ -#define _MAD_OSD_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define MAD_EXPORT -#define DEPRECATED __attribute__ ((deprecated)) - -#endif /* _MAD_OSD_H_ */ +#warning "This header is obsolete." From patchwork Tue May 14 23:49:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10944095 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3556F1398 for ; Tue, 14 May 2019 23:49:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 255A828984 for ; Tue, 14 May 2019 23:49:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 19B6428987; Tue, 14 May 2019 23:49:46 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 7B1DA288DA for ; Tue, 14 May 2019 23:49:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726551AbfENXto (ORCPT ); Tue, 14 May 2019 19:49:44 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:33725 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726369AbfENXtn (ORCPT ); Tue, 14 May 2019 19:49:43 -0400 Received: by mail-qt1-f195.google.com with SMTP id m32so1264873qtf.0 for ; Tue, 14 May 2019 16:49:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lzSIqDVC7ycp73isxoAWHpxWlD5Mj5pY3gG903i5ZCI=; b=Q8l/4PPKGXWhFgNYvrbbqplFRUwaHlgCng4NZnjaYYLAmozW506pYNws4nGB+S4WDK onDMqcZQ+W+EI1GXT4BnPt2BUj240btfELnaLcJbz6iSD7JHLWVOKG9Tbsa+UW8mkfxa z2/Jc43kkAHqhJ9F39cDCd3T5gdEokUk8Jb8j7mRwRZYY3jFZ/nabi114+04i1HUz+vo aULUAX9S63Mtc5/hJLk9LXxZYG483My/WE0RzKJwL0v0OhVXPnCO4r+df4f5sBM/7u3N x6nOrxHrVcNeUGMoASg6TqmmzkjmMPcZpln9VQfxzJ8OE+ti2L1nSPmE6nQsqpNahlnh NEYA== 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:mime-version:content-transfer-encoding; bh=lzSIqDVC7ycp73isxoAWHpxWlD5Mj5pY3gG903i5ZCI=; b=CR9Fu4o56tP6CQRtI8ytd/kvvXXok8tgnPA+J3M3ykpgJzjO5tuVFicO+/gejsGaJZ RxcJ7wS4uW2dsOJExL/UElBsbzkwsEnvFT4q+zCetdXyjPVR2OvErBbnp7gUDQlqWRya IHdPLnKNkgWY+IZntmXH7jx7PmX2XvLPQdV9PMiVFGJi/+Y5w2hQm+Ayj+kxjdeKErYK v0RfotgmRdxf3LP5+4wk46H5uZRQi8QMKx7QmLAQKsbpBy0v+qcnlGKfnOOO5UDgvQqr O8oB2rQ9LMHVb5Bip98J6A6oqTkqep8zJNp/r8IkqhWLOhsCamM8Af7Bb12Z7d2C87WS 5Euw== X-Gm-Message-State: APjAAAVkyLDAGvJuKi9SzCz2p8aHrbMrjWfDCpIODwPQkGGiH9ZNqqMg fwqQCJFltZLOeb1UlAbsCFVfmhF2mh8= X-Google-Smtp-Source: APXvYqw/ZSDn+HrKp0z78eaIcpwlnMzeQSkMtq5PE6fOUONesdQU8qsa0QVWBDw4u9mBsF/HJvnWfg== X-Received: by 2002:a0c:d4c9:: with SMTP id y9mr15576084qvh.80.1557877781900; Tue, 14 May 2019 16:49:41 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id d85sm87045qkc.64.2019.05.14.16.49.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 16:49:40 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hQhAx-0001O6-Af; Tue, 14 May 2019 20:49:39 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 15/20] libibmad: Flatten libibmad into one directory Date: Tue, 14 May 2019 20:49:31 -0300 Message-Id: <20190514234936.5175-16-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514234936.5175-1-jgg@ziepe.ca> References: <20190514234936.5175-1-jgg@ziepe.ca> MIME-Version: 1.0 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: Jason Gunthorpe As is the standard for rdma-core Signed-off-by: Jason Gunthorpe --- CMakeLists.txt | 2 +- {ibdiags/libibmad/src => libibmad}/CMakeLists.txt | 4 ++-- {ibdiags/libibmad/src => libibmad}/bm.c | 0 {ibdiags/libibmad/src => libibmad}/cc.c | 0 {ibdiags/libibmad/src => libibmad}/dump.c | 0 {ibdiags/libibmad/src => libibmad}/fields.c | 0 {ibdiags/libibmad/src => libibmad}/gs.c | 0 {ibdiags/libibmad/src => libibmad}/iba_types.h | 0 {ibdiags/libibmad/src => libibmad}/libibmad.map | 0 {ibdiags/libibmad/src => libibmad}/mad.c | 0 {ibdiags/libibmad/include/infiniband => libibmad}/mad.h | 0 {ibdiags/libibmad/src => libibmad}/mad_internal.h | 0 {ibdiags/libibmad/include/infiniband => libibmad}/mad_osd.h | 0 {ibdiags/libibmad/src => libibmad}/portid.c | 0 {ibdiags/libibmad/src => libibmad}/register.c | 0 {ibdiags/libibmad/src => libibmad}/resolve.c | 0 {ibdiags/libibmad/src => libibmad}/rpc.c | 0 {ibdiags/libibmad/src => libibmad}/sa.c | 0 {ibdiags/libibmad/src => libibmad}/serv.c | 0 {ibdiags/libibmad/src => libibmad}/smp.c | 0 {ibdiags/libibmad/src => libibmad}/vendor.c | 0 21 files changed, 3 insertions(+), 3 deletions(-) rename {ibdiags/libibmad/src => libibmad}/CMakeLists.txt (86%) rename {ibdiags/libibmad/src => libibmad}/bm.c (100%) rename {ibdiags/libibmad/src => libibmad}/cc.c (100%) rename {ibdiags/libibmad/src => libibmad}/dump.c (100%) rename {ibdiags/libibmad/src => libibmad}/fields.c (100%) rename {ibdiags/libibmad/src => libibmad}/gs.c (100%) rename {ibdiags/libibmad/src => libibmad}/iba_types.h (100%) rename {ibdiags/libibmad/src => libibmad}/libibmad.map (100%) rename {ibdiags/libibmad/src => libibmad}/mad.c (100%) rename {ibdiags/libibmad/include/infiniband => libibmad}/mad.h (100%) rename {ibdiags/libibmad/src => libibmad}/mad_internal.h (100%) rename {ibdiags/libibmad/include/infiniband => libibmad}/mad_osd.h (100%) rename {ibdiags/libibmad/src => libibmad}/portid.c (100%) rename {ibdiags/libibmad/src => libibmad}/register.c (100%) rename {ibdiags/libibmad/src => libibmad}/resolve.c (100%) rename {ibdiags/libibmad/src => libibmad}/rpc.c (100%) rename {ibdiags/libibmad/src => libibmad}/sa.c (100%) rename {ibdiags/libibmad/src => libibmad}/serv.c (100%) rename {ibdiags/libibmad/src => libibmad}/smp.c (100%) rename {ibdiags/libibmad/src => libibmad}/vendor.c (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index fd9355787291c0..a5c1dc7f1e2421 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -617,7 +617,7 @@ add_subdirectory(providers/ipathverbs) add_subdirectory(providers/rxe) add_subdirectory(providers/rxe/man) -add_subdirectory(ibdiags/libibmad/src) +add_subdirectory(libibmad) add_subdirectory(ibdiags/libibnetdisc/src) add_subdirectory(ibdiags/libibnetdisc/man) add_subdirectory(ibdiags/src) diff --git a/ibdiags/libibmad/src/CMakeLists.txt b/libibmad/CMakeLists.txt similarity index 86% rename from ibdiags/libibmad/src/CMakeLists.txt rename to libibmad/CMakeLists.txt index 81fa4a366fc3c7..43d560a43d0a2e 100644 --- a/ibdiags/libibmad/src/CMakeLists.txt +++ b/libibmad/CMakeLists.txt @@ -1,6 +1,6 @@ publish_headers(infiniband - ../include/infiniband/mad.h - ../include/infiniband/mad_osd.h + mad.h + mad_osd.h ) publish_internal_headers(util diff --git a/ibdiags/libibmad/src/bm.c b/libibmad/bm.c similarity index 100% rename from ibdiags/libibmad/src/bm.c rename to libibmad/bm.c diff --git a/ibdiags/libibmad/src/cc.c b/libibmad/cc.c similarity index 100% rename from ibdiags/libibmad/src/cc.c rename to libibmad/cc.c diff --git a/ibdiags/libibmad/src/dump.c b/libibmad/dump.c similarity index 100% rename from ibdiags/libibmad/src/dump.c rename to libibmad/dump.c diff --git a/ibdiags/libibmad/src/fields.c b/libibmad/fields.c similarity index 100% rename from ibdiags/libibmad/src/fields.c rename to libibmad/fields.c diff --git a/ibdiags/libibmad/src/gs.c b/libibmad/gs.c similarity index 100% rename from ibdiags/libibmad/src/gs.c rename to libibmad/gs.c diff --git a/ibdiags/libibmad/src/iba_types.h b/libibmad/iba_types.h similarity index 100% rename from ibdiags/libibmad/src/iba_types.h rename to libibmad/iba_types.h diff --git a/ibdiags/libibmad/src/libibmad.map b/libibmad/libibmad.map similarity index 100% rename from ibdiags/libibmad/src/libibmad.map rename to libibmad/libibmad.map diff --git a/ibdiags/libibmad/src/mad.c b/libibmad/mad.c similarity index 100% rename from ibdiags/libibmad/src/mad.c rename to libibmad/mad.c diff --git a/ibdiags/libibmad/include/infiniband/mad.h b/libibmad/mad.h similarity index 100% rename from ibdiags/libibmad/include/infiniband/mad.h rename to libibmad/mad.h diff --git a/ibdiags/libibmad/src/mad_internal.h b/libibmad/mad_internal.h similarity index 100% rename from ibdiags/libibmad/src/mad_internal.h rename to libibmad/mad_internal.h diff --git a/ibdiags/libibmad/include/infiniband/mad_osd.h b/libibmad/mad_osd.h similarity index 100% rename from ibdiags/libibmad/include/infiniband/mad_osd.h rename to libibmad/mad_osd.h diff --git a/ibdiags/libibmad/src/portid.c b/libibmad/portid.c similarity index 100% rename from ibdiags/libibmad/src/portid.c rename to libibmad/portid.c diff --git a/ibdiags/libibmad/src/register.c b/libibmad/register.c similarity index 100% rename from ibdiags/libibmad/src/register.c rename to libibmad/register.c diff --git a/ibdiags/libibmad/src/resolve.c b/libibmad/resolve.c similarity index 100% rename from ibdiags/libibmad/src/resolve.c rename to libibmad/resolve.c diff --git a/ibdiags/libibmad/src/rpc.c b/libibmad/rpc.c similarity index 100% rename from ibdiags/libibmad/src/rpc.c rename to libibmad/rpc.c diff --git a/ibdiags/libibmad/src/sa.c b/libibmad/sa.c similarity index 100% rename from ibdiags/libibmad/src/sa.c rename to libibmad/sa.c diff --git a/ibdiags/libibmad/src/serv.c b/libibmad/serv.c similarity index 100% rename from ibdiags/libibmad/src/serv.c rename to libibmad/serv.c diff --git a/ibdiags/libibmad/src/smp.c b/libibmad/smp.c similarity index 100% rename from ibdiags/libibmad/src/smp.c rename to libibmad/smp.c diff --git a/ibdiags/libibmad/src/vendor.c b/libibmad/vendor.c similarity index 100% rename from ibdiags/libibmad/src/vendor.c rename to libibmad/vendor.c From patchwork Tue May 14 23:49:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10944125 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E6432912 for ; Wed, 15 May 2019 00:11:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D573B28984 for ; Wed, 15 May 2019 00:11:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9C5028929; Wed, 15 May 2019 00:11:17 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 11A262897D for ; Wed, 15 May 2019 00:11:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726621AbfEOALM (ORCPT ); Tue, 14 May 2019 20:11:12 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:35364 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726790AbfEOALM (ORCPT ); Tue, 14 May 2019 20:11:12 -0400 Received: by mail-qk1-f194.google.com with SMTP id c15so442776qkl.2 for ; Tue, 14 May 2019 17:11:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Mpw6hVHHI13fPbqmbD4sv5vRdfLgyvm4tO2Bz6bVSkY=; b=am6ckc3JPbNQS4AAG2WBu3FTsWj6WbKB9nrASFymxfYjuOCxFqc1JcKTnQqOk7ewey 0rADydJCf8OQLewhO5CrK3z/jl1Vo8bHeteyzMWw3ddmcmV/kLWpxfLf5KA0MEA2+4xp KUl2XoGNaLGOu2kMoDWBDG2PKfSvsvvIiKlio7e+fMG2NbP0V5ZXB0pAqCoI3CyhzA6v O226TGSjbGtITcG9P/rYG0qrj9H1Yq+6/c1zewWSkcMdbUb/kKUEChsGoMHdWfIgHSUi qrqsGYGa4n7+emxPUSJn1cTHeKnp13Et0B1TgDQ6Fv5Qcjg7o0OsuLtjQbGGjQg8LDtY Fw+Q== 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:mime-version:content-transfer-encoding; bh=Mpw6hVHHI13fPbqmbD4sv5vRdfLgyvm4tO2Bz6bVSkY=; b=quygbUGiTuP8yiQKPi509d7c9Q/XDFr8LuRbMMpGSzCEeXDD1M0HlNukMJK2rtkTWo 0nkjsUyO71sZuuhVwSguMol1PNKqH1IZICKrmshbGT7VxH/6wpgQcOwIWEaM9tGJzbMe bGD1GltgAETedtBN5s/LgI5b4ESdoT5UYfavqukquKNGBKxhu3uagnhRQkhPy7vDBhSa TfSHwSbqz3nPb4IsEhKRnMrbk2bA/jFwRFMYxTzRkY3fYesO6BxrswBhe8D40Mvd+98z VkFOSvby+Jt9tnCpxI8pqHLxPRs4KY3fCsmaDy0mnEup5WG5fkJQ6UzMBwj+mdRJ0U+h BH4w== X-Gm-Message-State: APjAAAX8AGYwhu00E0Y1uUE0Eej1/R3ktcuE9PvUOkpPCgQ96qQRP5/w 1+4qwKYYiZEPODj4IWRfdV/oLJWYw+A= X-Google-Smtp-Source: APXvYqyRoPUkijhPYGRmBbRqp4qyoaL7XWjj8X8Ibn42YIvaZdj3J44V+bMsL0kI3ptbv+GqoB4ong== X-Received: by 2002:a37:609:: with SMTP id 9mr30338041qkg.217.1557879070788; Tue, 14 May 2019 17:11:10 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id n66sm177065qke.6.2019.05.14.17.11.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 17:11:10 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hQhAx-0001OC-Ce; Tue, 14 May 2019 20:49:39 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 16/20] libibnetdiscover: Flatten libibnetdiscover into one directory Date: Tue, 14 May 2019 20:49:32 -0300 Message-Id: <20190514234936.5175-17-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514234936.5175-1-jgg@ziepe.ca> References: <20190514234936.5175-1-jgg@ziepe.ca> MIME-Version: 1.0 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: Jason Gunthorpe As is the standard for rdma-core Signed-off-by: Jason Gunthorpe --- CMakeLists.txt | 4 ++-- {ibdiags/libibnetdisc/src => libibnetdisc}/CMakeLists.txt | 6 +++--- {ibdiags/libibnetdisc/src => libibnetdisc}/chassis.c | 0 {ibdiags/libibnetdisc/src => libibnetdisc}/chassis.h | 0 {ibdiags/libibnetdisc/src => libibnetdisc}/ibnetdisc.c | 0 .../include/infiniband => libibnetdisc}/ibnetdisc.h | 0 .../libibnetdisc/src => libibnetdisc}/ibnetdisc_cache.c | 0 .../include/infiniband => libibnetdisc}/ibnetdisc_osd.h | 0 {ibdiags/libibnetdisc/src => libibnetdisc}/internal.h | 0 {ibdiags/libibnetdisc/src => libibnetdisc}/libibnetdisc.map | 0 {ibdiags/libibnetdisc => libibnetdisc}/man/CMakeLists.txt | 0 .../man/ibnd_discover_fabric.3 | 0 .../libibnetdisc => libibnetdisc}/man/ibnd_find_node_guid.3 | 0 .../libibnetdisc => libibnetdisc}/man/ibnd_iter_nodes.3 | 0 {ibdiags/libibnetdisc/src => libibnetdisc}/query_smp.c | 0 .../libibnetdisc/test => libibnetdisc/tests}/testleaks.c | 0 16 files changed, 5 insertions(+), 5 deletions(-) rename {ibdiags/libibnetdisc/src => libibnetdisc}/CMakeLists.txt (75%) rename {ibdiags/libibnetdisc/src => libibnetdisc}/chassis.c (100%) rename {ibdiags/libibnetdisc/src => libibnetdisc}/chassis.h (100%) rename {ibdiags/libibnetdisc/src => libibnetdisc}/ibnetdisc.c (100%) rename {ibdiags/libibnetdisc/include/infiniband => libibnetdisc}/ibnetdisc.h (100%) rename {ibdiags/libibnetdisc/src => libibnetdisc}/ibnetdisc_cache.c (100%) rename {ibdiags/libibnetdisc/include/infiniband => libibnetdisc}/ibnetdisc_osd.h (100%) rename {ibdiags/libibnetdisc/src => libibnetdisc}/internal.h (100%) rename {ibdiags/libibnetdisc/src => libibnetdisc}/libibnetdisc.map (100%) rename {ibdiags/libibnetdisc => libibnetdisc}/man/CMakeLists.txt (100%) rename {ibdiags/libibnetdisc => libibnetdisc}/man/ibnd_discover_fabric.3 (100%) rename {ibdiags/libibnetdisc => libibnetdisc}/man/ibnd_find_node_guid.3 (100%) rename {ibdiags/libibnetdisc => libibnetdisc}/man/ibnd_iter_nodes.3 (100%) rename {ibdiags/libibnetdisc/src => libibnetdisc}/query_smp.c (100%) rename {ibdiags/libibnetdisc/test => libibnetdisc/tests}/testleaks.c (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index a5c1dc7f1e2421..7b048a0fa164c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -618,8 +618,8 @@ add_subdirectory(providers/rxe) add_subdirectory(providers/rxe/man) add_subdirectory(libibmad) -add_subdirectory(ibdiags/libibnetdisc/src) -add_subdirectory(ibdiags/libibnetdisc/man) +add_subdirectory(libibnetdisc) +add_subdirectory(libibnetdisc/man) add_subdirectory(ibdiags/src) add_subdirectory(ibdiags/scripts) add_subdirectory(ibdiags/man) diff --git a/ibdiags/libibnetdisc/src/CMakeLists.txt b/libibnetdisc/CMakeLists.txt similarity index 75% rename from ibdiags/libibnetdisc/src/CMakeLists.txt rename to libibnetdisc/CMakeLists.txt index ad8c09dc9722f6..e908bc2d6a29f9 100644 --- a/ibdiags/libibnetdisc/src/CMakeLists.txt +++ b/libibnetdisc/CMakeLists.txt @@ -1,6 +1,6 @@ publish_headers(infiniband - ../include/infiniband/ibnetdisc.h - ../include/infiniband/ibnetdisc_osd.h + ibnetdisc.h + ibnetdisc_osd.h ) rdma_library(ibnetdisc libibnetdisc.map @@ -17,7 +17,7 @@ target_link_libraries(ibnetdisc LINK_PRIVATE ) rdma_pkg_config("ibnetdisc" "libibumad libibmad" "") -rdma_test_executable(testleaks ../test/testleaks.c) +rdma_test_executable(testleaks tests/testleaks.c) target_link_libraries(testleaks LINK_PRIVATE ibmad ibnetdisc diff --git a/ibdiags/libibnetdisc/src/chassis.c b/libibnetdisc/chassis.c similarity index 100% rename from ibdiags/libibnetdisc/src/chassis.c rename to libibnetdisc/chassis.c diff --git a/ibdiags/libibnetdisc/src/chassis.h b/libibnetdisc/chassis.h similarity index 100% rename from ibdiags/libibnetdisc/src/chassis.h rename to libibnetdisc/chassis.h diff --git a/ibdiags/libibnetdisc/src/ibnetdisc.c b/libibnetdisc/ibnetdisc.c similarity index 100% rename from ibdiags/libibnetdisc/src/ibnetdisc.c rename to libibnetdisc/ibnetdisc.c diff --git a/ibdiags/libibnetdisc/include/infiniband/ibnetdisc.h b/libibnetdisc/ibnetdisc.h similarity index 100% rename from ibdiags/libibnetdisc/include/infiniband/ibnetdisc.h rename to libibnetdisc/ibnetdisc.h diff --git a/ibdiags/libibnetdisc/src/ibnetdisc_cache.c b/libibnetdisc/ibnetdisc_cache.c similarity index 100% rename from ibdiags/libibnetdisc/src/ibnetdisc_cache.c rename to libibnetdisc/ibnetdisc_cache.c diff --git a/ibdiags/libibnetdisc/include/infiniband/ibnetdisc_osd.h b/libibnetdisc/ibnetdisc_osd.h similarity index 100% rename from ibdiags/libibnetdisc/include/infiniband/ibnetdisc_osd.h rename to libibnetdisc/ibnetdisc_osd.h diff --git a/ibdiags/libibnetdisc/src/internal.h b/libibnetdisc/internal.h similarity index 100% rename from ibdiags/libibnetdisc/src/internal.h rename to libibnetdisc/internal.h diff --git a/ibdiags/libibnetdisc/src/libibnetdisc.map b/libibnetdisc/libibnetdisc.map similarity index 100% rename from ibdiags/libibnetdisc/src/libibnetdisc.map rename to libibnetdisc/libibnetdisc.map diff --git a/ibdiags/libibnetdisc/man/CMakeLists.txt b/libibnetdisc/man/CMakeLists.txt similarity index 100% rename from ibdiags/libibnetdisc/man/CMakeLists.txt rename to libibnetdisc/man/CMakeLists.txt diff --git a/ibdiags/libibnetdisc/man/ibnd_discover_fabric.3 b/libibnetdisc/man/ibnd_discover_fabric.3 similarity index 100% rename from ibdiags/libibnetdisc/man/ibnd_discover_fabric.3 rename to libibnetdisc/man/ibnd_discover_fabric.3 diff --git a/ibdiags/libibnetdisc/man/ibnd_find_node_guid.3 b/libibnetdisc/man/ibnd_find_node_guid.3 similarity index 100% rename from ibdiags/libibnetdisc/man/ibnd_find_node_guid.3 rename to libibnetdisc/man/ibnd_find_node_guid.3 diff --git a/ibdiags/libibnetdisc/man/ibnd_iter_nodes.3 b/libibnetdisc/man/ibnd_iter_nodes.3 similarity index 100% rename from ibdiags/libibnetdisc/man/ibnd_iter_nodes.3 rename to libibnetdisc/man/ibnd_iter_nodes.3 diff --git a/ibdiags/libibnetdisc/src/query_smp.c b/libibnetdisc/query_smp.c similarity index 100% rename from ibdiags/libibnetdisc/src/query_smp.c rename to libibnetdisc/query_smp.c diff --git a/ibdiags/libibnetdisc/test/testleaks.c b/libibnetdisc/tests/testleaks.c similarity index 100% rename from ibdiags/libibnetdisc/test/testleaks.c rename to libibnetdisc/tests/testleaks.c From patchwork Tue May 14 23:49:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10944105 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 712191395 for ; Tue, 14 May 2019 23:49:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59DF12898B for ; Tue, 14 May 2019 23:49:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E69228994; Tue, 14 May 2019 23:49:50 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 9870E28984 for ; Tue, 14 May 2019 23:49:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726545AbfENXtq (ORCPT ); Tue, 14 May 2019 19:49:46 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:43969 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726461AbfENXtq (ORCPT ); Tue, 14 May 2019 19:49:46 -0400 Received: by mail-qk1-f194.google.com with SMTP id z6so383339qkl.10 for ; Tue, 14 May 2019 16:49:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G82XXP8YiGLQfQ4GwG8HsWwFaR0GhQtI+Q+SWa4TYsU=; b=BpQRmXZiTljTKRxV+5NSUN74ZDRdemLcxFah36faba/AvQh8QMP+br8EjYjwP4LQog N89I7264bMNI1iw9e753gpSSuDZxGcq99Ki+v1SdOHOaOMtjT+erep/zLmQWopGS1Tq6 r7qGU6oLr/dhaapRgBKg4vOROUBJ8pj3xLkZvaJZEqlQe1TvJL8ktjBpCR43btZnBVLF AP28sfJJasB4I4lHVFtHLlbiPvk0RV3aJEhGE+d9TPZo7+LuBl/NoEnKiY/E8K1on+H6 uIOy7ZT55g/w8BUky5b7K2bG9w5XlfB908Tcjvimy5ysdGAXQ05Mzi22LvBflAW1tPb8 xsPQ== 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:mime-version:content-transfer-encoding; bh=G82XXP8YiGLQfQ4GwG8HsWwFaR0GhQtI+Q+SWa4TYsU=; b=SW5U9YrMLVeulHLbZkchjb3qTGNnEBUTa7aFN40Yn1QO7O+D6FSV/07OHWOUlSa/J3 ATGtV+rRjRoQhNDOAkBLSte8hGREvP9YEwrJ5A6r+btTTniRrkjI0J8zeBq0qILkReNx ONmB1q9UA4rY2gRcpfwZMaGNiQwToVxXR7aPCAr52qLtuLNHki/h4+/A0jH6MWaHBmI5 C7c9e9xh9wHFUzisHBOFBximyW0nq2CicZTkTyz9PHHeldubVw0iDmotHwHgkF4SQpwn H4wugm2QNHPj2oSBtj6XCRnuG70H341LimWOG9mWj8LNBA2sBMW47O99g8T4g27zF3TZ tprw== X-Gm-Message-State: APjAAAWakwo/eSOjz/BKlEASeWZKncfqfTwbtwMFNNOPmNY8crR4Mbb9 RGjLDuUN7ocuyyRI/BvVvCJWHAXkoac= X-Google-Smtp-Source: APXvYqy8G2wknJL9IA8Ofb1dxCXkzEb0sBc3h0gqjYaIH4rvtb6nIgDaV1nBQW2pZb2bqej1hV7ezA== X-Received: by 2002:a37:6352:: with SMTP id x79mr25765756qkb.133.1557877783532; Tue, 14 May 2019 16:49:43 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id e25sm372861qta.18.2019.05.14.16.49.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 16:49:40 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hQhAx-0001OI-Ei; Tue, 14 May 2019 20:49:39 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 17/20] ibdiags: Flatten the infiniband-diags tools into one directory Date: Tue, 14 May 2019 20:49:33 -0300 Message-Id: <20190514234936.5175-18-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514234936.5175-1-jgg@ziepe.ca> References: <20190514234936.5175-1-jgg@ziepe.ca> MIME-Version: 1.0 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: Jason Gunthorpe The scripts get their own directory as they are largely considered obsolete now. Signed-off-by: Jason Gunthorpe --- CMakeLists.txt | 7 +++--- ibdiags/man/CMakeLists.txt | 22 ------------------ .../src => infiniband-diags}/CMakeLists.txt | 9 ++++++-- {ibdiags/src => infiniband-diags}/dump_fts.c | 0 .../etc/error_thresholds | 0 {ibdiags => infiniband-diags}/etc/ibdiag.conf | 0 {ibdiags/src => infiniband-diags}/ibaddr.c | 0 .../src => infiniband-diags}/ibcacheedit.c | 0 .../src => infiniband-diags}/ibccconfig.c | 0 {ibdiags/src => infiniband-diags}/ibccquery.c | 0 .../src => infiniband-diags}/ibdiag_common.c | 0 .../ibdiag_common.h | 0 {ibdiags/src => infiniband-diags}/ibdiag_sa.c | 0 .../include => infiniband-diags}/ibdiag_sa.h | 0 .../src => infiniband-diags}/iblinkinfo.c | 0 .../src => infiniband-diags}/ibnetdiscover.c | 0 {ibdiags/src => infiniband-diags}/ibping.c | 0 .../src => infiniband-diags}/ibportstate.c | 0 .../src => infiniband-diags}/ibqueryerrors.c | 0 {ibdiags/src => infiniband-diags}/ibroute.c | 0 .../src => infiniband-diags}/ibsendtrap.c | 0 {ibdiags/src => infiniband-diags}/ibstat.c | 0 {ibdiags/src => infiniband-diags}/ibsysstat.c | 0 {ibdiags/src => infiniband-diags}/ibtracert.c | 0 .../man}/CMakeLists.txt | 23 +++++++++++++++++++ .../man}/check_lft_balance.8.in.rst | 0 .../man}/common/opt_C.rst | 0 .../man}/common/opt_D.rst | 0 .../man}/common/opt_D_with_param.rst | 0 .../man}/common/opt_G.rst | 0 .../man}/common/opt_G_with_param.rst | 0 .../man}/common/opt_K.rst | 0 .../man}/common/opt_L.rst | 0 .../man}/common/opt_P.rst | 0 .../man}/common/opt_V.rst | 0 .../man}/common/opt_cache.rst | 0 .../man}/common/opt_d.rst | 0 .../man}/common/opt_diff.rst | 0 .../man}/common/opt_diffcheck.rst | 0 .../man}/common/opt_e.rst | 0 .../man}/common/opt_h.rst | 0 .../man}/common/opt_load-cache.rst | 0 .../man}/common/opt_node_name_map.rst | 0 .../man}/common/opt_o-outstanding_smps.rst | 0 .../man}/common/opt_ports-file.rst | 0 .../man}/common/opt_s.rst | 0 .../man}/common/opt_t.rst | 0 .../man}/common/opt_v.rst | 0 .../man}/common/opt_y.rst | 0 .../man}/common/opt_z-config.rst | 0 .../man}/common/sec_config-file.rst | 0 .../man}/common/sec_node-name-map.rst | 0 .../man}/common/sec_ports-file.rst | 0 .../man}/common/sec_portselection.rst | 0 .../man}/common/sec_topology-file.rst | 0 .../man}/dump_fts.8.in.rst | 0 .../man}/ibaddr.8.in.rst | 0 .../man}/ibcacheedit.8.in.rst | 0 .../man}/ibccconfig.8.in.rst | 0 .../man}/ibccquery.8.in.rst | 0 .../man/ibcheckerrors.8 | 0 .../man/ibcheckerrs.8 | 0 .../man/ibchecknet.8 | 0 .../man/ibchecknode.8 | 0 .../man/ibcheckport.8 | 0 .../man/ibcheckportstate.8 | 0 .../man/ibcheckportwidth.8 | 0 .../man/ibcheckstate.8 | 0 .../man/ibcheckwidth.8 | 0 .../man/ibclearcounters.8 | 0 .../man/ibclearerrors.8 | 0 .../man/ibdatacounters.8 | 0 .../man/ibdatacounts.8 | 0 .../man/ibdiscover.8 | 0 .../man}/ibfindnodesusing.8.in.rst | 0 .../man}/ibhosts.8.in.rst | 0 .../man}/ibidsverify.8.in.rst | 0 .../man}/iblinkinfo.8.in.rst | 0 .../man}/ibnetdiscover.8.in.rst | 0 .../man}/ibnodes.8.in.rst | 0 .../man}/ibping.8.in.rst | 0 .../man}/ibportstate.8.in.rst | 0 {ibdiags => infiniband-diags}/man/ibprintca.8 | 0 {ibdiags => infiniband-diags}/man/ibprintrt.8 | 0 .../man/ibprintswitch.8 | 0 .../man}/ibqueryerrors.8.in.rst | 0 .../man}/ibroute.8.in.rst | 0 .../man}/ibrouters.8.in.rst | 0 .../man}/ibstat.8.in.rst | 0 .../man}/ibstatus.8.in.rst | 0 .../man}/ibswitches.8.in.rst | 0 .../man/ibswportwatch.8 | 0 .../man}/ibsysstat.8.in.rst | 0 .../man}/ibtracert.8.in.rst | 0 .../man}/infiniband-diags.8.in.rst | 0 .../man}/perfquery.8.in.rst | 0 .../man}/saquery.8.in.rst | 0 .../man}/sminfo.8.in.rst | 0 .../man}/smpdump.8.in.rst | 0 .../man}/smpquery.8.in.rst | 0 .../man}/vendstat.8.in.rst | 0 .../src => infiniband-diags}/mcm_rereg_test.c | 0 {ibdiags/src => infiniband-diags}/perfquery.c | 0 {ibdiags/src => infiniband-diags}/saquery.c | 0 .../scripts/CMakeLists.txt | 5 ---- .../scripts/IBswcountlimits.pm | 0 .../scripts/check_lft_balance.pl | 0 .../scripts/dump_lfts.sh.in | 0 .../scripts/dump_mfts.sh.in | 0 .../scripts/ibcheckerrors.in | 0 .../scripts/ibcheckerrs.in | 0 .../scripts/ibchecknet.in | 0 .../scripts/ibchecknode.in | 0 .../scripts/ibcheckport.in | 0 .../scripts/ibcheckportstate.in | 0 .../scripts/ibcheckportwidth.in | 0 .../scripts/ibcheckstate.in | 0 .../scripts/ibcheckwidth.in | 0 .../scripts/ibclearcounters.in | 0 .../scripts/ibclearerrors.in | 0 .../scripts/ibdatacounters.in | 0 .../scripts/ibdatacounts.in | 0 .../scripts/ibdiscover.map | 0 .../scripts/ibdiscover.pl | 0 .../scripts/ibfindnodesusing.pl | 0 .../scripts/ibhosts.in | 0 .../scripts/ibidsverify.pl | 0 .../scripts/iblinkinfo.pl.in | 0 .../scripts/ibnodes.in | 0 .../scripts/ibprintca.pl | 0 .../scripts/ibprintrt.pl | 0 .../scripts/ibprintswitch.pl | 0 .../scripts/ibqueryerrors.pl.in | 0 .../scripts/ibrouters.in | 0 .../scripts/ibstatus | 0 .../scripts/ibswitches.in | 0 .../scripts/ibswportwatch.pl | 0 .../scripts/set_nodedesc.sh | 0 {ibdiags/src => infiniband-diags}/sminfo.c | 0 {ibdiags/src => infiniband-diags}/smpdump.c | 0 {ibdiags/src => infiniband-diags}/smpquery.c | 0 {ibdiags/src => infiniband-diags}/vendstat.c | 0 142 files changed, 33 insertions(+), 33 deletions(-) delete mode 100644 ibdiags/man/CMakeLists.txt rename {ibdiags/src => infiniband-diags}/CMakeLists.txt (86%) rename {ibdiags/src => infiniband-diags}/dump_fts.c (100%) rename {ibdiags => infiniband-diags}/etc/error_thresholds (100%) rename {ibdiags => infiniband-diags}/etc/ibdiag.conf (100%) rename {ibdiags/src => infiniband-diags}/ibaddr.c (100%) rename {ibdiags/src => infiniband-diags}/ibcacheedit.c (100%) rename {ibdiags/src => infiniband-diags}/ibccconfig.c (100%) rename {ibdiags/src => infiniband-diags}/ibccquery.c (100%) rename {ibdiags/src => infiniband-diags}/ibdiag_common.c (100%) rename {ibdiags/include => infiniband-diags}/ibdiag_common.h (100%) rename {ibdiags/src => infiniband-diags}/ibdiag_sa.c (100%) rename {ibdiags/include => infiniband-diags}/ibdiag_sa.h (100%) rename {ibdiags/src => infiniband-diags}/iblinkinfo.c (100%) rename {ibdiags/src => infiniband-diags}/ibnetdiscover.c (100%) rename {ibdiags/src => infiniband-diags}/ibping.c (100%) rename {ibdiags/src => infiniband-diags}/ibportstate.c (100%) rename {ibdiags/src => infiniband-diags}/ibqueryerrors.c (100%) rename {ibdiags/src => infiniband-diags}/ibroute.c (100%) rename {ibdiags/src => infiniband-diags}/ibsendtrap.c (100%) rename {ibdiags/src => infiniband-diags}/ibstat.c (100%) rename {ibdiags/src => infiniband-diags}/ibsysstat.c (100%) rename {ibdiags/src => infiniband-diags}/ibtracert.c (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/CMakeLists.txt (68%) rename {ibdiags/doc/rst => infiniband-diags/man}/check_lft_balance.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_C.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_D.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_D_with_param.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_G.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_G_with_param.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_K.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_L.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_P.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_V.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_cache.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_d.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_diff.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_diffcheck.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_e.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_h.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_load-cache.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_node_name_map.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_o-outstanding_smps.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_ports-file.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_s.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_t.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_v.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_y.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/opt_z-config.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/sec_config-file.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/sec_node-name-map.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/sec_ports-file.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/sec_portselection.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/common/sec_topology-file.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/dump_fts.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/ibaddr.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/ibcacheedit.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/ibccconfig.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/ibccquery.8.in.rst (100%) rename {ibdiags => infiniband-diags}/man/ibcheckerrors.8 (100%) rename {ibdiags => infiniband-diags}/man/ibcheckerrs.8 (100%) rename {ibdiags => infiniband-diags}/man/ibchecknet.8 (100%) rename {ibdiags => infiniband-diags}/man/ibchecknode.8 (100%) rename {ibdiags => infiniband-diags}/man/ibcheckport.8 (100%) rename {ibdiags => infiniband-diags}/man/ibcheckportstate.8 (100%) rename {ibdiags => infiniband-diags}/man/ibcheckportwidth.8 (100%) rename {ibdiags => infiniband-diags}/man/ibcheckstate.8 (100%) rename {ibdiags => infiniband-diags}/man/ibcheckwidth.8 (100%) rename {ibdiags => infiniband-diags}/man/ibclearcounters.8 (100%) rename {ibdiags => infiniband-diags}/man/ibclearerrors.8 (100%) rename {ibdiags => infiniband-diags}/man/ibdatacounters.8 (100%) rename {ibdiags => infiniband-diags}/man/ibdatacounts.8 (100%) rename {ibdiags => infiniband-diags}/man/ibdiscover.8 (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/ibfindnodesusing.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/ibhosts.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/ibidsverify.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/iblinkinfo.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/ibnetdiscover.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/ibnodes.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/ibping.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/ibportstate.8.in.rst (100%) rename {ibdiags => infiniband-diags}/man/ibprintca.8 (100%) rename {ibdiags => infiniband-diags}/man/ibprintrt.8 (100%) rename {ibdiags => infiniband-diags}/man/ibprintswitch.8 (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/ibqueryerrors.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/ibroute.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/ibrouters.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/ibstat.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/ibstatus.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/ibswitches.8.in.rst (100%) rename {ibdiags => infiniband-diags}/man/ibswportwatch.8 (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/ibsysstat.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/ibtracert.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/infiniband-diags.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/perfquery.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/saquery.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/sminfo.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/smpdump.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/smpquery.8.in.rst (100%) rename {ibdiags/doc/rst => infiniband-diags/man}/vendstat.8.in.rst (100%) rename {ibdiags/src => infiniband-diags}/mcm_rereg_test.c (100%) rename {ibdiags/src => infiniband-diags}/perfquery.c (100%) rename {ibdiags/src => infiniband-diags}/saquery.c (100%) rename {ibdiags => infiniband-diags}/scripts/CMakeLists.txt (96%) rename {ibdiags => infiniband-diags}/scripts/IBswcountlimits.pm (100%) rename {ibdiags => infiniband-diags}/scripts/check_lft_balance.pl (100%) rename {ibdiags => infiniband-diags}/scripts/dump_lfts.sh.in (100%) rename {ibdiags => infiniband-diags}/scripts/dump_mfts.sh.in (100%) rename {ibdiags => infiniband-diags}/scripts/ibcheckerrors.in (100%) rename {ibdiags => infiniband-diags}/scripts/ibcheckerrs.in (100%) rename {ibdiags => infiniband-diags}/scripts/ibchecknet.in (100%) rename {ibdiags => infiniband-diags}/scripts/ibchecknode.in (100%) rename {ibdiags => infiniband-diags}/scripts/ibcheckport.in (100%) rename {ibdiags => infiniband-diags}/scripts/ibcheckportstate.in (100%) rename {ibdiags => infiniband-diags}/scripts/ibcheckportwidth.in (100%) rename {ibdiags => infiniband-diags}/scripts/ibcheckstate.in (100%) rename {ibdiags => infiniband-diags}/scripts/ibcheckwidth.in (100%) rename {ibdiags => infiniband-diags}/scripts/ibclearcounters.in (100%) rename {ibdiags => infiniband-diags}/scripts/ibclearerrors.in (100%) rename {ibdiags => infiniband-diags}/scripts/ibdatacounters.in (100%) rename {ibdiags => infiniband-diags}/scripts/ibdatacounts.in (100%) rename {ibdiags => infiniband-diags}/scripts/ibdiscover.map (100%) rename {ibdiags => infiniband-diags}/scripts/ibdiscover.pl (100%) rename {ibdiags => infiniband-diags}/scripts/ibfindnodesusing.pl (100%) rename {ibdiags => infiniband-diags}/scripts/ibhosts.in (100%) rename {ibdiags => infiniband-diags}/scripts/ibidsverify.pl (100%) rename {ibdiags => infiniband-diags}/scripts/iblinkinfo.pl.in (100%) rename {ibdiags => infiniband-diags}/scripts/ibnodes.in (100%) rename {ibdiags => infiniband-diags}/scripts/ibprintca.pl (100%) rename {ibdiags => infiniband-diags}/scripts/ibprintrt.pl (100%) rename {ibdiags => infiniband-diags}/scripts/ibprintswitch.pl (100%) rename {ibdiags => infiniband-diags}/scripts/ibqueryerrors.pl.in (100%) rename {ibdiags => infiniband-diags}/scripts/ibrouters.in (100%) rename {ibdiags => infiniband-diags}/scripts/ibstatus (100%) rename {ibdiags => infiniband-diags}/scripts/ibswitches.in (100%) rename {ibdiags => infiniband-diags}/scripts/ibswportwatch.pl (100%) rename {ibdiags => infiniband-diags}/scripts/set_nodedesc.sh (100%) rename {ibdiags/src => infiniband-diags}/sminfo.c (100%) rename {ibdiags/src => infiniband-diags}/smpdump.c (100%) rename {ibdiags/src => infiniband-diags}/smpquery.c (100%) rename {ibdiags/src => infiniband-diags}/vendstat.c (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b048a0fa164c1..c6b5b3ddd815b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -620,10 +620,9 @@ add_subdirectory(providers/rxe/man) add_subdirectory(libibmad) add_subdirectory(libibnetdisc) add_subdirectory(libibnetdisc/man) -add_subdirectory(ibdiags/src) -add_subdirectory(ibdiags/scripts) -add_subdirectory(ibdiags/man) -add_subdirectory(ibdiags/doc/rst) +add_subdirectory(infiniband-diags) +add_subdirectory(infiniband-diags/scripts) +add_subdirectory(infiniband-diags/man) if (CYTHON_EXECUTABLE) add_subdirectory(pyverbs) diff --git a/ibdiags/man/CMakeLists.txt b/ibdiags/man/CMakeLists.txt deleted file mode 100644 index 2446acbb522c86..00000000000000 diff --git a/ibdiags/src/CMakeLists.txt b/infiniband-diags/CMakeLists.txt similarity index 86% rename from ibdiags/src/CMakeLists.txt rename to infiniband-diags/CMakeLists.txt index b28f543f2f0699..6301e8e0210af7 100644 --- a/ibdiags/src/CMakeLists.txt +++ b/infiniband-diags/CMakeLists.txt @@ -1,8 +1,13 @@ publish_internal_headers("" - ../include/ibdiag_common.h - ../include/ibdiag_sa.h + ibdiag_common.h + ibdiag_sa.h ) +install(FILES + etc/error_thresholds + etc/ibdiag.conf + DESTINATION "${IBDIAG_CONFIG_PATH}") + add_library(ibdiags_tools STATIC ibdiag_common.c ibdiag_sa.c diff --git a/ibdiags/src/dump_fts.c b/infiniband-diags/dump_fts.c similarity index 100% rename from ibdiags/src/dump_fts.c rename to infiniband-diags/dump_fts.c diff --git a/ibdiags/etc/error_thresholds b/infiniband-diags/etc/error_thresholds similarity index 100% rename from ibdiags/etc/error_thresholds rename to infiniband-diags/etc/error_thresholds diff --git a/ibdiags/etc/ibdiag.conf b/infiniband-diags/etc/ibdiag.conf similarity index 100% rename from ibdiags/etc/ibdiag.conf rename to infiniband-diags/etc/ibdiag.conf diff --git a/ibdiags/src/ibaddr.c b/infiniband-diags/ibaddr.c similarity index 100% rename from ibdiags/src/ibaddr.c rename to infiniband-diags/ibaddr.c diff --git a/ibdiags/src/ibcacheedit.c b/infiniband-diags/ibcacheedit.c similarity index 100% rename from ibdiags/src/ibcacheedit.c rename to infiniband-diags/ibcacheedit.c diff --git a/ibdiags/src/ibccconfig.c b/infiniband-diags/ibccconfig.c similarity index 100% rename from ibdiags/src/ibccconfig.c rename to infiniband-diags/ibccconfig.c diff --git a/ibdiags/src/ibccquery.c b/infiniband-diags/ibccquery.c similarity index 100% rename from ibdiags/src/ibccquery.c rename to infiniband-diags/ibccquery.c diff --git a/ibdiags/src/ibdiag_common.c b/infiniband-diags/ibdiag_common.c similarity index 100% rename from ibdiags/src/ibdiag_common.c rename to infiniband-diags/ibdiag_common.c diff --git a/ibdiags/include/ibdiag_common.h b/infiniband-diags/ibdiag_common.h similarity index 100% rename from ibdiags/include/ibdiag_common.h rename to infiniband-diags/ibdiag_common.h diff --git a/ibdiags/src/ibdiag_sa.c b/infiniband-diags/ibdiag_sa.c similarity index 100% rename from ibdiags/src/ibdiag_sa.c rename to infiniband-diags/ibdiag_sa.c diff --git a/ibdiags/include/ibdiag_sa.h b/infiniband-diags/ibdiag_sa.h similarity index 100% rename from ibdiags/include/ibdiag_sa.h rename to infiniband-diags/ibdiag_sa.h diff --git a/ibdiags/src/iblinkinfo.c b/infiniband-diags/iblinkinfo.c similarity index 100% rename from ibdiags/src/iblinkinfo.c rename to infiniband-diags/iblinkinfo.c diff --git a/ibdiags/src/ibnetdiscover.c b/infiniband-diags/ibnetdiscover.c similarity index 100% rename from ibdiags/src/ibnetdiscover.c rename to infiniband-diags/ibnetdiscover.c diff --git a/ibdiags/src/ibping.c b/infiniband-diags/ibping.c similarity index 100% rename from ibdiags/src/ibping.c rename to infiniband-diags/ibping.c diff --git a/ibdiags/src/ibportstate.c b/infiniband-diags/ibportstate.c similarity index 100% rename from ibdiags/src/ibportstate.c rename to infiniband-diags/ibportstate.c diff --git a/ibdiags/src/ibqueryerrors.c b/infiniband-diags/ibqueryerrors.c similarity index 100% rename from ibdiags/src/ibqueryerrors.c rename to infiniband-diags/ibqueryerrors.c diff --git a/ibdiags/src/ibroute.c b/infiniband-diags/ibroute.c similarity index 100% rename from ibdiags/src/ibroute.c rename to infiniband-diags/ibroute.c diff --git a/ibdiags/src/ibsendtrap.c b/infiniband-diags/ibsendtrap.c similarity index 100% rename from ibdiags/src/ibsendtrap.c rename to infiniband-diags/ibsendtrap.c diff --git a/ibdiags/src/ibstat.c b/infiniband-diags/ibstat.c similarity index 100% rename from ibdiags/src/ibstat.c rename to infiniband-diags/ibstat.c diff --git a/ibdiags/src/ibsysstat.c b/infiniband-diags/ibsysstat.c similarity index 100% rename from ibdiags/src/ibsysstat.c rename to infiniband-diags/ibsysstat.c diff --git a/ibdiags/src/ibtracert.c b/infiniband-diags/ibtracert.c similarity index 100% rename from ibdiags/src/ibtracert.c rename to infiniband-diags/ibtracert.c diff --git a/ibdiags/doc/rst/CMakeLists.txt b/infiniband-diags/man/CMakeLists.txt similarity index 68% rename from ibdiags/doc/rst/CMakeLists.txt rename to infiniband-diags/man/CMakeLists.txt index f0e4072306a57c..845fff675f23d4 100644 --- a/ibdiags/doc/rst/CMakeLists.txt +++ b/infiniband-diags/man/CMakeLists.txt @@ -39,3 +39,26 @@ rdma_alias_man_pages( dump_fts.8 dump_lfts.8 dump_fts.8 dump_mfts.8 ) + +if (WITH_IBDIAGS_COMPAT) + rdma_man_pages( + ibcheckerrors.8 + ibcheckerrs.8 + ibchecknet.8 + ibchecknode.8 + ibcheckport.8 + ibcheckportstate.8 + ibcheckportwidth.8 + ibcheckstate.8 + ibcheckwidth.8 + ibclearcounters.8 + ibclearerrors.8 + ibdatacounters.8 + ibdatacounts.8 + ibdiscover.8 + ibprintca.8 + ibprintrt.8 + ibprintswitch.8 + ibswportwatch.8 + ) +endif() diff --git a/ibdiags/doc/rst/check_lft_balance.8.in.rst b/infiniband-diags/man/check_lft_balance.8.in.rst similarity index 100% rename from ibdiags/doc/rst/check_lft_balance.8.in.rst rename to infiniband-diags/man/check_lft_balance.8.in.rst diff --git a/ibdiags/doc/rst/common/opt_C.rst b/infiniband-diags/man/common/opt_C.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_C.rst rename to infiniband-diags/man/common/opt_C.rst diff --git a/ibdiags/doc/rst/common/opt_D.rst b/infiniband-diags/man/common/opt_D.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_D.rst rename to infiniband-diags/man/common/opt_D.rst diff --git a/ibdiags/doc/rst/common/opt_D_with_param.rst b/infiniband-diags/man/common/opt_D_with_param.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_D_with_param.rst rename to infiniband-diags/man/common/opt_D_with_param.rst diff --git a/ibdiags/doc/rst/common/opt_G.rst b/infiniband-diags/man/common/opt_G.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_G.rst rename to infiniband-diags/man/common/opt_G.rst diff --git a/ibdiags/doc/rst/common/opt_G_with_param.rst b/infiniband-diags/man/common/opt_G_with_param.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_G_with_param.rst rename to infiniband-diags/man/common/opt_G_with_param.rst diff --git a/ibdiags/doc/rst/common/opt_K.rst b/infiniband-diags/man/common/opt_K.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_K.rst rename to infiniband-diags/man/common/opt_K.rst diff --git a/ibdiags/doc/rst/common/opt_L.rst b/infiniband-diags/man/common/opt_L.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_L.rst rename to infiniband-diags/man/common/opt_L.rst diff --git a/ibdiags/doc/rst/common/opt_P.rst b/infiniband-diags/man/common/opt_P.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_P.rst rename to infiniband-diags/man/common/opt_P.rst diff --git a/ibdiags/doc/rst/common/opt_V.rst b/infiniband-diags/man/common/opt_V.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_V.rst rename to infiniband-diags/man/common/opt_V.rst diff --git a/ibdiags/doc/rst/common/opt_cache.rst b/infiniband-diags/man/common/opt_cache.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_cache.rst rename to infiniband-diags/man/common/opt_cache.rst diff --git a/ibdiags/doc/rst/common/opt_d.rst b/infiniband-diags/man/common/opt_d.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_d.rst rename to infiniband-diags/man/common/opt_d.rst diff --git a/ibdiags/doc/rst/common/opt_diff.rst b/infiniband-diags/man/common/opt_diff.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_diff.rst rename to infiniband-diags/man/common/opt_diff.rst diff --git a/ibdiags/doc/rst/common/opt_diffcheck.rst b/infiniband-diags/man/common/opt_diffcheck.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_diffcheck.rst rename to infiniband-diags/man/common/opt_diffcheck.rst diff --git a/ibdiags/doc/rst/common/opt_e.rst b/infiniband-diags/man/common/opt_e.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_e.rst rename to infiniband-diags/man/common/opt_e.rst diff --git a/ibdiags/doc/rst/common/opt_h.rst b/infiniband-diags/man/common/opt_h.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_h.rst rename to infiniband-diags/man/common/opt_h.rst diff --git a/ibdiags/doc/rst/common/opt_load-cache.rst b/infiniband-diags/man/common/opt_load-cache.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_load-cache.rst rename to infiniband-diags/man/common/opt_load-cache.rst diff --git a/ibdiags/doc/rst/common/opt_node_name_map.rst b/infiniband-diags/man/common/opt_node_name_map.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_node_name_map.rst rename to infiniband-diags/man/common/opt_node_name_map.rst diff --git a/ibdiags/doc/rst/common/opt_o-outstanding_smps.rst b/infiniband-diags/man/common/opt_o-outstanding_smps.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_o-outstanding_smps.rst rename to infiniband-diags/man/common/opt_o-outstanding_smps.rst diff --git a/ibdiags/doc/rst/common/opt_ports-file.rst b/infiniband-diags/man/common/opt_ports-file.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_ports-file.rst rename to infiniband-diags/man/common/opt_ports-file.rst diff --git a/ibdiags/doc/rst/common/opt_s.rst b/infiniband-diags/man/common/opt_s.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_s.rst rename to infiniband-diags/man/common/opt_s.rst diff --git a/ibdiags/doc/rst/common/opt_t.rst b/infiniband-diags/man/common/opt_t.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_t.rst rename to infiniband-diags/man/common/opt_t.rst diff --git a/ibdiags/doc/rst/common/opt_v.rst b/infiniband-diags/man/common/opt_v.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_v.rst rename to infiniband-diags/man/common/opt_v.rst diff --git a/ibdiags/doc/rst/common/opt_y.rst b/infiniband-diags/man/common/opt_y.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_y.rst rename to infiniband-diags/man/common/opt_y.rst diff --git a/ibdiags/doc/rst/common/opt_z-config.rst b/infiniband-diags/man/common/opt_z-config.rst similarity index 100% rename from ibdiags/doc/rst/common/opt_z-config.rst rename to infiniband-diags/man/common/opt_z-config.rst diff --git a/ibdiags/doc/rst/common/sec_config-file.rst b/infiniband-diags/man/common/sec_config-file.rst similarity index 100% rename from ibdiags/doc/rst/common/sec_config-file.rst rename to infiniband-diags/man/common/sec_config-file.rst diff --git a/ibdiags/doc/rst/common/sec_node-name-map.rst b/infiniband-diags/man/common/sec_node-name-map.rst similarity index 100% rename from ibdiags/doc/rst/common/sec_node-name-map.rst rename to infiniband-diags/man/common/sec_node-name-map.rst diff --git a/ibdiags/doc/rst/common/sec_ports-file.rst b/infiniband-diags/man/common/sec_ports-file.rst similarity index 100% rename from ibdiags/doc/rst/common/sec_ports-file.rst rename to infiniband-diags/man/common/sec_ports-file.rst diff --git a/ibdiags/doc/rst/common/sec_portselection.rst b/infiniband-diags/man/common/sec_portselection.rst similarity index 100% rename from ibdiags/doc/rst/common/sec_portselection.rst rename to infiniband-diags/man/common/sec_portselection.rst diff --git a/ibdiags/doc/rst/common/sec_topology-file.rst b/infiniband-diags/man/common/sec_topology-file.rst similarity index 100% rename from ibdiags/doc/rst/common/sec_topology-file.rst rename to infiniband-diags/man/common/sec_topology-file.rst diff --git a/ibdiags/doc/rst/dump_fts.8.in.rst b/infiniband-diags/man/dump_fts.8.in.rst similarity index 100% rename from ibdiags/doc/rst/dump_fts.8.in.rst rename to infiniband-diags/man/dump_fts.8.in.rst diff --git a/ibdiags/doc/rst/ibaddr.8.in.rst b/infiniband-diags/man/ibaddr.8.in.rst similarity index 100% rename from ibdiags/doc/rst/ibaddr.8.in.rst rename to infiniband-diags/man/ibaddr.8.in.rst diff --git a/ibdiags/doc/rst/ibcacheedit.8.in.rst b/infiniband-diags/man/ibcacheedit.8.in.rst similarity index 100% rename from ibdiags/doc/rst/ibcacheedit.8.in.rst rename to infiniband-diags/man/ibcacheedit.8.in.rst diff --git a/ibdiags/doc/rst/ibccconfig.8.in.rst b/infiniband-diags/man/ibccconfig.8.in.rst similarity index 100% rename from ibdiags/doc/rst/ibccconfig.8.in.rst rename to infiniband-diags/man/ibccconfig.8.in.rst diff --git a/ibdiags/doc/rst/ibccquery.8.in.rst b/infiniband-diags/man/ibccquery.8.in.rst similarity index 100% rename from ibdiags/doc/rst/ibccquery.8.in.rst rename to infiniband-diags/man/ibccquery.8.in.rst diff --git a/ibdiags/man/ibcheckerrors.8 b/infiniband-diags/man/ibcheckerrors.8 similarity index 100% rename from ibdiags/man/ibcheckerrors.8 rename to infiniband-diags/man/ibcheckerrors.8 diff --git a/ibdiags/man/ibcheckerrs.8 b/infiniband-diags/man/ibcheckerrs.8 similarity index 100% rename from ibdiags/man/ibcheckerrs.8 rename to infiniband-diags/man/ibcheckerrs.8 diff --git a/ibdiags/man/ibchecknet.8 b/infiniband-diags/man/ibchecknet.8 similarity index 100% rename from ibdiags/man/ibchecknet.8 rename to infiniband-diags/man/ibchecknet.8 diff --git a/ibdiags/man/ibchecknode.8 b/infiniband-diags/man/ibchecknode.8 similarity index 100% rename from ibdiags/man/ibchecknode.8 rename to infiniband-diags/man/ibchecknode.8 diff --git a/ibdiags/man/ibcheckport.8 b/infiniband-diags/man/ibcheckport.8 similarity index 100% rename from ibdiags/man/ibcheckport.8 rename to infiniband-diags/man/ibcheckport.8 diff --git a/ibdiags/man/ibcheckportstate.8 b/infiniband-diags/man/ibcheckportstate.8 similarity index 100% rename from ibdiags/man/ibcheckportstate.8 rename to infiniband-diags/man/ibcheckportstate.8 diff --git a/ibdiags/man/ibcheckportwidth.8 b/infiniband-diags/man/ibcheckportwidth.8 similarity index 100% rename from ibdiags/man/ibcheckportwidth.8 rename to infiniband-diags/man/ibcheckportwidth.8 diff --git a/ibdiags/man/ibcheckstate.8 b/infiniband-diags/man/ibcheckstate.8 similarity index 100% rename from ibdiags/man/ibcheckstate.8 rename to infiniband-diags/man/ibcheckstate.8 diff --git a/ibdiags/man/ibcheckwidth.8 b/infiniband-diags/man/ibcheckwidth.8 similarity index 100% rename from ibdiags/man/ibcheckwidth.8 rename to infiniband-diags/man/ibcheckwidth.8 diff --git a/ibdiags/man/ibclearcounters.8 b/infiniband-diags/man/ibclearcounters.8 similarity index 100% rename from ibdiags/man/ibclearcounters.8 rename to infiniband-diags/man/ibclearcounters.8 diff --git a/ibdiags/man/ibclearerrors.8 b/infiniband-diags/man/ibclearerrors.8 similarity index 100% rename from ibdiags/man/ibclearerrors.8 rename to infiniband-diags/man/ibclearerrors.8 diff --git a/ibdiags/man/ibdatacounters.8 b/infiniband-diags/man/ibdatacounters.8 similarity index 100% rename from ibdiags/man/ibdatacounters.8 rename to infiniband-diags/man/ibdatacounters.8 diff --git a/ibdiags/man/ibdatacounts.8 b/infiniband-diags/man/ibdatacounts.8 similarity index 100% rename from ibdiags/man/ibdatacounts.8 rename to infiniband-diags/man/ibdatacounts.8 diff --git a/ibdiags/man/ibdiscover.8 b/infiniband-diags/man/ibdiscover.8 similarity index 100% rename from ibdiags/man/ibdiscover.8 rename to infiniband-diags/man/ibdiscover.8 diff --git a/ibdiags/doc/rst/ibfindnodesusing.8.in.rst b/infiniband-diags/man/ibfindnodesusing.8.in.rst similarity index 100% rename from ibdiags/doc/rst/ibfindnodesusing.8.in.rst rename to infiniband-diags/man/ibfindnodesusing.8.in.rst diff --git a/ibdiags/doc/rst/ibhosts.8.in.rst b/infiniband-diags/man/ibhosts.8.in.rst similarity index 100% rename from ibdiags/doc/rst/ibhosts.8.in.rst rename to infiniband-diags/man/ibhosts.8.in.rst diff --git a/ibdiags/doc/rst/ibidsverify.8.in.rst b/infiniband-diags/man/ibidsverify.8.in.rst similarity index 100% rename from ibdiags/doc/rst/ibidsverify.8.in.rst rename to infiniband-diags/man/ibidsverify.8.in.rst diff --git a/ibdiags/doc/rst/iblinkinfo.8.in.rst b/infiniband-diags/man/iblinkinfo.8.in.rst similarity index 100% rename from ibdiags/doc/rst/iblinkinfo.8.in.rst rename to infiniband-diags/man/iblinkinfo.8.in.rst diff --git a/ibdiags/doc/rst/ibnetdiscover.8.in.rst b/infiniband-diags/man/ibnetdiscover.8.in.rst similarity index 100% rename from ibdiags/doc/rst/ibnetdiscover.8.in.rst rename to infiniband-diags/man/ibnetdiscover.8.in.rst diff --git a/ibdiags/doc/rst/ibnodes.8.in.rst b/infiniband-diags/man/ibnodes.8.in.rst similarity index 100% rename from ibdiags/doc/rst/ibnodes.8.in.rst rename to infiniband-diags/man/ibnodes.8.in.rst diff --git a/ibdiags/doc/rst/ibping.8.in.rst b/infiniband-diags/man/ibping.8.in.rst similarity index 100% rename from ibdiags/doc/rst/ibping.8.in.rst rename to infiniband-diags/man/ibping.8.in.rst diff --git a/ibdiags/doc/rst/ibportstate.8.in.rst b/infiniband-diags/man/ibportstate.8.in.rst similarity index 100% rename from ibdiags/doc/rst/ibportstate.8.in.rst rename to infiniband-diags/man/ibportstate.8.in.rst diff --git a/ibdiags/man/ibprintca.8 b/infiniband-diags/man/ibprintca.8 similarity index 100% rename from ibdiags/man/ibprintca.8 rename to infiniband-diags/man/ibprintca.8 diff --git a/ibdiags/man/ibprintrt.8 b/infiniband-diags/man/ibprintrt.8 similarity index 100% rename from ibdiags/man/ibprintrt.8 rename to infiniband-diags/man/ibprintrt.8 diff --git a/ibdiags/man/ibprintswitch.8 b/infiniband-diags/man/ibprintswitch.8 similarity index 100% rename from ibdiags/man/ibprintswitch.8 rename to infiniband-diags/man/ibprintswitch.8 diff --git a/ibdiags/doc/rst/ibqueryerrors.8.in.rst b/infiniband-diags/man/ibqueryerrors.8.in.rst similarity index 100% rename from ibdiags/doc/rst/ibqueryerrors.8.in.rst rename to infiniband-diags/man/ibqueryerrors.8.in.rst diff --git a/ibdiags/doc/rst/ibroute.8.in.rst b/infiniband-diags/man/ibroute.8.in.rst similarity index 100% rename from ibdiags/doc/rst/ibroute.8.in.rst rename to infiniband-diags/man/ibroute.8.in.rst diff --git a/ibdiags/doc/rst/ibrouters.8.in.rst b/infiniband-diags/man/ibrouters.8.in.rst similarity index 100% rename from ibdiags/doc/rst/ibrouters.8.in.rst rename to infiniband-diags/man/ibrouters.8.in.rst diff --git a/ibdiags/doc/rst/ibstat.8.in.rst b/infiniband-diags/man/ibstat.8.in.rst similarity index 100% rename from ibdiags/doc/rst/ibstat.8.in.rst rename to infiniband-diags/man/ibstat.8.in.rst diff --git a/ibdiags/doc/rst/ibstatus.8.in.rst b/infiniband-diags/man/ibstatus.8.in.rst similarity index 100% rename from ibdiags/doc/rst/ibstatus.8.in.rst rename to infiniband-diags/man/ibstatus.8.in.rst diff --git a/ibdiags/doc/rst/ibswitches.8.in.rst b/infiniband-diags/man/ibswitches.8.in.rst similarity index 100% rename from ibdiags/doc/rst/ibswitches.8.in.rst rename to infiniband-diags/man/ibswitches.8.in.rst diff --git a/ibdiags/man/ibswportwatch.8 b/infiniband-diags/man/ibswportwatch.8 similarity index 100% rename from ibdiags/man/ibswportwatch.8 rename to infiniband-diags/man/ibswportwatch.8 diff --git a/ibdiags/doc/rst/ibsysstat.8.in.rst b/infiniband-diags/man/ibsysstat.8.in.rst similarity index 100% rename from ibdiags/doc/rst/ibsysstat.8.in.rst rename to infiniband-diags/man/ibsysstat.8.in.rst diff --git a/ibdiags/doc/rst/ibtracert.8.in.rst b/infiniband-diags/man/ibtracert.8.in.rst similarity index 100% rename from ibdiags/doc/rst/ibtracert.8.in.rst rename to infiniband-diags/man/ibtracert.8.in.rst diff --git a/ibdiags/doc/rst/infiniband-diags.8.in.rst b/infiniband-diags/man/infiniband-diags.8.in.rst similarity index 100% rename from ibdiags/doc/rst/infiniband-diags.8.in.rst rename to infiniband-diags/man/infiniband-diags.8.in.rst diff --git a/ibdiags/doc/rst/perfquery.8.in.rst b/infiniband-diags/man/perfquery.8.in.rst similarity index 100% rename from ibdiags/doc/rst/perfquery.8.in.rst rename to infiniband-diags/man/perfquery.8.in.rst diff --git a/ibdiags/doc/rst/saquery.8.in.rst b/infiniband-diags/man/saquery.8.in.rst similarity index 100% rename from ibdiags/doc/rst/saquery.8.in.rst rename to infiniband-diags/man/saquery.8.in.rst diff --git a/ibdiags/doc/rst/sminfo.8.in.rst b/infiniband-diags/man/sminfo.8.in.rst similarity index 100% rename from ibdiags/doc/rst/sminfo.8.in.rst rename to infiniband-diags/man/sminfo.8.in.rst diff --git a/ibdiags/doc/rst/smpdump.8.in.rst b/infiniband-diags/man/smpdump.8.in.rst similarity index 100% rename from ibdiags/doc/rst/smpdump.8.in.rst rename to infiniband-diags/man/smpdump.8.in.rst diff --git a/ibdiags/doc/rst/smpquery.8.in.rst b/infiniband-diags/man/smpquery.8.in.rst similarity index 100% rename from ibdiags/doc/rst/smpquery.8.in.rst rename to infiniband-diags/man/smpquery.8.in.rst diff --git a/ibdiags/doc/rst/vendstat.8.in.rst b/infiniband-diags/man/vendstat.8.in.rst similarity index 100% rename from ibdiags/doc/rst/vendstat.8.in.rst rename to infiniband-diags/man/vendstat.8.in.rst diff --git a/ibdiags/src/mcm_rereg_test.c b/infiniband-diags/mcm_rereg_test.c similarity index 100% rename from ibdiags/src/mcm_rereg_test.c rename to infiniband-diags/mcm_rereg_test.c diff --git a/ibdiags/src/perfquery.c b/infiniband-diags/perfquery.c similarity index 100% rename from ibdiags/src/perfquery.c rename to infiniband-diags/perfquery.c diff --git a/ibdiags/src/saquery.c b/infiniband-diags/saquery.c similarity index 100% rename from ibdiags/src/saquery.c rename to infiniband-diags/saquery.c diff --git a/ibdiags/scripts/CMakeLists.txt b/infiniband-diags/scripts/CMakeLists.txt similarity index 96% rename from ibdiags/scripts/CMakeLists.txt rename to infiniband-diags/scripts/CMakeLists.txt index 3d65ed837a2d83..ae4dcc5b7d9cbe 100644 --- a/ibdiags/scripts/CMakeLists.txt +++ b/infiniband-diags/scripts/CMakeLists.txt @@ -84,11 +84,6 @@ rdma_sbin_perl_program( install(FILES "IBswcountlimits.pm" DESTINATION "${CMAKE_INSTALL_PERLDIR}") -install(FILES - "../etc/error_thresholds" - "../etc/ibdiag.conf" - DESTINATION "${IBDIAG_CONFIG_PATH}") - if (WITH_IBDIAGS_COMPAT) rdma_sbin_shell_program( ibcheckerrors.in diff --git a/ibdiags/scripts/IBswcountlimits.pm b/infiniband-diags/scripts/IBswcountlimits.pm similarity index 100% rename from ibdiags/scripts/IBswcountlimits.pm rename to infiniband-diags/scripts/IBswcountlimits.pm diff --git a/ibdiags/scripts/check_lft_balance.pl b/infiniband-diags/scripts/check_lft_balance.pl similarity index 100% rename from ibdiags/scripts/check_lft_balance.pl rename to infiniband-diags/scripts/check_lft_balance.pl diff --git a/ibdiags/scripts/dump_lfts.sh.in b/infiniband-diags/scripts/dump_lfts.sh.in similarity index 100% rename from ibdiags/scripts/dump_lfts.sh.in rename to infiniband-diags/scripts/dump_lfts.sh.in diff --git a/ibdiags/scripts/dump_mfts.sh.in b/infiniband-diags/scripts/dump_mfts.sh.in similarity index 100% rename from ibdiags/scripts/dump_mfts.sh.in rename to infiniband-diags/scripts/dump_mfts.sh.in diff --git a/ibdiags/scripts/ibcheckerrors.in b/infiniband-diags/scripts/ibcheckerrors.in similarity index 100% rename from ibdiags/scripts/ibcheckerrors.in rename to infiniband-diags/scripts/ibcheckerrors.in diff --git a/ibdiags/scripts/ibcheckerrs.in b/infiniband-diags/scripts/ibcheckerrs.in similarity index 100% rename from ibdiags/scripts/ibcheckerrs.in rename to infiniband-diags/scripts/ibcheckerrs.in diff --git a/ibdiags/scripts/ibchecknet.in b/infiniband-diags/scripts/ibchecknet.in similarity index 100% rename from ibdiags/scripts/ibchecknet.in rename to infiniband-diags/scripts/ibchecknet.in diff --git a/ibdiags/scripts/ibchecknode.in b/infiniband-diags/scripts/ibchecknode.in similarity index 100% rename from ibdiags/scripts/ibchecknode.in rename to infiniband-diags/scripts/ibchecknode.in diff --git a/ibdiags/scripts/ibcheckport.in b/infiniband-diags/scripts/ibcheckport.in similarity index 100% rename from ibdiags/scripts/ibcheckport.in rename to infiniband-diags/scripts/ibcheckport.in diff --git a/ibdiags/scripts/ibcheckportstate.in b/infiniband-diags/scripts/ibcheckportstate.in similarity index 100% rename from ibdiags/scripts/ibcheckportstate.in rename to infiniband-diags/scripts/ibcheckportstate.in diff --git a/ibdiags/scripts/ibcheckportwidth.in b/infiniband-diags/scripts/ibcheckportwidth.in similarity index 100% rename from ibdiags/scripts/ibcheckportwidth.in rename to infiniband-diags/scripts/ibcheckportwidth.in diff --git a/ibdiags/scripts/ibcheckstate.in b/infiniband-diags/scripts/ibcheckstate.in similarity index 100% rename from ibdiags/scripts/ibcheckstate.in rename to infiniband-diags/scripts/ibcheckstate.in diff --git a/ibdiags/scripts/ibcheckwidth.in b/infiniband-diags/scripts/ibcheckwidth.in similarity index 100% rename from ibdiags/scripts/ibcheckwidth.in rename to infiniband-diags/scripts/ibcheckwidth.in diff --git a/ibdiags/scripts/ibclearcounters.in b/infiniband-diags/scripts/ibclearcounters.in similarity index 100% rename from ibdiags/scripts/ibclearcounters.in rename to infiniband-diags/scripts/ibclearcounters.in diff --git a/ibdiags/scripts/ibclearerrors.in b/infiniband-diags/scripts/ibclearerrors.in similarity index 100% rename from ibdiags/scripts/ibclearerrors.in rename to infiniband-diags/scripts/ibclearerrors.in diff --git a/ibdiags/scripts/ibdatacounters.in b/infiniband-diags/scripts/ibdatacounters.in similarity index 100% rename from ibdiags/scripts/ibdatacounters.in rename to infiniband-diags/scripts/ibdatacounters.in diff --git a/ibdiags/scripts/ibdatacounts.in b/infiniband-diags/scripts/ibdatacounts.in similarity index 100% rename from ibdiags/scripts/ibdatacounts.in rename to infiniband-diags/scripts/ibdatacounts.in diff --git a/ibdiags/scripts/ibdiscover.map b/infiniband-diags/scripts/ibdiscover.map similarity index 100% rename from ibdiags/scripts/ibdiscover.map rename to infiniband-diags/scripts/ibdiscover.map diff --git a/ibdiags/scripts/ibdiscover.pl b/infiniband-diags/scripts/ibdiscover.pl similarity index 100% rename from ibdiags/scripts/ibdiscover.pl rename to infiniband-diags/scripts/ibdiscover.pl diff --git a/ibdiags/scripts/ibfindnodesusing.pl b/infiniband-diags/scripts/ibfindnodesusing.pl similarity index 100% rename from ibdiags/scripts/ibfindnodesusing.pl rename to infiniband-diags/scripts/ibfindnodesusing.pl diff --git a/ibdiags/scripts/ibhosts.in b/infiniband-diags/scripts/ibhosts.in similarity index 100% rename from ibdiags/scripts/ibhosts.in rename to infiniband-diags/scripts/ibhosts.in diff --git a/ibdiags/scripts/ibidsverify.pl b/infiniband-diags/scripts/ibidsverify.pl similarity index 100% rename from ibdiags/scripts/ibidsverify.pl rename to infiniband-diags/scripts/ibidsverify.pl diff --git a/ibdiags/scripts/iblinkinfo.pl.in b/infiniband-diags/scripts/iblinkinfo.pl.in similarity index 100% rename from ibdiags/scripts/iblinkinfo.pl.in rename to infiniband-diags/scripts/iblinkinfo.pl.in diff --git a/ibdiags/scripts/ibnodes.in b/infiniband-diags/scripts/ibnodes.in similarity index 100% rename from ibdiags/scripts/ibnodes.in rename to infiniband-diags/scripts/ibnodes.in diff --git a/ibdiags/scripts/ibprintca.pl b/infiniband-diags/scripts/ibprintca.pl similarity index 100% rename from ibdiags/scripts/ibprintca.pl rename to infiniband-diags/scripts/ibprintca.pl diff --git a/ibdiags/scripts/ibprintrt.pl b/infiniband-diags/scripts/ibprintrt.pl similarity index 100% rename from ibdiags/scripts/ibprintrt.pl rename to infiniband-diags/scripts/ibprintrt.pl diff --git a/ibdiags/scripts/ibprintswitch.pl b/infiniband-diags/scripts/ibprintswitch.pl similarity index 100% rename from ibdiags/scripts/ibprintswitch.pl rename to infiniband-diags/scripts/ibprintswitch.pl diff --git a/ibdiags/scripts/ibqueryerrors.pl.in b/infiniband-diags/scripts/ibqueryerrors.pl.in similarity index 100% rename from ibdiags/scripts/ibqueryerrors.pl.in rename to infiniband-diags/scripts/ibqueryerrors.pl.in diff --git a/ibdiags/scripts/ibrouters.in b/infiniband-diags/scripts/ibrouters.in similarity index 100% rename from ibdiags/scripts/ibrouters.in rename to infiniband-diags/scripts/ibrouters.in diff --git a/ibdiags/scripts/ibstatus b/infiniband-diags/scripts/ibstatus similarity index 100% rename from ibdiags/scripts/ibstatus rename to infiniband-diags/scripts/ibstatus diff --git a/ibdiags/scripts/ibswitches.in b/infiniband-diags/scripts/ibswitches.in similarity index 100% rename from ibdiags/scripts/ibswitches.in rename to infiniband-diags/scripts/ibswitches.in diff --git a/ibdiags/scripts/ibswportwatch.pl b/infiniband-diags/scripts/ibswportwatch.pl similarity index 100% rename from ibdiags/scripts/ibswportwatch.pl rename to infiniband-diags/scripts/ibswportwatch.pl diff --git a/ibdiags/scripts/set_nodedesc.sh b/infiniband-diags/scripts/set_nodedesc.sh similarity index 100% rename from ibdiags/scripts/set_nodedesc.sh rename to infiniband-diags/scripts/set_nodedesc.sh diff --git a/ibdiags/src/sminfo.c b/infiniband-diags/sminfo.c similarity index 100% rename from ibdiags/src/sminfo.c rename to infiniband-diags/sminfo.c diff --git a/ibdiags/src/smpdump.c b/infiniband-diags/smpdump.c similarity index 100% rename from ibdiags/src/smpdump.c rename to infiniband-diags/smpdump.c diff --git a/ibdiags/src/smpquery.c b/infiniband-diags/smpquery.c similarity index 100% rename from ibdiags/src/smpquery.c rename to infiniband-diags/smpquery.c diff --git a/ibdiags/src/vendstat.c b/infiniband-diags/vendstat.c similarity index 100% rename from ibdiags/src/vendstat.c rename to infiniband-diags/vendstat.c From patchwork Tue May 14 23:49:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10944117 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6A5841515 for ; Wed, 15 May 2019 00:11:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 585B3289A2 for ; Wed, 15 May 2019 00:11:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56FDA289AD; Wed, 15 May 2019 00:11: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 355D3289B7 for ; Wed, 15 May 2019 00:11:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726779AbfEOALK (ORCPT ); Tue, 14 May 2019 20:11:10 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:46666 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726573AbfEOALJ (ORCPT ); Tue, 14 May 2019 20:11:09 -0400 Received: by mail-qk1-f194.google.com with SMTP id a132so396069qkb.13 for ; Tue, 14 May 2019 17:11:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=59b8x1edAQWmwSWxl8VW8jf4z3L4GbINoJZWNaUB12I=; b=V+/9i2/mw3Eu3kU8rOS9fZPBwQpujc70mg2+P2uKooDow/TE+2/zDLFLwF4F8i/HBb KhgbNa3Uj32K1dsNGz1BX+2ar2Aee9J6iDOv2bY0edU6biK6nA4cL393DV1N3nxHpoSp BFNcMlgsOpGN69jMFvNTyKjn0SGMRf9LwG94lRcK4Q0SZreU81R6JDKA7Zxb86fCFRl6 GwtIMQkqGetlGihTWIDz/kFzlROpFRUrBB6qGJebBWLdTOoF7fhuaP7w5iEfSOe5rwvW mGyBQK+0xxGGO1qV+JSsau+COSJH2d+61JS+K25hePU9P10AvCQIWh3AHOCyUguZ7Mk3 72KQ== 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:mime-version:content-transfer-encoding; bh=59b8x1edAQWmwSWxl8VW8jf4z3L4GbINoJZWNaUB12I=; b=TUz5U99VcrLYHyjr0ZXlInkZTq3tB5qoBY5RVRe1Ll5JwtHtKCgk10TTRVsXt0H70G qgi8e404GhW9kKpBINLVgSQAECGY5OQMDefb5nTHvV2qv250tALtwI+zxYzOB5CjbH75 0RNqT5hjIwQiV9zYa+ekkc8yjg8p7VLeiaZwO7kbSuSanYNJa1kDp4Wmpn0cfMQBjN0n 1M8dfeMW3GGdcA+Fp5LTHsSC9wha2/x9bQHMFqi/0yaHLK4V4pppFLHO1Ylqqubz6JmW kL0MFlvMyM9gu+NgJ1mPtc6M53lp+QmMTAPEuMQlYqTJhYZT62POpqMyhLvmd66Eytui AwDg== X-Gm-Message-State: APjAAAUvRPcnn+VT8JfCDZbme1v+KIamJd0bvgnJ1BQC6Cbm+2G67jU9 hGAZtjHPcxjgkHzhJlW+7vwxzMwwEA8= X-Google-Smtp-Source: APXvYqxoUQHEcobqKKimkmoZNxqY8MYLiQTAQgjy+rGFhWkTCyd5fyarqZZFzgyx90uo8TrZ1ZWQvQ== X-Received: by 2002:a37:4d81:: with SMTP id a123mr13113771qkb.340.1557879068304; Tue, 14 May 2019 17:11:08 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id n201sm150322qka.10.2019.05.14.17.11.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 17:11:07 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hQhAx-0001OU-H2; Tue, 14 May 2019 20:49:39 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 19/20] ibdiags: Remove @BUILD_DATE@ from the man pages Date: Tue, 14 May 2019 20:49:35 -0300 Message-Id: <20190514234936.5175-20-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514234936.5175-1-jgg@ziepe.ca> References: <20190514234936.5175-1-jgg@ziepe.ca> MIME-Version: 1.0 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: Jason Gunthorpe The man page date should be related to the last edit to the man page. Extract this from git using: import sys, os, subprocess, datetime for I in sys.argv[1:]: lns = subprocess.check_output(["git","log","--pretty=format:%ct %cn %s","--follow",I]).splitlines() while b"Jason Gunthorpe" in lns[0]: del lns[0] ts = lns[0].split(b' ')[0] date = datetime.datetime.utcfromtimestamp(int(ts)).strftime('%Y-%m-%d') subprocess.check_call(["sed","-i","-e","s/@BUILD_DATE@/%s/g"%(date),I]) Signed-off-by: Jason Gunthorpe --- infiniband-diags/man/CMakeLists.txt | 2 -- infiniband-diags/man/check_lft_balance.8.in.rst | 2 +- infiniband-diags/man/dump_fts.8.in.rst | 2 +- infiniband-diags/man/ibaddr.8.in.rst | 2 +- infiniband-diags/man/ibcacheedit.8.in.rst | 2 +- infiniband-diags/man/ibccconfig.8.in.rst | 2 +- infiniband-diags/man/ibccquery.8.in.rst | 2 +- infiniband-diags/man/ibfindnodesusing.8.in.rst | 2 +- infiniband-diags/man/ibhosts.8.in.rst | 2 +- infiniband-diags/man/ibidsverify.8.in.rst | 2 +- infiniband-diags/man/iblinkinfo.8.in.rst | 2 +- infiniband-diags/man/ibnetdiscover.8.in.rst | 2 +- infiniband-diags/man/ibnodes.8.in.rst | 2 +- infiniband-diags/man/ibping.8.in.rst | 2 +- infiniband-diags/man/ibportstate.8.in.rst | 2 +- infiniband-diags/man/ibqueryerrors.8.in.rst | 2 +- infiniband-diags/man/ibroute.8.in.rst | 2 +- infiniband-diags/man/ibrouters.8.in.rst | 2 +- infiniband-diags/man/ibstat.8.in.rst | 2 +- infiniband-diags/man/ibstatus.8.in.rst | 2 +- infiniband-diags/man/ibswitches.8.in.rst | 2 +- infiniband-diags/man/ibsysstat.8.in.rst | 2 +- infiniband-diags/man/ibtracert.8.in.rst | 2 +- infiniband-diags/man/infiniband-diags.8.in.rst | 2 +- infiniband-diags/man/perfquery.8.in.rst | 2 +- infiniband-diags/man/saquery.8.in.rst | 2 +- infiniband-diags/man/sminfo.8.in.rst | 2 +- infiniband-diags/man/smpdump.8.in.rst | 2 +- infiniband-diags/man/smpquery.8.in.rst | 2 +- infiniband-diags/man/vendstat.8.in.rst | 2 +- 30 files changed, 29 insertions(+), 31 deletions(-) diff --git a/infiniband-diags/man/CMakeLists.txt b/infiniband-diags/man/CMakeLists.txt index 845fff675f23d4..916a52dcab6cb0 100644 --- a/infiniband-diags/man/CMakeLists.txt +++ b/infiniband-diags/man/CMakeLists.txt @@ -1,5 +1,3 @@ -set(BUILD_DATE "2019") - # rst2man has no way to set the include search path rdma_create_symlink("${CMAKE_CURRENT_SOURCE_DIR}/common" "${CMAKE_CURRENT_BINARY_DIR}/common") diff --git a/infiniband-diags/man/check_lft_balance.8.in.rst b/infiniband-diags/man/check_lft_balance.8.in.rst index 2639a20297ffdf..92b7a8a4c470f4 100644 --- a/infiniband-diags/man/check_lft_balance.8.in.rst +++ b/infiniband-diags/man/check_lft_balance.8.in.rst @@ -6,7 +6,7 @@ check_lft_balance check InfiniBand unicast forwarding tables balance -------------------------------------------------- -:Date: @BUILD_DATE@ +:Date: 2017-08-21 :Manual section: 8 :Manual group: Open IB Diagnostics diff --git a/infiniband-diags/man/dump_fts.8.in.rst b/infiniband-diags/man/dump_fts.8.in.rst index 9b2df5195d1294..a932bc14380816 100644 --- a/infiniband-diags/man/dump_fts.8.in.rst +++ b/infiniband-diags/man/dump_fts.8.in.rst @@ -6,7 +6,7 @@ DUMP_FTS dump InfiniBand forwarding tables --------------------------------- -:Date: @BUILD_DATE@ +:Date: 2013-03-26 :Manual section: 8 :Manual group: OpenIB Diagnostics diff --git a/infiniband-diags/man/ibaddr.8.in.rst b/infiniband-diags/man/ibaddr.8.in.rst index ac18bbf235161a..be080dea8c69e1 100644 --- a/infiniband-diags/man/ibaddr.8.in.rst +++ b/infiniband-diags/man/ibaddr.8.in.rst @@ -6,7 +6,7 @@ IBADDR query InfiniBand address(es) ---------------------------- -:Date: @BUILD_DATE@ +:Date: 2013-10-11 :Manual section: 8 :Manual group: OpenIB Diagnostics diff --git a/infiniband-diags/man/ibcacheedit.8.in.rst b/infiniband-diags/man/ibcacheedit.8.in.rst index 69028cd7d36788..d287142b3c30b4 100644 --- a/infiniband-diags/man/ibcacheedit.8.in.rst +++ b/infiniband-diags/man/ibcacheedit.8.in.rst @@ -6,7 +6,7 @@ ibcacheedit edit an ibnetdiscover cache --------------------------- -:Date: @BUILD_DATE@ +:Date: 2017-08-21 :Manual section: 8 :Manual group: Open IB Diagnostics diff --git a/infiniband-diags/man/ibccconfig.8.in.rst b/infiniband-diags/man/ibccconfig.8.in.rst index e88d8acb33acaf..741d50cb84b63b 100644 --- a/infiniband-diags/man/ibccconfig.8.in.rst +++ b/infiniband-diags/man/ibccconfig.8.in.rst @@ -6,7 +6,7 @@ IBCCCONFIG configure congestion control settings ------------------------------------- -:Date: @BUILD_DATE@ +:Date: 2012-05-31 :Manual section: 8 :Manual group: OpenIB Diagnostics diff --git a/infiniband-diags/man/ibccquery.8.in.rst b/infiniband-diags/man/ibccquery.8.in.rst index 773d2f8d115b36..85c051028a969a 100644 --- a/infiniband-diags/man/ibccquery.8.in.rst +++ b/infiniband-diags/man/ibccquery.8.in.rst @@ -6,7 +6,7 @@ IBCCQUERY query congestion control settings/info -------------------------------------- -:Date: @BUILD_DATE@ +:Date: 2012-05-31 :Manual section: 8 :Manual group: OpenIB Diagnostics diff --git a/infiniband-diags/man/ibfindnodesusing.8.in.rst b/infiniband-diags/man/ibfindnodesusing.8.in.rst index e3ba0aefcda9af..82c34ce1c0f571 100644 --- a/infiniband-diags/man/ibfindnodesusing.8.in.rst +++ b/infiniband-diags/man/ibfindnodesusing.8.in.rst @@ -6,7 +6,7 @@ ibfindnodesusing find a list of end nodes which are routed through the specified switch and port ------------------------------------------------------------------------------- -:Date: @BUILD_DATE@ +:Date: 2017-08-21 :Manual section: 8 :Manual group: Open IB Diagnostics diff --git a/infiniband-diags/man/ibhosts.8.in.rst b/infiniband-diags/man/ibhosts.8.in.rst index 749c35a3b52092..7a7fe61f72039b 100644 --- a/infiniband-diags/man/ibhosts.8.in.rst +++ b/infiniband-diags/man/ibhosts.8.in.rst @@ -6,7 +6,7 @@ IBHOSTS show InfiniBand host nodes in topology -------------------------------------- -:Date: @BUILD_DATE@ +:Date: 2016-12-20 :Manual section: 8 :Manual group: OpenIB Diagnostics diff --git a/infiniband-diags/man/ibidsverify.8.in.rst b/infiniband-diags/man/ibidsverify.8.in.rst index ece8ea0bb7360c..834485dab63d95 100644 --- a/infiniband-diags/man/ibidsverify.8.in.rst +++ b/infiniband-diags/man/ibidsverify.8.in.rst @@ -6,7 +6,7 @@ ibidsverify validate IB identifiers in subnet and report errors --------------------------------------------------- -:Date: @BUILD_DATE@ +:Date: 2017-08-21 :Manual section: 8 :Manual group: Open IB Diagnostics diff --git a/infiniband-diags/man/iblinkinfo.8.in.rst b/infiniband-diags/man/iblinkinfo.8.in.rst index ad4a17d562003c..7e6b24010e2610 100644 --- a/infiniband-diags/man/iblinkinfo.8.in.rst +++ b/infiniband-diags/man/iblinkinfo.8.in.rst @@ -6,7 +6,7 @@ IBLINKINFO report link info for all links in the fabric -------------------------------------------- -:Date: @BUILD_DATE@ +:Date: 2018-07-09 :Manual section: 8 :Manual group: OpenIB Diagnostics diff --git a/infiniband-diags/man/ibnetdiscover.8.in.rst b/infiniband-diags/man/ibnetdiscover.8.in.rst index 61a5667b665985..28bf9e5599bbec 100644 --- a/infiniband-diags/man/ibnetdiscover.8.in.rst +++ b/infiniband-diags/man/ibnetdiscover.8.in.rst @@ -6,7 +6,7 @@ IBNETDISCOVER discover InfiniBand topology ---------------------------- -:Date: @BUILD_DATE@ +:Date: 2013-06-22 :Manual section: 8 :Manual group: Open IB Diagnostics diff --git a/infiniband-diags/man/ibnodes.8.in.rst b/infiniband-diags/man/ibnodes.8.in.rst index d36a03eb99f1df..f6a32d3e9bd6ea 100644 --- a/infiniband-diags/man/ibnodes.8.in.rst +++ b/infiniband-diags/man/ibnodes.8.in.rst @@ -6,7 +6,7 @@ IBNODES show InfiniBand nodes in topology --------------------------------- -:Date: @BUILD_DATE@ +:Date: 2012-05-14 :Manual section: 8 :Manual group: OpenIB Diagnostics diff --git a/infiniband-diags/man/ibping.8.in.rst b/infiniband-diags/man/ibping.8.in.rst index 8dd2e4172313f1..e4d11dbae43b22 100644 --- a/infiniband-diags/man/ibping.8.in.rst +++ b/infiniband-diags/man/ibping.8.in.rst @@ -6,7 +6,7 @@ IBPING ping an InfiniBand address -------------------------- -:Date: @BUILD_DATE@ +:Date: 2012-05-14 :Manual section: 8 :Manual group: Open IB Diagnostics diff --git a/infiniband-diags/man/ibportstate.8.in.rst b/infiniband-diags/man/ibportstate.8.in.rst index 750ee4208d1ff8..da1de4c763174e 100644 --- a/infiniband-diags/man/ibportstate.8.in.rst +++ b/infiniband-diags/man/ibportstate.8.in.rst @@ -6,7 +6,7 @@ IBPORTSTATE handle port (physical) state and link speed of an InfiniBand port ----------------------------------------------------------------- -:Date: @BUILD_DATE@ +:Date: 2013-03-26 :Manual section: 8 :Manual group: Open IB Diagnostics diff --git a/infiniband-diags/man/ibqueryerrors.8.in.rst b/infiniband-diags/man/ibqueryerrors.8.in.rst index 0a7992b80434bd..6ddfc2c9f06b59 100644 --- a/infiniband-diags/man/ibqueryerrors.8.in.rst +++ b/infiniband-diags/man/ibqueryerrors.8.in.rst @@ -6,7 +6,7 @@ IBQUERYERRORS query and report IB port counters --------------------------------- -:Date: @BUILD_DATE@ +:Date: 2016-09-26 :Manual section: 8 :Manual group: OpenIB Diagnostics diff --git a/infiniband-diags/man/ibroute.8.in.rst b/infiniband-diags/man/ibroute.8.in.rst index 4163b80a5e549c..25b10768526139 100644 --- a/infiniband-diags/man/ibroute.8.in.rst +++ b/infiniband-diags/man/ibroute.8.in.rst @@ -6,7 +6,7 @@ ibroute query InfiniBand switch forwarding tables ----------------------------------------- -:Date: @BUILD_DATE@ +:Date: 2017-08-21 :Manual section: 8 :Manual group: Open IB Diagnostics diff --git a/infiniband-diags/man/ibrouters.8.in.rst b/infiniband-diags/man/ibrouters.8.in.rst index 90dbd391eb7eb2..5dc93f5714a84f 100644 --- a/infiniband-diags/man/ibrouters.8.in.rst +++ b/infiniband-diags/man/ibrouters.8.in.rst @@ -6,7 +6,7 @@ IBROUTERS show InfiniBand router nodes in topology ---------------------------------------- -:Date: @BUILD_DATE@ +:Date: 2016-12-20 :Manual section: 8 :Manual group: OpenIB Diagnostics diff --git a/infiniband-diags/man/ibstat.8.in.rst b/infiniband-diags/man/ibstat.8.in.rst index baf2d3d942b1b3..a332de18141ee1 100644 --- a/infiniband-diags/man/ibstat.8.in.rst +++ b/infiniband-diags/man/ibstat.8.in.rst @@ -6,7 +6,7 @@ ibstat query basic status of InfiniBand device(s) ------------------------------------------ -:Date: @BUILD_DATE@ +:Date: 2017-08-21 :Manual section: 8 :Manual group: Open IB Diagnostics diff --git a/infiniband-diags/man/ibstatus.8.in.rst b/infiniband-diags/man/ibstatus.8.in.rst index e2e5b2d40aa352..e9f25e5eeb8c1a 100644 --- a/infiniband-diags/man/ibstatus.8.in.rst +++ b/infiniband-diags/man/ibstatus.8.in.rst @@ -6,7 +6,7 @@ ibstatus query basic status of InfiniBand device(s) ------------------------------------------ -:Date: @BUILD_DATE@ +:Date: 2017-08-21 :Manual section: 8 :Manual group: Open IB Diagnostics diff --git a/infiniband-diags/man/ibswitches.8.in.rst b/infiniband-diags/man/ibswitches.8.in.rst index 2aade835965ec2..15303b84de6404 100644 --- a/infiniband-diags/man/ibswitches.8.in.rst +++ b/infiniband-diags/man/ibswitches.8.in.rst @@ -6,7 +6,7 @@ IBSWITCHES show InfiniBand switch nodes in topology ---------------------------------------- -:Date: @BUILD_DATE@ +:Date: 2016-12-20 :Manual section: 8 :Manual group: OpenIB Diagnostics diff --git a/infiniband-diags/man/ibsysstat.8.in.rst b/infiniband-diags/man/ibsysstat.8.in.rst index df0764f3881e4f..9e8bc6004afdae 100644 --- a/infiniband-diags/man/ibsysstat.8.in.rst +++ b/infiniband-diags/man/ibsysstat.8.in.rst @@ -6,7 +6,7 @@ ibsysstat system status on an InfiniBand address -------------------------------------- -:Date: @BUILD_DATE@ +:Date: 2017-08-21 :Manual section: 8 :Manual group: Open IB Diagnostics diff --git a/infiniband-diags/man/ibtracert.8.in.rst b/infiniband-diags/man/ibtracert.8.in.rst index 8145926509ebad..9dea1578ae2a8c 100644 --- a/infiniband-diags/man/ibtracert.8.in.rst +++ b/infiniband-diags/man/ibtracert.8.in.rst @@ -6,7 +6,7 @@ ibtracert trace InfiniBand path --------------------- -:Date: @BUILD_DATE@ +:Date: 2018-04-02 :Manual section: 8 :Manual group: Open IB Diagnostics diff --git a/infiniband-diags/man/infiniband-diags.8.in.rst b/infiniband-diags/man/infiniband-diags.8.in.rst index 571d4cccfaa0f6..4d2d7aa997db42 100644 --- a/infiniband-diags/man/infiniband-diags.8.in.rst +++ b/infiniband-diags/man/infiniband-diags.8.in.rst @@ -6,7 +6,7 @@ infiniband-diags Diagnostics for InfiniBand Fabrics ---------------------------------- -:Date: @BUILD_DATE@ +:Date: 2017-08-21 :Manual section: 8 :Manual group: Open IB Diagnostics diff --git a/infiniband-diags/man/perfquery.8.in.rst b/infiniband-diags/man/perfquery.8.in.rst index c09c3e1d7deff7..b511a7b4b72912 100644 --- a/infiniband-diags/man/perfquery.8.in.rst +++ b/infiniband-diags/man/perfquery.8.in.rst @@ -6,7 +6,7 @@ perfquery query InfiniBand port counters on a single port ----------------------------------------------- -:Date: @BUILD_DATE@ +:Date: 2017-08-21 :Manual section: 8 :Manual group: Open IB Diagnostics diff --git a/infiniband-diags/man/saquery.8.in.rst b/infiniband-diags/man/saquery.8.in.rst index 9647297b539fe6..93043e1397801e 100644 --- a/infiniband-diags/man/saquery.8.in.rst +++ b/infiniband-diags/man/saquery.8.in.rst @@ -6,7 +6,7 @@ saquery query InfiniBand subnet administration attributes ------------------------------------------------- -:Date: @BUILD_DATE@ +:Date: 2017-08-21 :Manual section: 8 :Manual group: Open IB Diagnostics diff --git a/infiniband-diags/man/sminfo.8.in.rst b/infiniband-diags/man/sminfo.8.in.rst index 4d715d7f205fb0..6ac8e272bc8cdb 100644 --- a/infiniband-diags/man/sminfo.8.in.rst +++ b/infiniband-diags/man/sminfo.8.in.rst @@ -6,7 +6,7 @@ sminfo query InfiniBand SMInfo attribute --------------------------------- -:Date: @BUILD_DATE@ +:Date: 2017-08-21 :Manual section: 8 :Manual group: Open IB Diagnostics diff --git a/infiniband-diags/man/smpdump.8.in.rst b/infiniband-diags/man/smpdump.8.in.rst index 118288f33b1dae..5c7bcfc6553019 100644 --- a/infiniband-diags/man/smpdump.8.in.rst +++ b/infiniband-diags/man/smpdump.8.in.rst @@ -6,7 +6,7 @@ smpdump dump InfiniBand subnet management attributes -------------------------------------------- -:Date: @BUILD_DATE@ +:Date: 2017-08-21 :Manual section: 8 :Manual group: Open IB Diagnostics diff --git a/infiniband-diags/man/smpquery.8.in.rst b/infiniband-diags/man/smpquery.8.in.rst index 8ca98ab378ee67..dcb26fbee9912f 100644 --- a/infiniband-diags/man/smpquery.8.in.rst +++ b/infiniband-diags/man/smpquery.8.in.rst @@ -6,7 +6,7 @@ smpquery query InfiniBand subnet management attributes --------------------------------------------- -:Date: @BUILD_DATE@ +:Date: 2017-08-21 :Manual section: 8 :Manual group: Open IB Diagnostics diff --git a/infiniband-diags/man/vendstat.8.in.rst b/infiniband-diags/man/vendstat.8.in.rst index 7b5e9e6be98d0b..4d2c0a31657065 100644 --- a/infiniband-diags/man/vendstat.8.in.rst +++ b/infiniband-diags/man/vendstat.8.in.rst @@ -6,7 +6,7 @@ vendstat query InfiniBand vendor specific functions ------------------------------------------ -:Date: @BUILD_DATE@ +:Date: 2017-08-21 :Manual section: 8 :Manual group: Open IB Diagnostics From patchwork Tue May 14 23:49:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10944119 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 92F221390 for ; Wed, 15 May 2019 00:11:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81EFF289B9 for ; Wed, 15 May 2019 00:11:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 766FF289A2; Wed, 15 May 2019 00:11: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 0DA43289A7 for ; Wed, 15 May 2019 00:11:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726778AbfEOALL (ORCPT ); Tue, 14 May 2019 20:11:11 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:34046 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726791AbfEOALK (ORCPT ); Tue, 14 May 2019 20:11:10 -0400 Received: by mail-qt1-f196.google.com with SMTP id h1so1314181qtp.1 for ; Tue, 14 May 2019 17:11:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KioAskpYCmmaTHobDhRzoq7PduNpGDh7K5Ixi39D51M=; b=QjG4t1/PqezqQ32qFU3fqTdQDC9BBDdq3af7nZbLdbHcOkan5hFtvhDYVickoStyj9 +t1+YTs5XaHOeG3cA8qwG/WBfNQ6mhBESMX+iSU6B8cJXPxl8XsXx1PMmoR3NnVKHCjq GMigqoQ6AFgf8huJ0+QH1B2pafFagBxNGYZXl//gDDTLBj+cPZOPz5pwF0lurQxwqclD 7wqTIJ0v4uOt+Vsg2lWW1+lPqJIDkV9GnJ1+FojHPhICypYQy1mtSMN8t1SmSsEBhcQ1 mnRYI6CsG7+iCtnBWVrAl94nQGXogDJTsfxyQWCQ92heZFrGJ+GO2eCc4+PUC/F2/g/c Nr+g== 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:mime-version:content-transfer-encoding; bh=KioAskpYCmmaTHobDhRzoq7PduNpGDh7K5Ixi39D51M=; b=LAcl8dFtWrS6EOZNF/bm1tS59jfWKbkOqB8mi5XW+UEculUoHTdh6j5tI04aNO1ck4 /OyKMMcGciPGd796rR5kfDAYuDgU7gtgInwl1nFkm5MHBq3904cq0KSiI/bkl158Irda 4R1d1PeyJ5EUMGJKd/aDFYlxwsOvKnltYzL5Crz75igRnBLl4FhmpQNOcgG1czeMPNZg WPA5PioOsoeXFSutlczfR/MK4SEuVbru9gIJluaH7m4eSn5YdV5bKMIwFQYE+jBIKANC doW8AuBxOgYlVw6uFaRJr2myZBMuQdFCA/n2viAvP0d80dHC+QMSMG2YsXvRV/vbRf45 Q54w== X-Gm-Message-State: APjAAAVq3WOZ+6rpnaEQYzwDZS426S+VFaklUikk73YdiaDwF1m5+D/V XsZYzSpqoPNiJ3XFFhDRGpc9200SUMo= X-Google-Smtp-Source: APXvYqz5dSPF9rSNIsrQ92+HslghDsffKgaeEx8j4hlNdN+zjeuL81YUn9OKXRb4ZpUbJJud19fw1Q== X-Received: by 2002:a0c:b0ea:: with SMTP id p39mr31312551qvc.242.1557879069970; Tue, 14 May 2019 17:11:09 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id c30sm414573qta.25.2019.05.14.17.11.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 17:11:09 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hQhAx-0001Oa-Iw; Tue, 14 May 2019 20:49:39 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 20/20] ibdiags: Perform substitution on the RST include files as well Date: Tue, 14 May 2019 20:49:36 -0300 Message-Id: <20190514234936.5175-21-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514234936.5175-1-jgg@ziepe.ca> References: <20190514234936.5175-1-jgg@ziepe.ca> MIME-Version: 1.0 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: Jason Gunthorpe These have @ directives but are not marked as .in so they never got substituted. Rename them and run them through substitution and arrange for rst2man to pick them up. Signed-off-by: Jason Gunthorpe --- infiniband-diags/man/CMakeLists.txt | 48 ++++++++++++++++++- .../{opt_z-config.rst => opt_z-config.in.rst} | 0 ...config-file.rst => sec_config-file.in.rst} | 0 3 files changed, 46 insertions(+), 2 deletions(-) rename infiniband-diags/man/common/{opt_z-config.rst => opt_z-config.in.rst} (100%) rename infiniband-diags/man/common/{sec_config-file.rst => sec_config-file.in.rst} (100%) diff --git a/infiniband-diags/man/CMakeLists.txt b/infiniband-diags/man/CMakeLists.txt index 916a52dcab6cb0..3cc2c643c2287c 100644 --- a/infiniband-diags/man/CMakeLists.txt +++ b/infiniband-diags/man/CMakeLists.txt @@ -1,5 +1,49 @@ -# rst2man has no way to set the include search path -rdma_create_symlink("${CMAKE_CURRENT_SOURCE_DIR}/common" "${CMAKE_CURRENT_BINARY_DIR}/common") +# rst2man has no way to set the include search path and we need to substitute +# into the common files, so subst/link them all into the build directory +function(rdma_rst_common) + foreach(I ${ARGN}) + if ("${I}" MATCHES "\\.in.rst$") + string(REGEX REPLACE "^(.+)\\.in.rst$" "\\1" BASE_NAME "${I}") + configure_file("common/${I}" "${CMAKE_CURRENT_BINARY_DIR}/common/${BASE_NAME}.rst" @ONLY) + else() + if (NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) + rdma_create_symlink("${CMAKE_CURRENT_SOURCE_DIR}/common/${I}" "${CMAKE_CURRENT_BINARY_DIR}/common/${I}") + endif() + endif() + endforeach() +endfunction() + +rdma_rst_common( + opt_cache.rst + opt_C.rst + opt_diffcheck.rst + opt_diff.rst + opt_d.rst + opt_D.rst + opt_D_with_param.rst + opt_e.rst + opt_G.rst + opt_G_with_param.rst + opt_h.rst + opt_K.rst + opt_load-cache.rst + opt_L.rst + opt_node_name_map.rst + opt_o-outstanding_smps.rst + opt_ports-file.rst + opt_P.rst + opt_s.rst + opt_t.rst + opt_v.rst + opt_V.rst + opt_y.rst + opt_z-config.in.rst + sec_config-file.in.rst + sec_node-name-map.rst + sec_portselection.rst + sec_ports-file.rst + sec_topology-file.rst +) rdma_man_pages( check_lft_balance.8.in.rst diff --git a/infiniband-diags/man/common/opt_z-config.rst b/infiniband-diags/man/common/opt_z-config.in.rst similarity index 100% rename from infiniband-diags/man/common/opt_z-config.rst rename to infiniband-diags/man/common/opt_z-config.in.rst diff --git a/infiniband-diags/man/common/sec_config-file.rst b/infiniband-diags/man/common/sec_config-file.in.rst similarity index 100% rename from infiniband-diags/man/common/sec_config-file.rst rename to infiniband-diags/man/common/sec_config-file.in.rst