diff mbox

[1v2] opensm: fixed port order configuration in torus routing engine

Message ID 20110601154046.GA1098@calypso.voltaire.com (mailing list archive)
State Accepted
Headers show

Commit Message

Alex Netes June 1, 2011, 3:40 p.m. UTC
Commit 1c2a298b295eba7e24205519abc24e47106d15df broke port order
configuration for torus routing engine. order was incorrectly initiated,
causing setting LFTs to fail.

Signed-off-by: Alex Netes <alexne@mellanox.com>
---
Changes since v1:
1. Defined order[] as uint8_t
2. Removed error message while parsing port_order. It gives false alarms, 
   because strtok() returns NULL when no tokens left.

--
 opensm/osm_torus.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

Comments

Jim Schutt June 1, 2011, 10:30 p.m. UTC | #1
Alex Netes wrote:
> Commit 1c2a298b295eba7e24205519abc24e47106d15df broke port order
> configuration for torus routing engine. order was incorrectly initiated,
> causing setting LFTs to fail.
> 
> Signed-off-by: Alex Netes <alexne@mellanox.com>

Acked-by: Jim Schutt <jaschut@sandia.gov>

Also, while reviewing this I noticed a couple things in the
port-order patch that I should have noticed earlier, but
didn't.  I have a couple of minor fixup patches that go on
top of this one, to send along in a minute.

-- Jim

--
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 mbox

Patch

diff --git a/opensm/osm_torus.c b/opensm/osm_torus.c
index cd3d490..29c1bb4 100644
--- a/opensm/osm_torus.c
+++ b/opensm/osm_torus.c
@@ -868,11 +868,9 @@  bool parse_port_order(struct torus *t, const char *parse_sep)
 	unsigned i, j, k, n;
 
 	for (i = 0; i < ARRAY_SIZE(t->port_order); i++) {
-		if (!parse_port(&(t->port_order[i]), parse_sep)) {
-			OSM_LOG(&t->osm->log, OSM_LOG_ERROR,
-				"Error: cannot parse port_order");
+		if (!parse_port(&(t->port_order[i]), parse_sep))
 			break;
-		}
+
 		for (j = 0; j < i; j++) {
 			if (t->port_order[j] == t->port_order[i]) {
 				OSM_LOG(&t->osm->log, OSM_LOG_ERROR,
@@ -8484,7 +8482,7 @@  bool torus_lft(struct torus *t, struct t_switch *sw)
 	struct port_grp *pgrp;
 	struct t_switch *dsw;
 	osm_switch_t *osm_sw;
-	unsigned order[IB_NODE_NUM_PORTS_MAX+1];
+	uint8_t order[IB_NODE_NUM_PORTS_MAX+1];
 
 	if (!(sw->osm_switch && sw->osm_switch->priv == sw)) {
 		OSM_LOG(&t->osm->log, OSM_LOG_ERROR,
@@ -8506,7 +8504,7 @@  bool torus_lft(struct torus *t, struct t_switch *sw)
 
 		for (p = 0; p < ARRAY_SIZE(order); p++) {
 
-			unsigned px = order[t->port_order[p]];
+			uint8_t px = order[t->port_order[p]];
 
 			if (px == IB_INVALID_PORT_NUM)
 				continue;