[openib-general] ipoib_ib.c - alignment questions
Michael S. Tsirkin
mst at mellanox.co.il
Sun Oct 8 21:21:42 PDT 2006
Hi, Roland!
ipoib_ib.c has this:
/*
* IB will leave a 40 byte gap for a GRH and IPoIB adds a 4 byte
* header. So we need 4 more bytes to get to 48 and align the
* IP header to a multiple of 16.
*/
skb_reserve(skb, 4);
Some questions on this:
- Why do we try to align the IP header to a multiple of 16?
- This works if skb start is 16 byte aligned.
What guarantees that skb data is 16 byte aligned?
- Would the following code be better than the comment:
skb_reserve(skb, ALIGN(IB_GRH_BYTES + IPOIB_ENCAP_LEN, 16) -
IB_GRH_BYTES - IPOIB_ENCAP_LEN);
comments have a bigger tenency to bitrot ...
--
MST
More information about the general
mailing list