From patchwork Fri Nov 12 22:11:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Schutt X-Patchwork-Id: 321542 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oACMBd9K018672 for ; Fri, 12 Nov 2010 22:11:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933053Ab0KLWLv (ORCPT ); Fri, 12 Nov 2010 17:11:51 -0500 Received: from sentry-three.sandia.gov ([132.175.109.17]:38998 "EHLO sentry-three.sandia.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933083Ab0KLWLr (ORCPT ); Fri, 12 Nov 2010 17:11:47 -0500 X-WSS-ID: 0LBSLNG-0C-26W-02 X-M-MSG: Received: from sentry.sandia.gov (mm04snlnto.sandia.gov [132.175.109.21]) by sentry-three.sandia.gov (Postfix) with ESMTP id 12CC44CA5F9; Fri, 12 Nov 2010 15:11:40 -0700 (MST) Received: from [132.175.109.1] by sentry.sandia.gov with ESMTP (SMTP Relay 01 (Email Firewall v6.3.2)); Fri, 12 Nov 2010 15:11:27 -0700 X-Server-Uuid: AF72F651-81B1-4134-BA8C-A8E1A4E620FF Received: from localhost.localdomain (sale659.sandia.gov [134.253.4.20]) by mailgate.sandia.gov (8.14.4/8.14.4) with ESMTP id oACMBDal000385; Fri, 12 Nov 2010 15:11:17 -0700 From: "Jim Schutt" To: sashak@voltaire.com cc: linux-rdma@vger.kernel.org, "Jim Schutt" Subject: [PATCH 05/13] opensm: Cause torus-2QoS to warn if QoS configuration will cause issues. Date: Fri, 12 Nov 2010 15:11:14 -0700 Message-ID: <1289599882-15165-6-git-send-email-jaschut@sandia.gov> X-Mailer: git-send-email 1.6.2.2 In-Reply-To: <1289599882-15165-1-git-send-email-jaschut@sandia.gov> References: <1289599882-15165-1-git-send-email-jaschut@sandia.gov> X-PMX-Version: 5.6.0.2009776, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2010.11.12.220015 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' BODY_SIZE_3000_3999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DATE_TZ_NA 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_TEXT_ONLY 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __URI_NS ' X-TMWD-Spam-Summary: TS=20101112221131; ID=1; SEV=2.3.1; DFV=B2010111222; IFV=NA; AIF=B2010111222; RPD=5.03.0010; ENG=NA; RPDID=7374723D303030312E30413031303230372E34434444424239332E303036363A534346535441543838363133332C73733D312C6667733D30; CAT=NONE; CON=NONE; SIG=AAAAAAAAAAAAAAAAAAAAAAAAfQ== X-MMS-Spam-Filter-ID: B2010111222_5.03.0010 MIME-Version: 1.0 X-WSS-ID: 60C364054KO2689009-01-01 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 12 Nov 2010 22:11:54 +0000 (UTC) diff --git a/opensm/opensm/osm_torus.c b/opensm/opensm/osm_torus.c index aeb4fe6..784955d 100644 --- a/opensm/opensm/osm_torus.c +++ b/opensm/opensm/osm_torus.c @@ -9038,6 +9038,84 @@ out: } static +void check_vlarb_config(const char *vlarb_str, bool is_default, + const char *str, const char *pri, osm_log_t *log) +{ + unsigned total_weight[IB_MAX_NUM_VLS] = {0,}; + unsigned i = 0, v, vl = 0; + char *end; + bool uniform; + + while (*vlarb_str && i++ < 2 * IB_NUM_VL_ARB_ELEMENTS_IN_BLOCK) { + v = strtoul(vlarb_str, &end, 0); + if (*end) + end++; + vlarb_str = end; + if (i & 0x1) + vl = v & 0xf; + else + total_weight[vl] += v & 0xff; + } + uniform = true; + v = total_weight[0]; + for (i = 1; i < 8; i++) { + if (i == 4) + v = total_weight[i]; + if (total_weight[i] != v) + uniform = false; + } + if (!uniform) + OSM_LOG(log, OSM_LOG_INFO, + "Warning: torus-2QoS requires same VLarb weights for " + "VLs 0-3; also for VLs 4-7: not true for %s " + "%s_vlarb_%s\n", + (is_default ? "default" : "configured"), str, pri); +} + +static +void check_qos_config(osm_qos_options_t *opt, bool tgt_is_default, + const char *str, osm_log_t *log) +{ + const char *vlarb_str; + bool is_default; + + if (opt->max_vls > 0 && opt->max_vls < 8) + OSM_LOG(log, OSM_LOG_INFO, + "Warning: full torus-2QoS functionality not available " + "for configured %s_max_vls = %d\n", str, opt->max_vls); + + if (opt->vlarb_high) { + is_default = false; + vlarb_str = opt->vlarb_high; + } else{ + is_default = true; + vlarb_str = OSM_DEFAULT_QOS_VLARB_HIGH; + } + /* + * Only check values that were actually configured, or the overall + * defaults that target-specific (CA, switch port, etc) defaults + * are set from. + */ + if (!is_default || tgt_is_default) + check_vlarb_config(vlarb_str, is_default, str, "high", log); + + if (opt->vlarb_low) { + is_default = false; + vlarb_str = opt->vlarb_low; + } else { + is_default = true; + vlarb_str = OSM_DEFAULT_QOS_VLARB_LOW; + } + if (!is_default || tgt_is_default) + check_vlarb_config(vlarb_str, is_default, str, "low", log); + + if (opt->sl2vl) + OSM_LOG(log, OSM_LOG_INFO, + "Warning: torus-2QoS must override configured " + "%s_sl2vl to generate deadlock-free routes\n", str); +} + +static int torus_build_lfts(void *context) { int status = -1; @@ -9111,9 +9189,18 @@ out: if (torus) teardown_torus(torus); } else { + osm_subn_opt_t *opt = &torus->osm->subn.opt; + osm_log_t *log = &torus->osm->log; + if (ctx->torus) teardown_torus(ctx->torus); ctx->torus = torus; + + check_qos_config(&opt->qos_options, 1, "qos", log); + check_qos_config(&opt->qos_ca_options, 0, "qos_ca", log); + check_qos_config(&opt->qos_sw0_options, 0, "qos_sw0", log); + check_qos_config(&opt->qos_swe_options, 0, "qos_swe", log); + check_qos_config(&opt->qos_rtr_options, 0, "qos_rtr", log); } teardown_fabric(fabric); return status;