> [ I really hope we can figure out a way not to change IP IDs, because I think > an inverted version of Tom's generic TSO could also work as a generic h/w GRO > accelerator. In its simplest form, the hardware just remembers the previous > packet, then gives us the length of the common prefix. If that ends four > bytes > into a TCP header, then the packet is a candidate for GRO; otherwise not. I > haven't worked out all the details yet, but it's clear that non-constant IP > IDs > would cause problems. (If it's only the innermost IP ID that's changing, we > can probably still cope, but the performance gain will be less and the > implementation could start to get ugly.) ]
That's an interesting idea. This should work in IPv6 now and nearly all encapsulation protocols (GRE w/ csum doesn't work this way for instance), the logic to just match to a GRO state would be as simple as comparing packet hashes and then do a memcmp over the headers. For IPv4 maybe do a masked compare-- we still need to validate the header checksum but that is easily checked without checksumming over the whole header by just adding in the diff in the dynamic fields (i.e. something like C_new == C_Old + (IP_ID_new - IP_ID_old) Tom > > -- > -Ed > > [1] http://lxr.free-electrons.com/source/drivers/net/slip/slhc.c#L425