[openib-general] Re: [PATCH] Disregard subn->min_ca_rate/mtu during MCGroupcreation.

Sasha Khapyorsky sashak at voltaire.com
Fri Mar 24 08:07:24 PST 2006


On 09:42 Fri 24 Mar     , Hal Rosenstock wrote:
> On Thu, 2006-03-23 at 14:21, Sasha Khapyorsky wrote:
> > On 13:16 Thu 23 Mar     , Hal Rosenstock wrote:
> > > > 
> > > > > The realizability is when the port joins not when the group is created.
> > > > > This is significant for the precreated groups (as other groups are
> > > > > created when the first port joins).
> > > > > 
> > > > > Is min rate/MTU needed for anything ?
> > > > 
> > > > Currently it is used when the rate is not requested.
> > > 
> > > for what ?
> > 
> > As rate value for created MC group.
> 
> Is this really the right thing to be doing ?

Port's rate is likely better alternative, other more general option is
to use port's rate if exists or new configurable (via cmdline/file)
parameter 'subnet_rate'.

> What are the cases where
> MTU or rate are not supplied at group creation time ?

May be with port's join request. With pre-created groups we are using
MTU and rate in request. But this function is generic, I don't think we
need to break it.


After some spec reading here is the patch for RFC (not tested), there I'm
trying to solve some issues (currently I'm using min_ca_rate, but we may
replace it by 'subnet_rate' mentioned above).

> > > > Also for cases when the rate is requested as greater than specified value.
> > > > There is such check: if (rate_requested >= min_ca_rate) error... -  the
> > > > same problem I think.
> > > 
> > > So disregard what ?
> > 
> > min_ca_rate value as failure criteria. There may be something like:
> > 
> >   rate = rate_requested + 1;
> >   if (rate < min_ca_rate)
> >      rate = min_ca_rate;
> > 
> > Also in IBTA spec there is option RateSelector=3, when maximum available
> > rate are desired (the rate value specified in request is ignored). I
> > don't see that it is handled somehow. I think we may use port's rate
> > here.
> 
> Same for MTU (selector 3) too.

Indeed all comments are valid for MTU. The final version will be applied
for MTU selection too.

Sasha.



Fixes in MTU/rate verification/setup when MC Group is created.

Signed-off-by: Sasha Khapyorsky <sahak at voltaire.com>
---

 osm/opensm/osm_sa_mcmember_record.c |   89 +++++++++++++----------------------
 1 files changed, 33 insertions(+), 56 deletions(-)

diff --git a/osm/opensm/osm_sa_mcmember_record.c b/osm/opensm/osm_sa_mcmember_record.c
index f720440..ccdb628 100644
--- a/osm/opensm/osm_sa_mcmember_record.c
+++ b/osm/opensm/osm_sa_mcmember_record.c
@@ -1040,7 +1040,7 @@ __mgrp_request_is_realizable(
   uint8_t mtu_sel;
   uint8_t mtu_required;
   uint8_t rate_sel;
-  uint8_t rate_required;
+  uint8_t rate_required, rate, port_rate;
   osm_log_t *p_log = p_rcv->p_log;
   ib_port_info_t *p_pi = NULL;
 
@@ -1135,82 +1135,59 @@ __mgrp_request_is_realizable(
     }
   }
 
-  if (! (comp_mask & IB_MCR_COMPMASK_RATE))
-  {
-    p_mcm_rec->rate = p_rcv->p_subn->min_ca_rate;
-  }
+  rate_sel = (uint8_t)(p_mcm_rec->rate >> 6);
+  port_rate = p_pi ? ib_port_info_compute_rate(p_pi) : 0;
+  if (!(comp_mask & IB_MCR_COMPMASK_RATE) ||
+		  !(comp_mask & IB_MCR_COMPMASK_RATE_SEL) ||
+		  (rate_sel = (p_mcm_rec->rate >> 6)) == 3)
+    rate = port_rate ? port_rate : p_rcv->p_subn->min_ca_rate;
   else
   {
-    /* we need to select an RATE based on the requested RATE and selector */
-    if ( comp_mask & IB_MCR_COMPMASK_RATE_SEL)
-    {
-      rate_sel = (uint8_t)(p_mcm_rec->rate >> 6);
-    } 
-    else 
-    {
-      /* by default we assume an exact rate is requested */
-      rate_sel = 2; 
-    }
-    
-    /* Clearing last 2 bits */
     rate_required = (uint8_t)(p_mcm_rec->rate & 0x3F);
-
+    rate = rate_required;
     switch (rate_sel)
     {
     case 0: /* Greater than RATE specified */
-      /* we provide the largest RATE possible if we can */
-      if (rate_required < p_rcv->p_subn->min_ca_rate)
-      {
-        p_mcm_rec->rate = p_rcv->p_subn->min_ca_rate;
-      } 
-      else
+      if (port_rate && rate_required >= port_rate)
       {
         osm_log( p_log, OSM_LOG_DEBUG,
                  "__mgrp_request_is_realizable: "
-                 "Requested RATE %x >= the maximal possible:%x\n",
-                 rate_required, p_rcv->p_subn->min_ca_rate);
+                 "Requested RATE %x >= the port\'s rate:%x\n",
+                 rate_required, port_rate);
         return FALSE;
       }
+      /* we provide the largest RATE possible if we can */
+      if (port_rate)
+	rate = port_rate;
+      else if (rate_required < p_rcv->p_subn->min_ca_rate)
+        rate = p_rcv->p_subn->min_ca_rate;
+      else
+        rate++;
       break;
     case 1: /* Less than RATE specified */
-      /* if the requested RATE is not already the minimal, then we will
-         use the smaller of the two:
+      /* use the smaller of the two:
          a. one lower then the required
-         b. the rate of the requesting port
-         If the p_pi is NULL, this means there is no requester port and
-         just use rate one lower than the required. */
-      
-      if ( rate_required > 2 )
-      {
-        if (p_pi && ib_port_info_compute_rate(p_pi) < (rate_required - 1))
-          p_mcm_rec->rate = (rate_sel<<6) | ib_port_info_compute_rate(p_pi);
-        else
-          p_mcm_rec->rate--;
-      }
+         b. the rate of the requesting port (if exists) */
+      if (port_rate && rate_required > port_rate)
+        rate = port_rate;
       else
-      {
-        osm_log( p_log, OSM_LOG_DEBUG,
-                 "__mgrp_request_is_realizable: "
-                 "Can not obtain a lower RATE then the given one:%x\n",
-                 rate_required);
-        return FALSE;
-      }
+        rate--;
       break;
     case 2: /* Exactly RATE specified */
-      /* make sure it is in the range */
-      if (rate_required < IB_MIN_RATE || rate_required > IB_MAX_RATE)
-      {
-        osm_log( p_log, OSM_LOG_DEBUG,
-                 "__mgrp_request_is_realizable: "
-                 "Requested RATE %x is out of range\n",
-                 rate_required);
-        return FALSE;
-      }
-      break;
     default:
       break;
     }
+    /* make sure it still be in the range */
+    if (rate < IB_MIN_RATE || rate > IB_MAX_RATE)
+    {
+      osm_log( p_log, OSM_LOG_DEBUG,
+               "__mgrp_request_is_realizable: "
+               "Calculated RATE %x is out of range\n",
+               rate);
+      return FALSE;
+    }
   }
+  p_mcm_rec->rate = (rate_sel<<6) | rate;
 
   OSM_LOG_EXIT( p_rcv->p_log );
   return TRUE;



More information about the general mailing list