Set IS_SM bit during opensm init

Set IS_SM bit during opensm initalization.
This fixes a problem of SM that enters to standby and has
mismatch between local capability (IS_SM off) and the SMA.

Signed-off-by: Eli Dorfman <[email protected]>
---
 opensm/opensm/osm_opensm.c        |    5 +++++
 opensm/opensm/osm_port_info_rcv.c |   35 +----------------------------------
 2 files changed, 6 insertions(+), 34 deletions(-)

diff --git a/opensm/opensm/osm_opensm.c b/opensm/opensm/osm_opensm.c
index 7de2e5b..cfe6474 100644
--- a/opensm/opensm/osm_opensm.c
+++ b/opensm/opensm/osm_opensm.c
@@ -475,6 +475,11 @@ osm_opensm_bind(IN osm_opensm_t * const p_osm, IN const 
ib_net64_t guid)
                goto Exit;
 #endif                         /* ENABLE_OSM_PERF_MGR */
 
+       /* setting IS_SM in capability mask */
+       OSM_LOG(&p_osm->log, OSM_LOG_INFO, "Setting IS_SM on port 0x%016" 
PRIx64 "\n",
+                       cl_ntoh64(guid));
+       osm_vendor_set_sm(p_osm->sm.mad_ctrl.h_bind, TRUE);
+
 Exit:
        OSM_LOG_EXIT(&p_osm->log);
        return (status);
diff --git a/opensm/opensm/osm_port_info_rcv.c 
b/opensm/opensm/osm_port_info_rcv.c
index 3e39dff..7a3e487 100644
--- a/opensm/opensm/osm_port_info_rcv.c
+++ b/opensm/opensm/osm_port_info_rcv.c
@@ -62,30 +62,6 @@
 #include <opensm/osm_opensm.h>
 #include <opensm/osm_ucast_mgr.h>
 
-/**********************************************************************
- **********************************************************************/
-static void
-__osm_pi_rcv_set_sm(IN osm_sm_t * sm,
-                   IN osm_physp_t * const p_physp)
-{
-       osm_bind_handle_t h_bind;
-       osm_dr_path_t *p_dr_path;
-
-       OSM_LOG_ENTER(sm->p_log);
-
-       OSM_LOG(sm->p_log, OSM_LOG_DEBUG,
-               "Setting IS_SM bit in port attributes\n");
-
-       p_dr_path = osm_physp_get_dr_path_ptr(p_physp);
-       h_bind = osm_dr_path_get_bind_handle(p_dr_path);
-
-       /*
-          The 'IS_SM' bit isn't already set, so set it.
-        */
-       osm_vendor_set_sm(h_bind, TRUE);
-
-       OSM_LOG_EXIT(sm->p_log);
-}
 
 /**********************************************************************
  **********************************************************************/
@@ -139,16 +115,7 @@ __osm_pi_rcv_process_endport(IN osm_sm_t * sm,
                }
        }
 
-       if (port_guid == sm->p_subn->sm_port_guid) {
-               /*
-                  We received the PortInfo for our own port.
-                */
-               if (!(p_pi->capability_mask & IB_PORT_CAP_IS_SM))
-                       /*
-                          Set the IS_SM bit to indicate our port hosts an SM.
-                        */
-                       __osm_pi_rcv_set_sm(sm, p_physp);
-       } else {
+       if (port_guid != sm->p_subn->sm_port_guid) {
                p_sm_tbl = &sm->p_subn->sm_guid_tbl;
                if (p_pi->capability_mask & IB_PORT_CAP_IS_SM) {
                        /*
-- 
1.5.5

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to