[OpenAFS-devel] RX_MAX_FRAGS (yet again)

chas williams chas@cmf.nrl.navy.mil
Mon, 01 Oct 2001 11:00:20 -0400


ok, while your patches might fix the problem i am not sure that they are
entirely correct.  without trying the patch, rxdebug shows the right 
ifMTU for my linux host already:

Peer at host 134.207.10.66, port 7001
        ifMTU 8524      natMTU 1444     maxMTU 5692

look at rxi_AdjustMaxMTU(), and how its used in rxi_ReceiveAckPacket():

	tSize = (afs_uint32)ntohl(tSize);
	tSize = (afs_uint32)MIN(tSize, rx_MyMaxSendSize);
	tSize = rxi_AdjustMaxMTU(peer->natMTU, tSize);

natMTU is going to be MIN((int)pp->ifMTU, OLD_MAX_PACKET_SIZE) and 

int rxi_AdjustMaxMTU(int mtu, int peerMaxMTU)
{
	int maxMTU = mtu * rxi_nSendFrags;
	maxMTU = MIN(maxMTU, peerMaxMTU);
	return rxi_AdjustIfMTU(maxMTU);
}

so the largest xmit value ever used will be peer->natMTU * rxi_nSendFrags.

as proof, here is a solaris8 host (no ethernet interfaces plumbed)
and rxdebug shows:

Peer at host 134.207.10.106, port 7001
        ifMTU 8524      natMTU 1444     maxMTU 5692

under solaris afs looks at the interface table directly in the kernel so
again why the strange 5692 limit?  RX_MAX_FRAGS!


however, i would like to make sure i am not completely and utterly nuts
(i was painting this weekend it could still be the fumes)  here are
my assumptions:

. rx never sends a packet bigger than the MIN(our ifmtu, peer ifmtu)

. a jumbogram is nothing but a series of rx datagrams in a single packet
  (whether its a 3.4a or 3.5 jumbogram)

. RX_MAX_FRAGS controls the maximum of rx datagrams in a jumbogram (4)

. the biggest rx datagram is ~1412 bytes

. rx_MyMaxSendSize is the max send size afs will ever use (8588)

. rx_maxReceiveSize is the max recv size 

. RX_MAX_PACKET_SIZE is the maximum packet size (16384)


while RX_MAX_PACKET_SIZE seems large enough, its easily quickly limited by
RX_MAX_FRAGS and then rx_MyMaxSendSize.


btw, given the above, the following computation makes no sense to me unless the
mtu is the natMTU, and not the interface mtu:

	rxmtu = rxi_AdjustIfMTU(rxmtu);
	maxmtu = rxmtu * rxi_nRecvFrags + ((rxi_nRecvFrags-1) * UDP_HDR_SIZE);
	maxmtu = rxi_AdjustMaxMTU(rxmtu, maxmtu);


rxmtu is first normalized to a multiple of the rxdatagram size.  then,
the maxmtu is computed using that mtu size.  this has to be wrong.  this
would make the maxmtu much larger than the interface size which isnt desirable.