From patchwork Thu Jun 13 21:26:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Chu X-Patchwork-Id: 2718631 X-Patchwork-Delegate: ira.weiny@intel.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D9D139F8E4 for ; Thu, 13 Jun 2013 21:36:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C789720294 for ; Thu, 13 Jun 2013 21:36:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D06BA20286 for ; Thu, 13 Jun 2013 21:36:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757804Ab3FMVgT (ORCPT ); Thu, 13 Jun 2013 17:36:19 -0400 Received: from prdiron-3.llnl.gov ([128.15.143.173]:9635 "EHLO prdiron-3.llnl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755565Ab3FMVgS (ORCPT ); Thu, 13 Jun 2013 17:36:18 -0400 X-Attachments: Received: from auk59.llnl.gov (HELO [134.9.93.24]) ([134.9.93.24]) by prdiron-3.llnl.gov with ESMTP; 13 Jun 2013 14:26:48 -0700 Subject: [PATCH 2/2] ibnetdiscover: Output vlcap in full output format From: Albert Chu To: linux-rdma@vger.kernel.org Date: Thu, 13 Jun 2013 14:26:48 -0700 Message-Id: <1371158808.13124.176.camel@auk59.llnl.gov> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-19.el5) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The additional vlcap information is useful when simulating a fabric in ibsim and fabric VL information is needed. Signed-off-by: Albert L. Chu --- doc/man/ibnetdiscover.8.in | 2 +- doc/rst/ibnetdiscover.8.in.rst | 2 +- src/ibnetdiscover.c | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/man/ibnetdiscover.8.in b/doc/man/ibnetdiscover.8.in index 0c3d8a4..78e7e52 100644 --- a/doc/man/ibnetdiscover.8.in +++ b/doc/man/ibnetdiscover.8.in @@ -63,7 +63,7 @@ List of connected routers Show progress information during discovery. .sp \fB\-f, \-\-full\fP -Show full information (ports\(aq speed and width) +Show full information (ports\(aq speed and width, vlcap) .sp \fB\-p, \-\-ports\fP Obtain a ports report which is a diff --git a/doc/rst/ibnetdiscover.8.in.rst b/doc/rst/ibnetdiscover.8.in.rst index f68db31..61a5667 100644 --- a/doc/rst/ibnetdiscover.8.in.rst +++ b/doc/rst/ibnetdiscover.8.in.rst @@ -50,7 +50,7 @@ List of connected routers Show progress information during discovery. **-f, --full** -Show full information (ports' speed and width) +Show full information (ports' speed and width, vlcap) **-p, --ports** Obtain a ports report which is a diff --git a/src/ibnetdiscover.c b/src/ibnetdiscover.c index b9fb243..c8c19aa 100644 --- a/src/ibnetdiscover.c +++ b/src/ibnetdiscover.c @@ -361,6 +361,8 @@ void out_switch_port(ibnd_port_t * port, int group, char *out_prefix) IB_PORT_LINK_WIDTH_ACTIVE_F); uint32_t ispeed = mad_get_field(port->info, 0, IB_PORT_LINK_SPEED_ACTIVE_F); + uint32_t vlcap = mad_get_field(port->info, 0, + IB_PORT_VL_CAP_F); uint32_t fdr10 = mad_get_field(port->ext_info, 0, IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F); uint32_t cap_mask, espeed; @@ -408,7 +410,7 @@ void out_switch_port(ibnd_port_t * port, int group, char *out_prefix) dump_linkspeedext_compat(espeed, ispeed, fdr10)); if (full_info) - fprintf(f, " s=%d w=%d", ispeed, iwidth); + fprintf(f, " s=%d w=%d v=%d", ispeed, iwidth, vlcap); if (ibnd_is_xsigo_tca(port->remoteport->guid)) fprintf(f, " slot %d", port->portnum); @@ -427,6 +429,8 @@ void out_ca_port(ibnd_port_t * port, int group, char *out_prefix) IB_PORT_LINK_WIDTH_ACTIVE_F); uint32_t ispeed = mad_get_field(port->info, 0, IB_PORT_LINK_SPEED_ACTIVE_F); + uint32_t vlcap = mad_get_field(port->info, 0, + IB_PORT_VL_CAP_F); uint32_t fdr10 = mad_get_field(port->ext_info, 0, IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F); uint32_t cap_mask, espeed; @@ -464,7 +468,7 @@ void out_ca_port(ibnd_port_t * port, int group, char *out_prefix) dump_linkspeedext_compat(espeed, ispeed, fdr10)); if (full_info) - fprintf(f, " s=%d w=%d", ispeed, iwidth); + fprintf(f, " s=%d w=%d v=%d", ispeed, iwidth, vlcap); fprintf(f, "\n"); free(rem_nodename); @@ -1063,7 +1067,7 @@ int main(int argc, char **argv) ibnd_fabric_t *diff_fabric = NULL; const struct ibdiag_opt opts[] = { - {"full", 'f', 0, NULL, "show full information (ports' speed and width)"}, + {"full", 'f', 0, NULL, "show full information (ports' speed and width, vlcap)"}, {"show", 's', 0, NULL, "show more information"}, {"list", 'l', 0, NULL, "list of connected nodes"}, {"grouping", 'g', 0, NULL, "show grouping"},