[openib-general] [PATCH] Fix capability mask enums in ib_verb s.h

Eitan Zahavi eitan at mellanox.co.il
Fri Jan 14 22:55:23 PST 2005


Roland wrote:
If I'm not mistaken, the capability mask enum in ib_verbs.h is
backwards.  According to chapter one of the IB spec, bits are numbered
with bit 0 being the least significant and bit 31 the most
significant.  The PortInfo CapabilityMask starts with IsSM at bit 1,
IsNoticeSupported at bit 2, etc.  (In fact the enum was not just
backwards -- some of the subtraction from 31 was wrong, so for example
even if it were correct for IB_PORT_SM to be the most significant
capability bit, it should have been 1 << 30 with one reserved bit at
the very top of the word)


[EZ] The capability mask is given probably in host order and assumes
somewhere when it is being sent in the PortInfo to be going through host to
network reordering.
[EZ] Note that being a 32 bit wide field you can not directly code it in
network order, using shift operators (which are always perform in host
order). So there is no way to avoid running the host to network reordering.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20050115/a8e23651/attachment.html>


More information about the general mailing list