[openib-general] Re: [PATCH] Fix ib_pack/unpack for 64 bits

Hal Rosenstock halr at voltaire.com
Thu Jun 23 09:14:53 PDT 2005


On Thu, 2005-06-23 at 12:04, Roland Dreier wrote:
>     Hal> Fix ib_pack/unpack for 64 bits
> 
> Can you be more specific about what this is fixing?

It fixes 64 bit sizes (at least on 32 bit machines). The problem was
with the mask computation when size_bits = 64.

mask = cpu_to_be64(((1ull << desc[i].size_bits) - 1) << shift);

yielded a mask of 0 (for size_bits 64 and shift of 0). The 32 bit mask
computation relies on the 33rd bit. In this case, shifting the 1 64 bits
does not put it in the 65th bit which is needed for proper mask
calculation.

I may not have handled the shift part properly in my patch.

-- Hal






More information about the general mailing list