[Intel-wired-lan] [next PATCH v3 11/15] i40e/i40evf: Enable support for SKB_GSO_UDP_TUNNEL_CSUM
Jesse Brandeburg
jesse.brandeburg at intel.com
Tue Feb 2 23:10:00 UTC 2016
On Tue, 2 Feb 2016 14:49:24 -0800
Jesse Brandeburg <jesse.brandeburg at intel.com> wrote:
> On Sun, 24 Jan 2016 21:17:29 -0800
> Alexander Duyck <aduyck at mirantis.com> wrote:
>
> > The XL722 has support for providing the outer UDP tunnel checksum on
>
> X722, not XL722
>
> > transmits. Make use of this feature to support segmenting UDP tunnels with
> > outer checksums enabled.
> >
> > Signed-off-by: Alexander Duyck <aduyck at mirantis.com>
> > ---
>
> ...
>
> > + if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_TUNNEL_CSUM) {
> > + /* determine offset of outer transport header */
> > + l4_offset = l4.hdr - skb->data;
> > +
> > + /* remove payload length from outer checksum */
> > + paylen = (__force u16)l4.udp->check;
> > + paylen += ntohs(1) * (u16)~(skb->len - l4_offset);
>
> Can we get a comment about how this is supposed to work? Doesn't it
> have endian problems? I understand these lines are removing the payload
> length from the checksum by getting the length of the payload,
> inverting it and removing it from the checksum, and then below,
> updating the checksum, but it is really hard to follow why you use
> ntohs(1) without some explanation.
>
> > + l4.udp->check = ~csum_fold((__force __wsum)paylen);
> > + }
> > +
>
And, isn't this patch missing the check that enables outer UDP only in
the case of X722?
I expected to see an i40e_main.c change to tell the stack we support
UDP_TUNNEL_CSUM only on X722.
More information about the Intel-wired-lan
mailing list