diff mbox

opensm: Always set enabled speed and width

Message ID 4BD421A7.7040009@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Eli Dorfman (Voltaire) April 25, 2010, 11:04 a.m. UTC
None
diff mbox

Patch

diff --git a/infiniband-diags/src/ibportstate.c b/infiniband-diags/src/ibportstate.c
index 66f069e..b99c0e1 100644
--- a/infiniband-diags/src/ibportstate.c
+++ b/infiniband-diags/src/ibportstate.c
@@ -64,13 +64,13 @@  enum port_ops {
 };
 
 struct ibmad_port *srcport;
-int speed = 15;
-int width = 255;
+int speed = 0; /* no state change */
+int width = 0; /* no state change */
 int lid;
 int smlid;
 int lmc;
 int mtu;
-int vls;
+int vls = 0; /* no state change */
 
 struct {
 	const char *name;
@@ -394,12 +394,11 @@  int main(int argc, char **argv)
 			mad_set_field(data, 0, IB_PORT_STATE_F, 4);
 			break;
 		}
-		if (port_args[SPEED].set)
-			mad_set_field(data, 0, IB_PORT_LINK_SPEED_ENABLED_F,
-				      speed);
-		if (port_args[WIDTH].set)
-			mad_set_field(data, 0, IB_PORT_LINK_WIDTH_ENABLED_F,
-				      width);
+
+		/* always set enabled speed/width - defaults to NOP */
+		mad_set_field(data, 0, IB_PORT_LINK_SPEED_ENABLED_F, speed);
+		mad_set_field(data, 0, IB_PORT_LINK_WIDTH_ENABLED_F, width);
+
 		if (port_args[VLS].set)
 			mad_set_field(data, 0, IB_PORT_OPER_VLS_F, vls);
 		if (port_args[MTU].set)