From patchwork Wed Jun 26 21:24:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Becker X-Patchwork-Id: 2788761 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 08C11C0AB1 for ; Wed, 26 Jun 2013 21:57:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CB3422021B for ; Wed, 26 Jun 2013 21:57:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7CA4520210 for ; Wed, 26 Jun 2013 21:57:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751907Ab3FZV5V (ORCPT ); Wed, 26 Jun 2013 17:57:21 -0400 Received: from ndjsnpf01.ndc.nasa.gov ([198.117.1.121]:34484 "EHLO ndjsnpf01.ndc.nasa.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752516Ab3FZV5T (ORCPT ); Wed, 26 Jun 2013 17:57:19 -0400 X-Greylist: delayed 1995 seconds by postgrey-1.27 at vger.kernel.org; Wed, 26 Jun 2013 17:57:18 EDT Received: from ndjsppt102.ndc.nasa.gov (NDJSPPT102.ndc.nasa.gov [198.117.1.196]) by ndjsnpf01.ndc.nasa.gov (Postfix) with ESMTP id BB93AD02DF; Wed, 26 Jun 2013 16:24:07 -0500 (CDT) Received: from NDJSCHT104.ndc.nasa.gov (NDJSCHT104-pub.ndc.nasa.gov [198.117.1.204]) by ndjsppt102.ndc.nasa.gov (8.14.5/8.14.5) with ESMTP id r5QLO2hR017928; Wed, 26 Jun 2013 16:24:02 -0500 Received: from linux113.nas.nasa.gov (129.99.133.113) by smtp01.ndc.nasa.gov (198.117.1.204) with Microsoft SMTP Server (TLS) id 14.2.328.9; Wed, 26 Jun 2013 16:24:02 -0500 Message-ID: <51CB5BF1.1090601@nasa.gov> Date: Wed, 26 Jun 2013 14:24:01 -0700 From: Jeff Becker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130513 Thunderbird/17.0.6 MIME-Version: 1.0 To: Hal Rosenstock CC: linux-rdma , "Ciotti, Robert B. (ARC-TNE)" , Dale Talcott Subject: PATCH: opensm enhancements X-Originating-IP: [129.99.133.113] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-06-26_08:2013-06-26, 2013-06-26, 1970-01-01 signatures=0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=unavailable 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 Hi Hal. At the OFA workshop, I mentioned that I've been working on some modifications to opensm that we use at NASA. Following extensive testing of these applied to opensm 3.3.13 (the version we run here), I have ported these to top of tree opensm, and have tested them on a small cluster. The first patch modifies the console logflush command to take "on" or "off" as an argument for toggling. The second (more extensive) patch adds a command line option to specify a file in which each line contains a switch GUID/port pair to be ignored by opensm. The idea is to specify this file when you start opensm (it can be empty), and add ports to ignore (one per line for each end of a connection) to the file. At the next heavy sweep (or HUP) the sm will reprogram the forwarding tables without including the ignored links. We use this for replacing cables, as well as for system expansion (adding new racks). Please let me know if you have any questions/issues with these. Thanks. -jeff From cfb1c75a2b3fe7862f376bba44ebe3671b976ccd Mon Sep 17 00:00:00 2001 From: Jeffrey C. Becker Date: Tue, 25 Jun 2013 10:29:45 -0700 Subject: [PATCH 1/2] opensm: permit toggling log flush from console Signed-off-by: Jeff Becker --- opensm/osm_console.c | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/opensm/osm_console.c b/opensm/osm_console.c index 0f80bdb..c065453 100644 --- a/opensm/osm_console.c +++ b/opensm/osm_console.c @@ -178,7 +178,7 @@ static void help_status(FILE * out, int detail) static void help_logflush(FILE * out, int detail) { - fprintf(out, "logflush -- flush the opensm.log file\n"); + fprintf(out, "logflush [on|off] -- toggle opensm.log file flushing\n"); } static void help_querylid(FILE * out, int detail) @@ -599,7 +599,21 @@ static void sweep_parse(char **p_last, osm_opensm_t * p_osm, FILE * out) static void logflush_parse(char **p_last, osm_opensm_t * p_osm, FILE * out) { - fflush(p_osm->log.out_port); + char *p_cmd; + + p_cmd = next_token(p_last); + if (!p_cmd || + (strcmp(p_cmd, "on") != 0 && strcmp(p_cmd, "off") != 0)) { + fprintf(out, "Invalid logflush command\n"); + help_sweep(out, 1); + } else { + if (strcmp(p_cmd, "on") == 0) { + p_osm->log.flush = TRUE; + fflush(p_osm->log.out_port); + } + else + p_osm->log.flush = FALSE; + } } static void querylid_parse(char **p_last, osm_opensm_t * p_osm, FILE * out)