[ofa-general] [PATCH] IPoIB UD 4K MTU support

Roland Dreier rdreier at cisco.com
Thu Jan 24 13:29:07 PST 2008


OK, this is some half-baked thinking based on reading the patch.  I
don't know the right answer here -- I am hoping to spark discussion
that makes the correct thing clear:

 > +static inline int ipoib_ud_mtu(unsigned int ib_mtu) 
 > +{
 > +	return (ib_mtu < 4096) ? (ib_mtu - IPOIB_ENCAP_LEN) :
 > +				 (ib_mtu - IB_GRH_BYTES - IPOIB_ENCAP_LEN - 4);
 > +}

reading this, my first reaction is that the magic 4096 constant should
have a name.  And in fact the most obvious name for it is PAGE_SIZE.
However, this means that (assuming everyone can handle an IB MTU of
4096), systems with PAGE_SIZE > 4096 would come up with a different
IPoIB MTU than systems with PAGE_SIZE == 4096.  And I'm not sure
whether that would cause problems or not.  (eg TCP should be OK)

But then in general, if we use the approach here (which is very
appealing because it's so simple), Linux will potentially have an MTU
different from other OSes that might choose a different way to handle
an IB MTU of 4096.  So does that mean that we should use a more
complicated approach to get the max possible MTU of 4096 - 4?

(As a side note, that magic constant of 4 above, which comes from:

	/*
	 * 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);

probably wants a name too, in the interest of maintainability)

 - R.



More information about the general mailing list