From patchwork Mon Jan 7 19:50:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 1942351 X-Patchwork-Delegate: alexne@voltaire.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 7D43F3FE37 for ; Mon, 7 Jan 2013 19:50:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753426Ab3AGTuN (ORCPT ); Mon, 7 Jan 2013 14:50:13 -0500 Received: from mail-ob0-f169.google.com ([209.85.214.169]:46454 "EHLO mail-ob0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751536Ab3AGTuM (ORCPT ); Mon, 7 Jan 2013 14:50:12 -0500 Received: by mail-ob0-f169.google.com with SMTP id v19so17824895obq.28 for ; Mon, 07 Jan 2013 11:50:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:content-type:content-transfer-encoding:x-gm-message-state; bh=40fFNP0GpXHchcIrWc3TCzGizuS2/wSJOOVqG7FydbQ=; b=iMTUPLu92jxjiiC2+nO660KIvBTBSxzql4bIJF8wNic8dxX4nB8etZ7/h0Wm7/VYuI 9GpomcgEMzcuaC7nZ5HzFf7Sfs8FOcGkYZx/G821ngM0qptvc2YaDxcwBo1RL69xngkS xhJa8Du+JwOGBIdrr13S1CjBGzp2esFLefQdyCNHzbmPY8OmQB6Q5oEx6pbR5Jvf5SfU OLdj5Z4zPFaZY7q+58cvivMjqkBHJErIqD92nc5OyiO22QIBgP0VCwuUkwJA8ayB4TUk diT1fM2sOWT4NIW7kg/BqOZ8lg32SRn/1mynd4qucgN6NK+3RM1R6owAu8I8u6aMcyjB cXYQ== X-Received: by 10.182.223.101 with SMTP id qt5mr8002935obc.51.1357588212017; Mon, 07 Jan 2013 11:50:12 -0800 (PST) Received: from [192.168.1.102] (c-71-234-225-85.hsd1.ct.comcast.net. [71.234.225.85]) by mx.google.com with ESMTPS id jd1sm33054688obb.8.2013.01.07.11.50.10 (version=SSLv3 cipher=OTHER); Mon, 07 Jan 2013 11:50:10 -0800 (PST) Message-ID: <50EB2707.5020404@dev.mellanox.co.il> Date: Mon, 07 Jan 2013 14:50:31 -0500 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Alex Netes CC: "linux-rdma (linux-rdma@vger.kernel.org)" , Jim Schutt Subject: [PATCH 2/3] opensm/torus: Add configuration for max_changes to report X-Gm-Message-State: ALoCoQnhaJgNDpoap5Sf1RKTdb2N7tXYiCVBRU3ANmE7XFgA5pTs6SsHQ/xbntS+IzeLxDlgXFtP Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Rather than hard coded constant of 32 for max torus changes to be reported, allow this to be configured with max_changes parameter in torus conf file. Default for max_changes parameter is same as hard coded constant (32). Also, update torus conf documentation for this new parameter. Reviewed-by: Jim Schutt Signed-off-by: Hal Rosenstock --- -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/man/torus-2QoS.conf.5.in b/man/torus-2QoS.conf.5.in index d806ab5..1ab0d2e 100644 --- a/man/torus-2QoS.conf.5.in +++ b/man/torus-2QoS.conf.5.in @@ -1,4 +1,4 @@ -.TH TORUS\-2QOS.CONF 5 "November 7, 2011" "OpenIB" "OpenIB Management" +.TH TORUS\-2QOS.CONF 5 "January 4, 2013" "OpenIB" "OpenIB Management" . .SH NAME torus\-2QoS.conf \- Torus-2QoS configuration for OpenSM subnet manager @@ -162,6 +162,15 @@ order on destination switches. Duplicate values in the list will be ignored. .RE . +.P +\fBmax_changes +\fImax +\fR +.RS +This keyword specifies the maximum number of torus changes reported. +The default value is 32. +.RE +. .SH EXAMPLE . \f(RC diff --git a/opensm/osm_torus.c b/opensm/osm_torus.c index 1d847b3..85ea9de 100644 --- a/opensm/osm_torus.c +++ b/opensm/osm_torus.c @@ -61,6 +61,7 @@ #define TORUS_MAX_DIM 3 #define PORTGRP_MAX_PORTS 16 #define SWITCH_MAX_PORTGRPS (1 + 2 * TORUS_MAX_DIM) +#define DEFAULT_MAX_CHANGES 32 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) @@ -310,6 +311,7 @@ struct torus { struct t_switch *master_stree_root; unsigned flags; + unsigned max_changes; int debug; }; @@ -1065,6 +1055,7 @@ bool parse_config(const char *fn, struct fabric *f, struct torus *t) } t->flags |= NOTIFY_CHANGES; t->portgrp_sz = PORTGRP_MAX_PORTS; + t->max_changes = DEFAULT_MAX_CHANGES; next_line: llen = getline(&line_buf, &line_buf_sz, fp); @@ -1131,6 +1122,8 @@ next_line: if (!t->seed_cnt) t->seed_cnt++; kw_success = parse_dir_dateline(3, t, parse_sep); + } else if (strcmp("max_changes", keyword) == 0) { + kw_success = parse_unsigned(&t->max_changes, parse_sep); } else if (keyword[0] == '#') goto next_line; else { @@ -7525,6 +7518,7 @@ void report_torus_changes(struct torus *nt, struct torus *ot) unsigned x_sz = nt->x_sz; unsigned y_sz = nt->y_sz; unsigned z_sz = nt->z_sz; + unsigned max_changes = nt->max_changes; if (!(nt && ot)) return; @@ -7565,7 +7559,7 @@ void report_torus_changes(struct torus *nt, struct torus *ot) * We want to log changes to learn more about * bouncing links, etc, so they can be fixed. */ - if (cnt > 32) { + if (cnt > max_changes) { OSM_LOG(&nt->osm->log, OSM_LOG_INFO, "Too many torus changes; " "stopping reporting early\n");