[openib-general] [PATCH] OpenSM: Fix osm_vendor_send for GSI classes
Hal Rosenstock
halr at voltaire.com
Wed Apr 5 04:55:13 PDT 2006
Hi Yael,
Below is a complete fix for the problem you identified. Let me know if
this works for you and I will check it into both the trunk and 1.0
branch.
Thanks.
-- Hal
OpenSM: Fix osm_vendor_send for GSI classes
Currently, the default for GSI classes assumes RMPP. There are two
groups of GSI classes: those which support RMPP and those which don't.
This patch handles them properly in osm_vendor_send.
Problem pointed out by Yael Kalka <yael at mellanox.co.il>
Signed-off-by: Hal Rosenstock <halr at voltaire.com>
Index: include/iba/ib_types.h
===================================================================
--- include/iba/ib_types.h (revision 6219)
+++ include/iba/ib_types.h (working copy)
@@ -515,6 +515,30 @@ BEGIN_C_DECLS
#define IB_MCLASS_VENDOR_LOW_RANGE_MAX 0x0f
/**********/
+/****d* IBA Base: Constants/IB_MCLASS_DEV_ADM
+* NAME
+* IB_MCLASS_DEV_ADM
+*
+* DESCRIPTION
+* Subnet Management Class, Device Administration
+*
+* SOURCE
+*/
+#define IB_MCLASS_DEV_ADM 0x10
+/**********/
+
+/****d* IBA Base: Constants/IB_MCLASS_BIS
+* NAME
+* IB_MCLASS_BIS
+*
+* DESCRIPTION
+* Subnet Management Class, BIS
+*
+* SOURCE
+*/
+#define IB_MCLASS_BIS 0x12
+/**********/
+
/****d* IBA Base: Constants/IB_MCLASS_VENDOR_HIGH_RANGE_MIN
* NAME
* IB_MCLASS_VENDOR_HIGH_RANGE_MIN
Index: libvendor/osm_vendor_ibumad.c
===================================================================
--- libvendor/osm_vendor_ibumad.c (revision 6219)
+++ libvendor/osm_vendor_ibumad.c (working copy)
@@ -1044,16 +1044,21 @@ osm_vendor_send(
CL_ASSERT( p_vw->h_bind == h_bind );
CL_ASSERT( p_mad == umad_get_mad(p_vw->umad) );
- switch (p_mad->mgmt_class) {
- case IB_MCLASS_SUBN_DIR:
+ if (p_mad->mgmt_class == IB_MCLASS_SUBN_DIR) {
umad_set_addr_net(p_vw->umad, 0xffff, 0, 0, 0);
umad_set_grh(p_vw->umad, 0);
- break;
- case IB_MCLASS_SUBN_LID:
+ goto Resp;
+ }
+ if (p_mad->mgmt_class == IB_MCLASS_SUBN_LID) {
umad_set_addr_net(p_vw->umad, p_mad_addr->dest_lid, 0, 0, 0);
umad_set_grh(p_vw->umad, 0);
- break;
- default: /* GSI FIXME: no GRH */
+ goto Resp;
+ }
+ if ((p_mad->mgmt_class == IB_MCLASS_SUBN_ADM) ||
+ (p_mad->mgmt_class == IB_MCLASS_DEV_MGMT) ||
+ (p_mad->mgmt_class == IB_MCLASS_DEV_ADM) ||
+ (p_mad->mgmt_class == IB_MCLASS_BIS) ||
+ ib_class_is_vendor_specific_high(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,
@@ -1086,9 +1091,17 @@ osm_vendor_send(
p_sa->paylen_newwin = cl_ntoh32(paylen);
}
#endif
- break;
+ goto Resp;
+ } 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:
if (resp_expected)
put_madw(p_vend, p_madw, &p_mad->trans_id);
More information about the general
mailing list