[ofa-general] [PATCH] OpenSM/osm_port.c: Fix opvls and neighbormtu when remote port invalid

Hal Rosenstock hal.rosenstock at gmail.com
Thu Jul 26 07:25:30 PDT 2007


OpenSM/osm_port.c: Fix opvls and neighbormtu when remote port invalid

Signed-off-by: Hal Rosenstock <hal.rosenstock at gmail.com>

diff --git a/opensm/opensm/osm_port.c b/opensm/opensm/osm_port.c
index e03e316..b9c52f4 100644
--- a/opensm/opensm/osm_port.c
+++ b/opensm/opensm/osm_port.c
@@ -387,12 +388,12 @@ osm_physp_calc_link_mtu(

  OSM_LOG_ENTER( p_log, osm_physp_calc_link_mtu );

-  /* use the available MTU */
-  mtu = ib_port_info_get_mtu_cap( &p_physp->port_info );
-
  p_remote_physp = osm_physp_get_remote( p_physp );
  if( p_remote_physp && osm_physp_is_valid( p_remote_physp ) )
  {
+    /* use the available MTU */
+    mtu = ib_port_info_get_mtu_cap( &p_physp->port_info );
+
    remote_mtu = ib_port_info_get_mtu_cap( &p_remote_physp->port_info );

    if( osm_log_is_active( p_log, OSM_LOG_DEBUG ) )
@@ -427,6 +428,8 @@ osm_physp_calc_link_mtu(
      }
    }
  }
+  else
+    mtu = ib_port_info_get_neighbor_mtu( &p_physp->port_info );

  if( mtu == 0 )
  {
@@ -454,12 +457,12 @@ osm_physp_calc_link_op_vls(

  OSM_LOG_ENTER( p_log, osm_physp_calc_link_op_vls );

-  /* use the available VLCap */
-  op_vls = ib_port_info_get_vl_cap( &p_physp->port_info );
-
  p_remote_physp = osm_physp_get_remote( p_physp );
  if( p_remote_physp && osm_physp_is_valid( p_remote_physp ) )
  {
+    /* use the available VLCap */
+    op_vls = ib_port_info_get_vl_cap( &p_physp->port_info );
+
    remote_op_vls = ib_port_info_get_vl_cap( &p_remote_physp->port_info );

    if( osm_log_is_active( p_log, OSM_LOG_DEBUG ) )
@@ -496,6 +499,8 @@ osm_physp_calc_link_op_vls(
      }
    }
  }
+  else
+    op_vls = ib_port_info_get_op_vls( &p_physp->port_info );

  /* support user limitation of max_op_vls */
  if (op_vls > p_subn->opt.max_op_vls)



More information about the general mailing list