netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
To: netdev@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: xen-netfront sets partial checksum at wrong offset
Date: Thu, 7 May 2015 12:44:24 -0700 (PDT)	[thread overview]
Message-ID: <ee74926e-deb3-4cbc-9798-42c19f4fe219@default> (raw)

Hello All,

When handle_incoming_queue (xen-netfront.c) calls checksum_setup()
the transport header didn't seem to be initialized yet.
skb_checksum_setup_ipv4 ends up initializing the checksum at incorrect offset. 
        if (recalculate)
                *csum = ~csum_tcpudp_magic(ip_hdr(skb)->saddr,
                                           ip_hdr(skb)->daddr,
                                           skb->len - off,
                                           ip_hdr(skb)->protocol, 0);

where csum is &tcp_hdr(skb)->check.

This problem got exposed when LRO was ON on the host.
It hits this case in checksum_setup().
        /*
         * A GSO SKB must be CHECKSUM_PARTIAL. However some buggy
         * peers can fail to set NETRXF_csum_blank when sending a GSO
         * frame. In this case force the SKB to CHECKSUM_PARTIAL and
         * recalculate the partial checksum.
         */

skb->ip_summed was CHECKSUM_UNNECESSARY. 
The guest was at 3.8.13 kernel.

I can send a patch if you think the problem exists in current releases too.

Thanks.

Venkat

             reply	other threads:[~2015-05-07 19:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-07 19:44 Venkat Venkatsubra [this message]
2015-05-11 15:08 ` [Xen-devel] xen-netfront sets partial checksum at wrong offset Konrad Rzeszutek Wilk
2015-05-11 17:25   ` Venkat Venkatsubra
2015-05-29 10:34     ` Jan Beulich
2015-05-29 10:39       ` Wei Liu
2015-05-29 10:50         ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ee74926e-deb3-4cbc-9798-42c19f4fe219@default \
    --to=venkat.x.venkatsubra@oracle.com \
    --cc=netdev@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).