[ofw] [PATCH] IPoIB: Fill in service level in MAC_TO_PATH output
Tzachi Dar
tzachid at mellanox.co.il
Sat Dec 13 18:50:30 PST 2008
Applied on 1788.
Thanks
Tzachi
-----Original Message-----
From: ofw-bounces at lists.openfabrics.org
[mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Fab Tillier
Sent: Tuesday, December 09, 2008 8:17 AM
To: ofw at lists.openfabrics.org
Subject: [ofw] [PATCH] IPoIB: Fill in service level in MAC_TO_PATH
output
This patch fixes a bug in the MAC_TO_PATH conversion in IPoIB wherein
the service level in the output path wasn't set (or cleared). This
resulted in uninitialized memory being used for the SL, resulting in
connection timeouts on some systems.
I also added some tracing to help track this kind of issue down. The
tracing as it stands isn't the most useful, as it only gives entry/exit
information but not basic parameter information that would allow
tracking individual objects.
Signed-off-by: Fab Tillier <ftillier at microsoft.com>
Index: ulp/ipoib/kernel/ipoib_port.c
===================================================================
--- ulp/ipoib/kernel/ipoib_port.c (revision 1743)
+++ ulp/ipoib/kernel/ipoib_port.c (working copy)
@@ -4722,6 +4722,7 @@ ipoib_mac_to_path(
uint8_t sl;
net32_t flow_lbl;
uint8_t hop_limit;
+ uint8_t pkt_life;
IPOIB_ENTER( IPOIB_DBG_ENDPT );
@@ -4768,20 +4769,29 @@ ipoib_mac_to_path(
&flow_lbl,
&hop_limit
);
- ib_path_rec_set_hop_flow_raw( p_path, hop_limit, flow_lbl, FALSE
);
- p_path->tclass = p_port->ib_mgr.bcast_rec.tclass;
- p_path->num_path = 1;
- p_path->pkey = p_port->ib_mgr.bcast_rec.pkey;
- p_path->mtu = p_port->ib_mgr.bcast_rec.mtu;
- p_path->rate = p_port->ib_mgr.bcast_rec.rate;
if( p_path->slid == p_path->dlid )
- p_path->pkt_life = 0;
+ pkt_life = 0;
else
- p_path->pkt_life = p_port->ib_mgr.bcast_rec.pkt_life;
- p_path->preference = 0;
- p_path->resv1 = 0;
- p_path->resv2 = 0;
+ pkt_life = p_port->ib_mgr.bcast_rec.pkt_life;
+
+ ib_path_rec_init_local(
+ p_path,
+ &p_endpt->dgid,
+ &p_port->p_local_endpt->dgid,
+ p_endpt->dlid,
+ p_port->p_local_endpt->dlid,
+ 1,
+ p_port->ib_mgr.bcast_rec.pkey,
+ sl,
+ IB_PATH_SELECTOR_EXACTLY, p_port->ib_mgr.bcast_rec.mtu,
+ IB_PATH_SELECTOR_EXACTLY, p_port->ib_mgr.bcast_rec.rate,
+ IB_PATH_SELECTOR_EXACTLY, pkt_life,
+ 0 );
+
+ /* Set global routing information. */
+ ib_path_rec_set_hop_flow_raw( p_path, hop_limit, flow_lbl, FALSE
);
+ p_path->tclass = p_port->ib_mgr.bcast_rec.tclass;
cl_obj_unlock( &p_port->obj );
Index: core/al/al_mad.c
===================================================================
--- core/al/al_mad.c (revision 1743)
+++ core/al/al_mad.c (working copy)
@@ -1542,6 +1542,16 @@ __create_send_av(
p_mad_element = h_send->p_send_mad;
+ AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC,
+ ("class %d attr %d AV attr: port num %d, sl %d, dlid %d,
path bits %d",
+ p_mad_element->p_mad_buf->mgmt_class,
+ p_mad_element->p_mad_buf->attr_id,
+ h_mad_svc->port_num,
+ p_mad_element->remote_sl,
+ p_mad_element->remote_lid,
+ p_mad_element->path_bits)
+ );
+
av_attr.port_num = h_mad_svc->port_num;
av_attr.sl = p_mad_element->remote_sl; @@ -1549,7 +1559,18 @@
__create_send_av(
av_attr.grh_valid = p_mad_element->grh_valid;
if( av_attr.grh_valid )
+ {
av_attr.grh = *p_mad_element->p_grh;
+ AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC,
+ ("ver_class_flow %08x, hop lmt %d, src gid
%16I64x%16I64x, dest gid %16I64x%16I64x",
+ av_attr.grh.ver_class_flow,
+ av_attr.grh.hop_limit,
+ cl_ntoh64( av_attr.grh.src_gid.unicast.prefix ),
+ cl_ntoh64(
av_attr.grh.src_gid.unicast.interface_id ),
+ cl_ntoh64( av_attr.grh.dest_gid.unicast.prefix
),
+ cl_ntoh64(
av_attr.grh.dest_gid.unicast.interface_id ))
+ );
+ }
av_attr.static_rate = IB_PATH_RECORD_RATE_10_GBS;
av_attr.path_bits = p_mad_element->path_bits;
More information about the ofw
mailing list