* xen-netfront sets partial checksum at wrong offset
@ 2015-05-07 19:44 Venkat Venkatsubra
2015-05-11 15:08 ` [Xen-devel] " Konrad Rzeszutek Wilk
0 siblings, 1 reply; 6+ messages in thread
From: Venkat Venkatsubra @ 2015-05-07 19:44 UTC (permalink / raw)
To: netdev, xen-devel
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
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Xen-devel] xen-netfront sets partial checksum at wrong offset
2015-05-07 19:44 xen-netfront sets partial checksum at wrong offset Venkat Venkatsubra
@ 2015-05-11 15:08 ` Konrad Rzeszutek Wilk
2015-05-11 17:25 ` Venkat Venkatsubra
0 siblings, 1 reply; 6+ messages in thread
From: Konrad Rzeszutek Wilk @ 2015-05-11 15:08 UTC (permalink / raw)
To: Venkat Venkatsubra, boris.ostrovsky, david.vrabel, ian.campbell
Cc: netdev, xen-devel
On Thu, May 07, 2015 at 12:44:24PM -0700, Venkat Venkatsubra wrote:
> 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.
Please CC the maintainers of the driver. You can get that from 'scripts/get_maintainer.pl'
I've done that for you.
>
> Thanks.
>
> Venkat
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [Xen-devel] xen-netfront sets partial checksum at wrong offset
2015-05-11 15:08 ` [Xen-devel] " Konrad Rzeszutek Wilk
@ 2015-05-11 17:25 ` Venkat Venkatsubra
2015-05-29 10:34 ` Jan Beulich
0 siblings, 1 reply; 6+ messages in thread
From: Venkat Venkatsubra @ 2015-05-11 17:25 UTC (permalink / raw)
To: Konrad Wilk, Boris Ostrovsky, david.vrabel, ian.campbell,
wei.liu2
Cc: netdev, xen-devel
>
> Please CC the maintainers of the driver. You can get that from
> 'scripts/get_maintainer.pl'
>
> I've done that for you.
Thanks, Konrad.
I am copying Wei too who had fixed the below problem earlier.
It fixed the incorrect ip_hdr(). tcp_hdr() still needs to fixed.
commit d554f73df6bc35ac8f6a65e5560bf1d31dfebed9
Author: Wei Liu <wei.liu2@citrix.com>
Date: Wed Feb 19 18:48:34 2014 +0000
xen-netfront: reset skb network header before checksum
In ed1f50c3a ("net: add skb_checksum_setup") we introduced some checksum
functions in core driver. Subsequent change b5cf66cd1 ("xen-netfront:
use new skb_checksum_setup function") made use of those functions to
replace its own implementation.
However with that change netfront is broken. It sees a lot of checksum
error. That's because its own implementation of checksum function was a
bit hacky (dereferencing skb->data directly) while the new function was
implemented using ip_hdr(). The network header is not reset before skb
is passed to the new function. When the new function tries to do its
job, it's confused and reports error.
The fix is simple, we need to reset network header before passing skb to
checksum function. Netback is not affected as it already does the right
thing.
Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Paul Durrant <paul.durrant@citrix.com>
Tested-By: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: David S. Miller <davem@davemloft.net>
Thanks.
Venkat
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Xen-devel] xen-netfront sets partial checksum at wrong offset
2015-05-11 17:25 ` Venkat Venkatsubra
@ 2015-05-29 10:34 ` Jan Beulich
2015-05-29 10:39 ` Wei Liu
0 siblings, 1 reply; 6+ messages in thread
From: Jan Beulich @ 2015-05-29 10:34 UTC (permalink / raw)
To: Venkat Venkatsubra
Cc: david.vrabel, ian.campbell, wei.liu2, xen-devel, Boris Ostrovsky,
Konrad Wilk, netdev
>>> On 11.05.15 at 19:25, <venkat.x.venkatsubra@oracle.com> wrote:
>>
>> Please CC the maintainers of the driver. You can get that from
>> 'scripts/get_maintainer.pl'
>>
>> I've done that for you.
>
> Thanks, Konrad.
>
> I am copying Wei too who had fixed the below problem earlier.
> It fixed the incorrect ip_hdr(). tcp_hdr() still needs to fixed.
>
> commit d554f73df6bc35ac8f6a65e5560bf1d31dfebed9
> Author: Wei Liu <wei.liu2@citrix.com>
> Date: Wed Feb 19 18:48:34 2014 +0000
>
> xen-netfront: reset skb network header before checksum
So no response at all so far from the maintainers made me look into
this: I first thought what we need would be calls to
skb_probe_transport_header() in skb_checksum_setup_ip() after
each of the skb_maybe_pull_tail() functions. But
skb_partial_csum_set() already calls skb_set_transport_header(),
so I now think things ought to be fine without any change. Can
you clarify what you think is missing? Or is this an issue in just the
old (3.8.x) kernel you're using?
(In either case netback's xenvif_tx_submit() calling
skb_probe_transport_header() would seem pointless, as
skb_checksum_setup() - with or without a fix - ought to be taking
care of this anyway.)
Jan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xen-devel] xen-netfront sets partial checksum at wrong offset
2015-05-29 10:34 ` Jan Beulich
@ 2015-05-29 10:39 ` Wei Liu
2015-05-29 10:50 ` Jan Beulich
0 siblings, 1 reply; 6+ messages in thread
From: Wei Liu @ 2015-05-29 10:39 UTC (permalink / raw)
To: Jan Beulich
Cc: Venkat Venkatsubra, david.vrabel, ian.campbell, wei.liu2,
xen-devel, Boris Ostrovsky, Konrad Wilk, netdev
On Fri, May 29, 2015 at 11:34:07AM +0100, Jan Beulich wrote:
> >>> On 11.05.15 at 19:25, <venkat.x.venkatsubra@oracle.com> wrote:
> >>
> >> Please CC the maintainers of the driver. You can get that from
> >> 'scripts/get_maintainer.pl'
> >>
> >> I've done that for you.
> >
> > Thanks, Konrad.
> >
> > I am copying Wei too who had fixed the below problem earlier.
> > It fixed the incorrect ip_hdr(). tcp_hdr() still needs to fixed.
> >
> > commit d554f73df6bc35ac8f6a65e5560bf1d31dfebed9
> > Author: Wei Liu <wei.liu2@citrix.com>
> > Date: Wed Feb 19 18:48:34 2014 +0000
> >
> > xen-netfront: reset skb network header before checksum
>
> So no response at all so far from the maintainers made me look into
> this: I first thought what we need would be calls to
> skb_probe_transport_header() in skb_checksum_setup_ip() after
> each of the skb_maybe_pull_tail() functions. But
> skb_partial_csum_set() already calls skb_set_transport_header(),
> so I now think things ought to be fine without any change. Can
> you clarify what you think is missing? Or is this an issue in just the
> old (3.8.x) kernel you're using?
>
I think this is the follow-up thread <20150512013424.GA7960@oracle.com>
And the conclusion is 3.8 is too old so the fix is not there.
> (In either case netback's xenvif_tx_submit() calling
> skb_probe_transport_header() would seem pointless, as
> skb_checksum_setup() - with or without a fix - ought to be taking
> care of this anyway.)
>
Patches welcome. :-)
Wei.
> Jan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xen-devel] xen-netfront sets partial checksum at wrong offset
2015-05-29 10:39 ` Wei Liu
@ 2015-05-29 10:50 ` Jan Beulich
0 siblings, 0 replies; 6+ messages in thread
From: Jan Beulich @ 2015-05-29 10:50 UTC (permalink / raw)
To: wei.liu2
Cc: david.vrabel, ian.campbell, xen-devel, Boris Ostrovsky,
Konrad Wilk, Venkat Venkatsubra, netdev
>>> On 29.05.15 at 12:39, <wei.liu2@citrix.com> wrote:
> On Fri, May 29, 2015 at 11:34:07AM +0100, Jan Beulich wrote:
>> >>> On 11.05.15 at 19:25, <venkat.x.venkatsubra@oracle.com> wrote:
>> >>
>> >> Please CC the maintainers of the driver. You can get that from
>> >> 'scripts/get_maintainer.pl'
>> >>
>> >> I've done that for you.
>> >
>> > Thanks, Konrad.
>> >
>> > I am copying Wei too who had fixed the below problem earlier.
>> > It fixed the incorrect ip_hdr(). tcp_hdr() still needs to fixed.
>> >
>> > commit d554f73df6bc35ac8f6a65e5560bf1d31dfebed9
>> > Author: Wei Liu <wei.liu2@citrix.com>
>> > Date: Wed Feb 19 18:48:34 2014 +0000
>> >
>> > xen-netfront: reset skb network header before checksum
>>
>> So no response at all so far from the maintainers made me look into
>> this: I first thought what we need would be calls to
>> skb_probe_transport_header() in skb_checksum_setup_ip() after
>> each of the skb_maybe_pull_tail() functions. But
>> skb_partial_csum_set() already calls skb_set_transport_header(),
>> so I now think things ought to be fine without any change. Can
>> you clarify what you think is missing? Or is this an issue in just the
>> old (3.8.x) kernel you're using?
>>
>
> I think this is the follow-up thread <20150512013424.GA7960@oracle.com>
>
> And the conclusion is 3.8 is too old so the fix is not there.
Ah, right. Seems like I failed to remove the earlier mail from my list of
things to look at when this came through. Sorry for the noise then.
Jan
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-05-29 10:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-07 19:44 xen-netfront sets partial checksum at wrong offset Venkat Venkatsubra
2015-05-11 15:08 ` [Xen-devel] " 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
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).