> where exactly does the following math come from?
 > 
 > static inline struct ipoib_neigh **to_ipoib_neigh(struct neighbour *neigh)
 > {
 >         return (struct ipoib_neigh **) (neigh->ha + 24 -
 >                                         (offsetof(struct neighbour, ha) & 
 > 4));
 > }
 > 
 > 1. What does & 4 do here?
 > 2. Why are we subsrctucting a function of ha offset?

No #3 again ;)

 > 4. What is 24? Is it related to INFINIBAND_ALEN?

Yes, 24 is INFINIBAND_ALEN + 4.  Maybe it would be clearer to write it
that way.

The idea is that we want to get something aligned to 8 bytes.  I'd
have to check again to be sure but I think that on some architectures,
the beginning ha member of struct neighbour is only aligned to 4
bytes, so we should offset by 20 bytes to get to an alignment of 8 and
still leave room for the real hardware address.

 - R.
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to