* [PATCH net] net/core: Handle csum for CHECKSUM_COMPLETE VXLAN forwarding
@ 2014-12-19 23:32 Jay Vosburgh
2014-12-22 21:21 ` David Miller
2014-12-26 21:17 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Jay Vosburgh @ 2014-12-19 23:32 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller
When using VXLAN tunnels and a sky2 device, I have experienced
checksum failures of the following type:
[ 4297.761899] eth0: hw csum failure
[...]
[ 4297.765223] Call Trace:
[ 4297.765224] <IRQ> [<ffffffff8172f026>] dump_stack+0x46/0x58
[ 4297.765235] [<ffffffff8162ba52>] netdev_rx_csum_fault+0x42/0x50
[ 4297.765238] [<ffffffff8161c1a0>] ? skb_push+0x40/0x40
[ 4297.765240] [<ffffffff8162325c>] __skb_checksum_complete+0xbc/0xd0
[ 4297.765243] [<ffffffff8168c602>] tcp_v4_rcv+0x2e2/0x950
[ 4297.765246] [<ffffffff81666ca0>] ? ip_rcv_finish+0x360/0x360
These are reliably reproduced in a network topology of:
container:eth0 == host(OVS VXLAN on VLAN) == bond0 == eth0 (sky2) -> switch
When VXLAN encapsulated traffic is received from a similarly
configured peer, the above warning is generated in the receive
processing of the encapsulated packet. Note that the warning is
associated with the container eth0.
The skbs from sky2 have ip_summed set to CHECKSUM_COMPLETE, and
because the packet is an encapsulated Ethernet frame, the checksum
generated by the hardware includes the inner protocol and Ethernet
headers.
The receive code is careful to update the skb->csum, except in
__dev_forward_skb, as called by dev_forward_skb. __dev_forward_skb
calls eth_type_trans, which in turn calls skb_pull_inline(skb, ETH_HLEN)
to skip over the Ethernet header, but does not update skb->csum when
doing so.
This patch resolves the problem by adding a call to
skb_postpull_rcsum to update the skb->csum after the call to
eth_type_trans.
Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
---
Please consider for 3.17 -stable; I do not see the warning on 3.14.
net/core/dev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/core/dev.c b/net/core/dev.c
index f411c28..df755e5 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1694,6 +1694,7 @@ int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
skb_scrub_packet(skb, true);
skb->protocol = eth_type_trans(skb, dev);
+ skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN);
return 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] net/core: Handle csum for CHECKSUM_COMPLETE VXLAN forwarding
2014-12-19 23:32 [PATCH net] net/core: Handle csum for CHECKSUM_COMPLETE VXLAN forwarding Jay Vosburgh
@ 2014-12-22 21:21 ` David Miller
2014-12-26 21:17 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-12-22 21:21 UTC (permalink / raw)
To: jay.vosburgh; +Cc: netdev
From: Jay Vosburgh <jay.vosburgh@canonical.com>
Date: Fri, 19 Dec 2014 15:32:00 -0800
> The receive code is careful to update the skb->csum, except in
> __dev_forward_skb, as called by dev_forward_skb. __dev_forward_skb
> calls eth_type_trans, which in turn calls skb_pull_inline(skb, ETH_HLEN)
> to skip over the Ethernet header, but does not update skb->csum when
> doing so.
Hmmm, wasn't there some discussion about doing the skb_postpull_rcsum()
in eth_type_trans()?
But I guess that won't work for non-encapsulated ethernet cases?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net/core: Handle csum for CHECKSUM_COMPLETE VXLAN forwarding
2014-12-19 23:32 [PATCH net] net/core: Handle csum for CHECKSUM_COMPLETE VXLAN forwarding Jay Vosburgh
2014-12-22 21:21 ` David Miller
@ 2014-12-26 21:17 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-12-26 21:17 UTC (permalink / raw)
To: jay.vosburgh; +Cc: netdev
From: Jay Vosburgh <jay.vosburgh@canonical.com>
Date: Fri, 19 Dec 2014 15:32:00 -0800
>
> When using VXLAN tunnels and a sky2 device, I have experienced
> checksum failures of the following type:
...
> These are reliably reproduced in a network topology of:
>
> container:eth0 == host(OVS VXLAN on VLAN) == bond0 == eth0 (sky2) -> switch
>
> When VXLAN encapsulated traffic is received from a similarly
> configured peer, the above warning is generated in the receive
> processing of the encapsulated packet. Note that the warning is
> associated with the container eth0.
>
> The skbs from sky2 have ip_summed set to CHECKSUM_COMPLETE, and
> because the packet is an encapsulated Ethernet frame, the checksum
> generated by the hardware includes the inner protocol and Ethernet
> headers.
>
> The receive code is careful to update the skb->csum, except in
> __dev_forward_skb, as called by dev_forward_skb. __dev_forward_skb
> calls eth_type_trans, which in turn calls skb_pull_inline(skb, ETH_HLEN)
> to skip over the Ethernet header, but does not update skb->csum when
> doing so.
>
> This patch resolves the problem by adding a call to
> skb_postpull_rcsum to update the skb->csum after the call to
> eth_type_trans.
>
> Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Applied and queued up for -stable, thanks Jay.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-12-26 21:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-19 23:32 [PATCH net] net/core: Handle csum for CHECKSUM_COMPLETE VXLAN forwarding Jay Vosburgh
2014-12-22 21:21 ` David Miller
2014-12-26 21:17 ` David Miller
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).