[ofa-general] Re: [PATCH] IB/core: Enhance SMI for switch support

Hal Rosenstock halr at voltaire.com
Thu Mar 29 12:47:58 PDT 2007


On Thu, 2007-03-29 at 13:27, Suresh Shelvapille wrote:
> Roland:
> 
> None of the functions in smi.c follow your definition. 
> 0 is used to say discard packet and 1 for completion up the stack.

I don't think that is quite right in what the meaning is but not sure it
matters in terms of what is being discussed:
/*
 * Return 1 if the received DR SMP should be forwarded to the send queue
 * Return 0 if the SMP should be completed up the stack
 */

Also, in mad.c, 0 is treated as a local SMP and the driver/hardware is
given the right of first refusal. This is completion up the stack.

1 means that the SMP should be forwarded to the send queue. If some SMI
updates and checks fail on this, it is then discarded before passed to
the driver/hardware.

> So, I am not sure if reworking this one function with 3 return values buys
> anything.

I'm not following what you mean. It already has 3 return values.

-- Hal

> Thanks,
> Suri
> 
> > -----Original Message-----
> > From: general-bounces at lists.openfabrics.org [mailto:general-bounces at lists.openfabrics.org] On Behalf
> > Of Roland Dreier
> > Sent: Thursday, March 29, 2007 1:57 PM
> > To: Hal Rosenstock
> > Cc: general at lists.openfabrics.org
> > Subject: Re: [ofa-general] Re: [PATCH] IB/core: Enhance SMI for switch support
> > 
> >  > >   Especially the "if (!retsmi)" is very
> >  > > hard to follow.
> >  >
> >  > Is it hard to follow ?
> > 
> > It doesn't follow the convention of returning 0 if success, non-zero
> > if failure -- the only way I could know that !retsmi means something
> > other than "success" is if I go read the comment that tells me "0 if
> > the SMP should be completed up the stack," and there's no reason why I
> > would go search for that comment.
> > 
> >  - R.
> > _______________________________________________
> > general mailing list
> > general at lists.openfabrics.org
> > http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
> > 
> > To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
> 




More information about the general mailing list