<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>RE: [openib-general] [PATCH] Fix capability mask enums in ib_verbs.h</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Roland wrote:</FONT>
<BR><FONT SIZE=2>If I'm not mistaken, the capability mask enum in ib_verbs.h is</FONT>
<BR><FONT SIZE=2>backwards. According to chapter one of the IB spec, bits are numbered</FONT>
<BR><FONT SIZE=2>with bit 0 being the least significant and bit 31 the most</FONT>
<BR><FONT SIZE=2>significant. The PortInfo CapabilityMask starts with IsSM at bit 1,</FONT>
<BR><FONT SIZE=2>IsNoticeSupported at bit 2, etc. (In fact the enum was not just</FONT>
<BR><FONT SIZE=2>backwards -- some of the subtraction from 31 was wrong, so for example</FONT>
<BR><FONT SIZE=2>even if it were correct for IB_PORT_SM to be the most significant</FONT>
<BR><FONT SIZE=2>capability bit, it should have been 1 << 30 with one reserved bit at</FONT>
<BR><FONT SIZE=2>the very top of the word)</FONT>
</P>
<BR>
<P><FONT SIZE=2>[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.</FONT></P>
<P><FONT SIZE=2>[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.</FONT></P>
</BODY>
</HTML>