Skip to contentSkip to conversation

ibsim/sim_cmd.c: Allow error command on attributes for switch port 0

PATCH In review Hal Rosenstock 2 participants 2 messages Jun 25, 2012 – Oct 11, 2012 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ibsim/sim_cmd.c: Allow error command on attributes for switch port 0

---

ibsim/sim_cmd.c +6 -2
index 6d3a893..81e9bfa 100644
@@ -288,7 +288,7 @@ static int do_seterror(FILE * f, char *line)
 	char *s = line;
 	char *nodeid = 0, name[NAMELEN], *sp, *orig = 0;
 	int portnum = -1;	// def - all ports
-	int numports, set = 0, rate = 0;
+	int startport, numports, set = 0, rate = 0;
 	uint16_t attr = 0;
 
 	if (strsep(&s, "\""))
@@ -309,8 +309,12 @@ static int do_seterror(FILE * f, char *line)
 	}
 
 	if (sp) {
+		if (node->type == SWITCH_NODE)
+			startport = 0;
+		else
+			startport = 1;
 		portnum = strtoul(sp, 0, 0);
-		if (portnum < 1 || portnum > node->numports) {
+		if (portnum < startport || portnum > node->numports) {
 			fprintf(f, "# bad port number %d at nodeid \"%s\"\n",
 				portnum, nodeid);
 			return -1;

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html