[U-Boot] [PATCH 0/4] Network defrag

Robin Getz rgetz at blackfin.uclinux.org
Mon Aug 17 19:21:44 CEST 2009


On Sat 8 Aug 2009 05:50, Ben Warren pondered:
> Allesandro,
> 
> Alessandro Rubini wrote:
> > I finally fixed the defrag code, testing with NFS as well.
> > Didn't take performance figures, tough, for lack of time.
> >
> > I wanted to do "config + environment" for the NFS case, like tftp, but
> > didnt' do the second step out of laziness (also, the source file has
> > long lines while I have 80 columns).
> >
> > For the record, I added the check on ip_src and ip_dst, but everything
> > stopped working. So I reverted that instead of entering a long
> > debugging session.
> >
> > The CONFIG_NET_MAXDEFRAG argument is the actual payload, so I add NFS
> > overhead to that figure, which is expected to a beautiful 4096 or
> > 8192.  I feel this is better than other options, as the person writing
> > the config is not expected to know how much protocol overhead is
> > there.
> >
> > Alessandro Rubini (4):
> >   net: defragment IP packets
> >   tftp: get the tftp block size from config file and from the
> >     environment

I noticed that while playing with this, that if you set the 
"tftpblocksize" environment, do a transfer, and then clear it, it
does not go back to the default setting. I was not sure if this was
the intended or not, but this fixes it (and provides a small code size
reduction when this option is not activated).

Also wondering -- if the user sets the "tftpblocksize" to a number larger
than IP_MAXUDP, the transfer will never finish. Should this be restricted
here?


diff --git a/net/tftp.c b/net/tftp.c
index 9544691..56db247 100644
--- a/net/tftp.c
+++ b/net/tftp.c
+#ifdef CONFIG_TFTP_BLOCKSIZE
 	/* Allow the user to choose tftpblocksize */
 	if ((ep = getenv("tftpblocksize")) != NULL)
 		TftpBlkSizeOption = simple_strtol(ep, NULL, 10);
+	else
+		TftpBlkSizeOption = TFTP_MTU_BLOCKSIZE;
 	debug("tftp block size is %i\n", TftpBlkSizeOption);
+#endif



More information about the U-Boot mailing list