From patchwork Wed Jun 1 22:33:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Schutt X-Patchwork-Id: 842052 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p51MXjsj030272 for ; Wed, 1 Jun 2011 22:33:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758762Ab1FAWdp (ORCPT ); Wed, 1 Jun 2011 18:33:45 -0400 Received: from sentry-two.sandia.gov ([132.175.109.14]:33148 "EHLO sentry-two.sandia.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758458Ab1FAWdn (ORCPT ); Wed, 1 Jun 2011 18:33:43 -0400 X-WSS-ID: 0LM4UO4-0B-2BG-02 X-M-MSG: Received: from interceptor1.sandia.gov (interceptor1.sandia.gov [132.175.109.5]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sentry-two.sandia.gov (Postfix) with ESMTP id 1EF3118B34A; Wed, 1 Jun 2011 16:33:39 -0600 (MDT) Received: from sentry.sandia.gov (mm03snlnto.sandia.gov [132.175.109.20]) by interceptor1.sandia.gov (RSA Interceptor); Wed, 1 Jun 2011 16:23:43 -0600 Received: from [132.175.109.1] by sentry.sandia.gov with ESMTP (SMTP Relay 01 (Email Firewall v6.3.2)); Wed, 01 Jun 2011 16:33:15 -0600 X-Server-Uuid: 6BFC7783-7E22-49B4-B610-66D6BE496C0E Received: from localhost.localdomain (sale659.sandia.gov [134.253.4.20]) by mailgate.sandia.gov (8.14.4/8.14.4) with ESMTP id p51MWhX4002002; Wed, 1 Jun 2011 16:32:44 -0600 From: "Jim Schutt" To: alexne@voltaire.com cc: davem@systemfabricworks.com, linux-rdma@vger.kernel.org, "Jim Schutt" Subject: [PATCH 1/2] opensm: fail if configured torus port order references a port not available in all switches Date: Wed, 1 Jun 2011 16:33:00 -0600 Message-ID: <1306967581-1015-1-git-send-email-jaschut@sandia.gov> X-Mailer: git-send-email 1.6.2.2 In-Reply-To: <4DE6BD7A.9030102@sandia.gov> References: <4DE6BD7A.9030102@sandia.gov> X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.6.1.222416 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1700_1799 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DATE_TZ_NA 0, __ANY_URI 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_TEXT_ONLY 0, __SANE_MSGID 0, __STOCK_PHRASE_7 0, __SUBJECT_ENDING_IN_LATIN_OR_NUMERALS 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __URI_NS ' X-TMWD-Spam-Summary: TS=20110601223315; ID=1; SEV=2.3.1; DFV=B2011060122; IFV=NA; AIF=B2011060122; RPD=5.03.0010; ENG=NA; RPDID=7374723D303030312E30413031303230392E34444536424532422E303034463A534346535441543838363133332C73733D312C6667733D30; CAT=NONE; CON=NONE; SIG=AAAAAAAAAAAAAAAAAAAAAAAAfQ== X-MMS-Spam-Filter-ID: B2011060122_5.03.0010 MIME-Version: 1.0 X-WSS-ID: 61F861A1340105496-01-01 X-RSA-Inspected: yes X-RSA-Classifications: public X-RSA-Action: allow 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.6 (demeter2.kernel.org [140.211.167.43]); Wed, 01 Jun 2011 22:33:46 +0000 (UTC) Signed-off-by: Jim Schutt --- opensm/osm_torus.c | 24 ++++++++++++++++++++---- 1 files changed, 20 insertions(+), 4 deletions(-) diff --git a/opensm/osm_torus.c b/opensm/osm_torus.c index 29c1bb4..47654ce 100644 --- a/opensm/osm_torus.c +++ b/opensm/osm_torus.c @@ -856,9 +856,6 @@ bool parse_port(unsigned *pnum, const char *parse_sep) if (!val) return false; *pnum = strtoul(val, &nextchar, 0); - if (*pnum > IB_NODE_NUM_PORTS_MAX) { - *pnum = 0; - } return true; } @@ -7018,7 +7015,8 @@ static bool verify_setup(struct torus *t, struct fabric *f) { struct coord_dirs *o; - unsigned n = 0; + struct f_switch *sw; + unsigned p, s, n = 0; bool success = false; bool all_sw_present, need_seed = true; @@ -7044,6 +7042,24 @@ bool verify_setup(struct torus *t, struct fabric *f) "with two QoS levels (have %d need 8)\n", (int)t->osm->subn.min_data_vls); /* + * Be sure all the switches in the torus support the port + * ordering that might have been configured. + */ + for (s = 0; s < f->switch_cnt; s++) { + sw = f->sw[s]; + for (p = 0; p < sw->port_cnt; p++) { + if (t->port_order[p] >= sw->port_cnt) { + OSM_LOG(&t->osm->log, OSM_LOG_ERROR, + "Error: port_order configured using " + "port %u, but only %u ports in " + "switch w/ GUID 0x%04"PRIx64"\n", + t->port_order[p], sw->port_cnt - 1, + cl_ntoh64(sw->n_id)); + goto out; + } + } + } + /* * Unfortunately, there is a problem with non-unique topology for any * torus dimension which has radix four. This problem requires extra * input, in the form of specifying both the positive and negative