[openib-general] Re: ipoib: question

Michael S. Tsirkin mst at mellanox.co.il
Wed Dec 14 13:59:15 PST 2005


Quoting r. Roland Dreier <rdreier at cisco.com>:
> Subject: Re: ipoib: question
> 
>     Roland> The idea is that we want to get something aligned to 8 bytes.
> 
>     Michael> Does & 4 do that?
> 
> I think so -- I'd have to check to be sure, but the idea is that if
> the offset of ha is 4 mod 8, then we should subtract off 4, and if
> it's 0 mod 8, then we should subtract off 0.  So "& 4" is right, I think.

Oh, I see.
Is this better?

-        return (struct ipoib_neigh **) (neigh->ha + 24 -
-                                        (offsetof(struct neighbour, ha) & 4));
+        return (void*)neigh +
		 ALIGN(offsetof(struct neighbour, ha) + INFINIBAND_ALEN, x)



-- 
MST



More information about the general mailing list