[ofw] wrong usage of ib_member_set_state

Hal Rosenstock halr at systemfabricworks.com
Tue Sep 27 13:17:31 PDT 2011


On 9/27/2011 3:19 PM, Tzachi Dar wrote:
>
> on windows we have the following 3 functions:
>
>  
>
> AL_INLINE void AL_API
> ib_member_set_state(
>  IN OUT   uint8_t* const    p_scope_state,
>  IN  const uint8_t      state )
> {
>  CL_ASSERT( state <= 0x0F );
>  /* State is LS 4-bits. */
>  *p_scope_state &= 0x0F;
>  *p_scope_state |= (state & 0x0F);
> }
>
>  
>
>  
>
> AL_INLINE void AL_API
> ib_member_set_join_state(
>  IN OUT   ib_member_rec_t    *p_mc_rec,
>  IN  const uint8_t      state )
> {
>  p_mc_rec->scope_state &= 0xF0;
>  p_mc_rec->scope_state |= (state & 0x0F);
> }
>
>  
>
>
> AL_INLINE uint8_t AL_API
> ib_member_set_scope_state(
>  IN  const uint8_t      scope,
>  IN  const uint8_t      state )
> {
>  /* Scope is MS 4-bits, state is LS 4-bits */
>  return ((scope << 4) | (state & 0xF));
> }
>
>  
>
>  
>
> Ipoib is using ib_member_set_state().
>
>  
>
> As far as I can tell this will cause the scope to be zero (on table 3,
> the value of 0 is reserved). Is this what we relay wanted to have?
>
Why is there a need for ib_member_set_state (aside from it being broken
due to clobbering scope) ? Why not eliminate this and just use
ib_member_set_join_state ? I know the signatures are a little different.
Is that the reason ?

 
-- Hal


>  
>
> Thanks
>
> Tzachi
>
>
>
> _______________________________________________
> ofw mailing list
> ofw at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20110927/a5ff8dee/attachment.html>


More information about the ofw mailing list