[openib-general] {PATCH]OpenSM: Better handling for Path/MultiPath requests for raw traffic

Hal Rosenstock halr at voltaire.com
Mon Jul 24 03:56:45 PDT 2006


OpenSM: Better handling for Path/MultiPath requests for raw traffic

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

Index: opensm/osm_sa_path_record.c
===================================================================
--- opensm/osm_sa_path_record.c	(revision 8640)
+++ opensm/osm_sa_path_record.c	(working copy)
@@ -562,7 +562,7 @@ __osm_pr_rcv_get_path_parms(
 
   if( comp_mask & IB_PR_COMPMASK_RAWTRAFFIC &&
       cl_ntoh32( p_pr->hop_flow_raw ) & ( 1<<31 ) )
-    pkey = 0;
+    pkey = osm_physp_find_common_pkey( p_physp, p_dest_physp );
   else if( comp_mask & IB_PR_COMPMASK_PKEY )
   {
     pkey = p_pr->pkey;
@@ -588,19 +588,27 @@ __osm_pr_rcv_get_path_parms(
     }
   }
 
-  p_prtn = (osm_prtn_t *)cl_qmap_get(&p_rcv->p_subn->prtn_pkey_tbl,
-                                     pkey & cl_ntoh16((uint16_t)~0x8000));
-  if ( p_prtn == (osm_prtn_t *)cl_qmap_end(&p_rcv->p_subn->prtn_pkey_tbl) )
-  {
-    /* this may be possible when pkey tables are created somehow in
-       previous runs or things are going wrong here */
-    sl = OSM_DEFAULT_SL;
-    osm_log( p_rcv->p_log, OSM_LOG_ERROR,
-             "__osm_pr_rcv_get_path_parms: ERR 1F1C: "
-             "No partition found for PKey 0x%04x - using default SL %d\n", cl_ntoh16(pkey), sl );
+  if (pkey) {
+    p_prtn = (osm_prtn_t *)cl_qmap_get(&p_rcv->p_subn->prtn_pkey_tbl,
+                                       pkey & cl_ntoh16((uint16_t)~0x8000));
+    if ( p_prtn == (osm_prtn_t *)cl_qmap_end(&p_rcv->p_subn->prtn_pkey_tbl) )
+    {
+      /* this may be possible when pkey tables are created somehow in
+         previous runs or things are going wrong here */
+      osm_log( p_rcv->p_log, OSM_LOG_ERROR,
+               "__osm_pr_rcv_get_path_parms: ERR 1F1C: "
+               "No partition found for PKey 0x%04x - using default SL %d\n",
+               cl_ntoh16(pkey), sl );
+      sl = OSM_DEFAULT_SL;
+    }
+    else
+      sl = p_prtn->sl;
+
+    /* reset pkey when raw traffic */
+    if( comp_mask & IB_PR_COMPMASK_RAWTRAFFIC &&
+        cl_ntoh32( p_pr->hop_flow_raw ) & ( 1<<31 ) )
+      pkey = 0;
   }
-  else
-    sl = p_prtn->sl;
 
   if ( ( comp_mask & IB_PR_COMPMASK_SL ) && ib_path_rec_sl( p_pr ) != sl )
   {
Index: opensm/osm_sa_multipath_record.c
===================================================================
--- opensm/osm_sa_multipath_record.c	(revision 8640)
+++ opensm/osm_sa_multipath_record.c	(working copy)
@@ -197,7 +197,7 @@ __osm_mpr_rcv_get_path_parms(
 
   if ( comp_mask & IB_MPR_COMPMASK_RAWTRAFFIC &&
        cl_ntoh32( p_mpr->hop_flow_raw ) & ( 1<<31 ) )
-    required_pkey = 0;
+    required_pkey = osm_physp_find_common_pkey( p_physp, p_dest_physp );
   else if ( comp_mask & IB_MPR_COMPMASK_PKEY ) {
     required_pkey = p_mpr->pkey;
     if( !osm_physp_share_this_pkey( p_physp, p_dest_physp, required_pkey ) ) {
@@ -225,19 +225,26 @@ __osm_mpr_rcv_get_path_parms(
     }
   }
 
-  p_prtn = (osm_prtn_t *)cl_qmap_get(&p_rcv->p_subn->prtn_pkey_tbl,
-				     required_pkey & cl_ntoh16((uint16_t)~0x8000));
-  if ( p_prtn == (osm_prtn_t *)cl_qmap_end(&p_rcv->p_subn->prtn_pkey_tbl) )
-  {
-    /* this may be possible when pkey tables are created somehow in
-       previous runs or things are going wrong here */
-    required_sl = OSM_DEFAULT_SL;
-    osm_log( p_rcv->p_log, OSM_LOG_ERROR,
-             "__osm_mpr_rcv_get_path_parms: ERR 451A: "
-             "No partition found for PKey 0x%04x - using default SL %d\n", cl_ntoh16(required_pkey), required_sl );
+  if (required_pkey) {
+    p_prtn = (osm_prtn_t *)cl_qmap_get(&p_rcv->p_subn->prtn_pkey_tbl,
+				       required_pkey & cl_ntoh16((uint16_t)~0x8000));
+    if ( p_prtn == (osm_prtn_t *)cl_qmap_end(&p_rcv->p_subn->prtn_pkey_tbl) )
+    {
+      /* this may be possible when pkey tables are created somehow in
+         previous runs or things are going wrong here */
+      osm_log( p_rcv->p_log, OSM_LOG_ERROR,
+               "__osm_mpr_rcv_get_path_parms: ERR 451A: "
+               "No partition found for PKey 0x%04x - using default SL %d\n", cl_ntoh16(required_pkey), required_sl );
+      required_sl = OSM_DEFAULT_SL;
+    }
+    else
+      required_sl = p_prtn->sl;
+
+    /* reset pkey when raw traffic */
+    if( comp_mask & IB_PR_COMPMASK_RAWTRAFFIC &&
+        cl_ntoh32( p_mpr->hop_flow_raw ) & ( 1<<31 ) )
+      required_pkey = 0;
   }
-  else
-    required_sl = p_prtn->sl;
 
   if ( ( comp_mask & IB_MPR_COMPMASK_SL ) && ib_multipath_rec_sl( p_mpr ) != required_sl )
   {







More information about the general mailing list