[ofa-general] [PATCH][MINOR] OpenSM/libvendor/osm_vendor_ibumad.c: In osm_vendor_send, simplify redundant code

Hal Rosenstock halr at voltaire.com
Mon Mar 12 13:36:10 PDT 2007


OpenSM/libvendor/osm_vendor_ibumad.c: In osm_vendor_send, simplify
redundant code

Signed-off-by: Hal Rosenstock <halr at voltaire.com>

diff --git a/osm/libvendor/osm_vendor_ibumad.c b/osm/libvendor/osm_vendor_ibumad.c
index 24b5e11..8661731 100644
--- a/osm/libvendor/osm_vendor_ibumad.c
+++ b/osm/libvendor/osm_vendor_ibumad.c
@@ -1075,13 +1075,14 @@ osm_vendor_send(
 		umad_set_grh(p_vw->umad, 0);
 		goto Resp;
 	}
+	/* GSI classes */
+	umad_set_addr_net(p_vw->umad, p_mad_addr->dest_lid,
+			  p_mad_addr->addr_type.gsi.remote_qp,
+			  p_mad_addr->addr_type.gsi.service_level,
+			  IB_QP1_WELL_KNOWN_Q_KEY);
+	umad_set_grh(p_vw->umad, 0);	/* FIXME: GRH support */
+	umad_set_pkey(p_vw->umad, p_mad_addr->addr_type.gsi.pkey);
 	if (ib_class_is_rmpp(p_mad->mgmt_class)) {	/* RMPP GSI classes	FIXME: no GRH */
-		umad_set_addr_net(p_vw->umad, p_mad_addr->dest_lid,
-				  p_mad_addr->addr_type.gsi.remote_qp,
-				  p_mad_addr->addr_type.gsi.service_level,
-				  IB_QP1_WELL_KNOWN_Q_KEY);
-		umad_set_grh(p_vw->umad, 0);	/* FIXME: GRH support */
-		umad_set_pkey(p_vw->umad, p_mad_addr->addr_type.gsi.pkey);
 		if (!ib_rmpp_is_flag_set((ib_rmpp_mad_t *)p_sa,
 					 IB_RMPP_FLAG_ACTIVE)) {
 			/* Clear RMPP header when RMPP not ACTIVE */
@@ -1108,13 +1109,6 @@ osm_vendor_send(
 			p_sa->paylen_newwin = cl_ntoh32(paylen);
 		}
 #endif
-	} else {	/* non RMPP GSI classes 	FIXME: no GRH */
-		umad_set_addr_net(p_vw->umad, p_mad_addr->dest_lid,
-				  p_mad_addr->addr_type.gsi.remote_qp,
-				  p_mad_addr->addr_type.gsi.service_level,
-				  IB_QP1_WELL_KNOWN_Q_KEY);
-		umad_set_grh(p_vw->umad, 0);    /* FIXME: GRH support */
-		umad_set_pkey(p_vw->umad, p_mad_addr->addr_type.gsi.pkey);
 	}
 
 Resp:







More information about the general mailing list