On Mon, May 7, 2018 at 2:08 PM, Alexander Duyck <[email protected]> wrote: > From: Alexander Duyck <[email protected]> > > This patch is meant to allow us to avoid having to recompute the checksum > from scratch and have it passed as a parameter. > > Instead of taking that approach we can take advantage of the fact that the > length that was used to compute the existing checksum is included in the > UDP header. > > Finally to avoid the need to invert the result we can just call csum16_add > and csum16_sub directly. By doing this we can avoid a number of > instructions in the loop that is handling segmentation. > > Signed-off-by: Alexander Duyck <[email protected]>
Acked-by: Willem de Bruijn <[email protected]> Small aside: instead of open-coding the csum16 operations, it might make sense to define a pseudo_csum_replace2 function and convert csum_replace2 to call that and only do the inversion.
