[openib-general] [PATCH] osm: add support for 1.2 errata - SA enhanced capability mask matching

Eitan Zahavi eitan at mellanox.co.il
Mon Apr 3 00:11:15 PDT 2006


Hi Hal

This patch adds support for the following 1.2 errata MGTWG8372.
This should be useful for scalability of:
* SRP target discovery and 
* Queries for all SM ports.

Reference ID: 4291 

Add to table: 186 SA-Specific ClassPortInfo:CapabilityMask 
Name                             | Bit | Description
===========================================================================================
IsPortInfoCapMaskMatchSupported  | 13  |  If this value is 1, SA shall support matching the 
                                 |     |  PortInfo:CapabilityMask component as described in 
                                 |     |  <ref to section 15.2.5.3>.                       

Reference ID: 4292 
    If SA's ClassPortInfo:CapabilityMask.IsPortInfoCapMaskMatchSupported  is 1, 
    then the AttributeModifier of the SubnAdmGet() and SubnAdmGetTable() 
    methods affects the matching behavior on the PortInfo:CapabilityMask 
    component. If the high-order bit (bit 31) of the AttributeModifier 
    is set to 1, matching on the CapabilityMask component will not be an 
    exact bitwise match as described in <ref to 15.4.4>.  Instead, 
    matching will only be performed on those bits which are set to 1 in 
    the PortInfo:CapabilityMask embedded in the query. 
    
    In <ref to o15-0.x.y>, bits in the PortInfo:CapabilityMask embedded 
    in the query that are set to 0 are bitwise wildcards for purposes of 
    matching. 
    
    This gives a requester the ability to select desired capabilities 
    and query for ports which support those capabilities. 
    
    If SA's ClassPortInfo:CapabilityMask.IsPortInfoCapMaskMatchSupported 
    is 0, or if bit 31 of the AttributeModifier is 0, then any matching 
    performed on the PortInfo:CapabilityMask component is as described 
    in <ref to 15.4.4>.     

Eitan

Signed-off-by:  Eitan Zahavi <eitan at mellanox.co.il>

Index: include/opensm/osm_base.h
===================================================================
--- include/opensm/osm_base.h	(revision 6144)
+++ include/opensm/osm_base.h	(working copy)
@@ -545,6 +545,26 @@ typedef enum _osm_thread_state
 #define OSM_CAP_IS_REINIT_SUP (1 << 11);
 /***********/
 
+/****d* OpenSM: Base/OSM_CAP_IS_PORT_INFO_CAPMASK_MATCH_SUPPORTED
+* Name
+*	OSM_CAP_IS_PORT_INFO_CAPMASK_MATCH_SUPPORTED
+*
+* DESCRIPTION
+*	SM/SA supports enhanced SA PortInfoRecord searches per 1.2 Errata:
+*  ClassPortInfo:CapabilityMask.IsPortInfoCapMaskMatchSupported  is 1, 
+*  then the AttributeModifier of the SubnAdmGet() and SubnAdmGetTable() 
+*  methods affects the matching behavior on the PortInfo:CapabilityMask 
+*  component. If the high-order bit (bit 31) of the AttributeModifier 
+*  is set to 1, matching on the CapabilityMask component will not be an 
+*  exact bitwise match as described in <ref to 15.4.4>.  Instead, 
+*  matching will only be performed on those bits which are set to 1 in 
+*  the PortInfo:CapabilityMask embedded in the query. 
+*
+* SYNOPSIS
+*/
+#define OSM_CAP_IS_PORT_INFO_CAPMASK_MATCH_SUPPORTED (1 << 13);
+/***********/
+
 /****d* OpenSM: Base/osm_sm_state_t
 * NAME
 *	osm_sm_state_t
Index: opensm/osm_sa_portinfo_record.c
===================================================================
--- opensm/osm_sa_portinfo_record.c	(revision 6144)
+++ opensm/osm_sa_portinfo_record.c	(working copy)
@@ -85,7 +85,7 @@ typedef  struct _osm_pir_search_ctxt
   cl_qlist_t*              p_list;
   osm_pir_rcv_t*           p_rcv;
   const osm_physp_t*       p_req_physp;
-
+  boolean_t                is_enhanced_comp_mask;
 } osm_pir_search_ctxt_t;
 
 /**********************************************************************
@@ -288,11 +288,23 @@ __osm_sa_pir_check_physp(
     if( p_comp_pi->master_sm_base_lid != p_pi->master_sm_base_lid )
       goto Exit;
   }
+  
+  /* IBTA 1.2 errata provides support for bitwise compare if the bit 31 
+     of the attribute modifier of the Get/GetTable is set */
   if( comp_mask & IB_PIR_COMPMASK_CAPMASK )
   {
+    if (p_ctxt->is_enhanced_comp_mask)
+    {
+      if ( (p_comp_pi->capability_mask & p_pi->capability_mask != p_comp_pi->capability_mask) )
+        goto Exit; 
+    }
+    else
+    {
     if( p_comp_pi->capability_mask != p_pi->capability_mask )
       goto Exit;
   }
+  }
+
   if( comp_mask & IB_PIR_COMPMASK_DIAGCODE )
   {
     if( p_comp_pi->diag_code != p_pi->diag_code )
@@ -648,6 +660,7 @@ osm_pir_rcv_process(
   context.comp_mask = p_rcvd_mad->comp_mask;
   context.p_rcv = p_rcv;
   context.p_req_physp = p_req_physp;
+  context.is_enhanced_comp_mask = (cl_ntoh32(p_rcvd_mad->attr_mod) & (1 << 31));
 
   cl_plock_acquire( p_rcv->p_lock );
 
Index: opensm/osm_sa_class_port_info.c
===================================================================
--- opensm/osm_sa_class_port_info.c	(revision 6144)
+++ opensm/osm_sa_class_port_info.c	(working copy)
@@ -212,15 +212,21 @@ __osm_cpi_rcv_respond(
      MultiPathRecord,
      TraceRecord
 
-     OSM_CAP_IS_SUBN_OPT_REINIT_SUP:
+     OSM_CAP_IS_REINIT_SUP:
      For reinitialization functionality.
 
      So not sending traps, but supporting Get(Notice) and Set(Notice):
   */
-  p_resp_cpi->cap_mask = 0x2; /* Note host notation replaced later */
+
+  /* Note host notation replaced later */
+  p_resp_cpi->cap_mask = 0x2; /* Generic mask: support Get/Set attributes */
+
   if (p_rcv->p_subn->opt.no_multicast_option != TRUE)
     p_resp_cpi->cap_mask |= OSM_CAP_IS_UD_MCAST_SUP;
 
+  p_resp_cpi->cap_mask |= OSM_CAP_IS_REINIT_SUP;
+  p_resp_cpi->cap_mask |= OSM_CAP_IS_PORT_INFO_CAPMASK_MATCH_SUPPORTED;
+
   p_resp_cpi->cap_mask = cl_hton16(p_resp_cpi->cap_mask);
 
   if( osm_log_is_active( p_rcv->p_log, OSM_LOG_FRAMES ) )




More information about the general mailing list