[ofw] wrong usage of ib_member_set_state

Smith, Stan stan.smith at intel.com
Thu Sep 29 10:20:23 PDT 2011


Hello Tzachi,
  What did you decide to do about replacing ib_member_set_state() with ib_member_set_join_state() and then removing the 'ib_member_set_state()' definition from ib_types.h?

Thanks,

Stan.

From: ofw-bounces at lists.openfabrics.org [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Tzachi Dar
Sent: Tuesday, September 27, 2011 12:19 PM
To: ofw at lists.openfabrics.org; Hal Rosenstock
Subject: [ofw] wrong usage of ib_member_set_state


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?



Thanks

Tzachi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20110929/428d47d6/attachment.html>


More information about the ofw mailing list