[U-Boot] [PATCH/RFC] net: defragment IP packets

Robin Getz rgetz at blackfin.uclinux.org
Mon Jul 27 13:46:52 CEST 2009


On Mon 27 Jul 2009 01:08, Ben Warren pondered:
> Hi Guys,
> 
> This is great work.  Thanks!  If you follow these guidelines, I'll pull 
> it into the net repo:
> 
> 1. Configurable block size (via a well-named CONFIG).  Choose a good 
>    default value.
> 2. Handle out-of-order fragments, and some test results showing that it 
>    works.

Are you OK with something that only has been tested with TFTP?

Looks like nfs.h also has:

/* Block size used for NFS read accesses.  A RPC reply packet (including  all
 * headers) must fit within a single Ethernet frame to avoid fragmentation.
 * Chosen to be a power of two, as most NFS servers are optimized for this.  
*/
#define NFS_READ_SIZE   1024

> 3. Make the feature configurable
> 4. Test with a TFTP server that doesn't have blksize feature enabled

It looks like the logic to do this is already there today - U-Boot uses a 
non-standard Block size (1468), and then falls back to 512 if it fails, or if 
the server doesn't ACK the option...

> I'm not sure about how to handle the configurability of this feature.

I think there are two issues:
 - core networks stuff (CONFIG_NET_FRAG_SIZE defines the size of a 
    reassembled packet, if it is not set, no reassembly code..)
 - default block size (if CONFIG_NET_FRAG_SIZE is defined, just read it from
    an env var?) or do you want a separate fixed CONFIG (and checks to make
    sure it is going to fit?)

> I  
> can see this being the default configuration in the future, but for now 
> it should probably be opt-in.  Let's see how it goes.



More information about the U-Boot mailing list