diff mbox

[ovs-dev] ovs 2.4 vxlan udp csum isn't working

Message ID CAOrge3p2BNWVAvutG4tXLBAivty_yWTAri33M2=6yHAN+b5soQ@mail.gmail.com
State Accepted
Headers show

Commit Message

Zang MingJie Nov. 23, 2015, 11:17 a.m. UTC
Hi

I have set up an environment using ovs 2.4 with ovs shipped datapath
and kernel 3.14.

When perfing vxlan performance with csum enabled, I found checksum of
most udp packets are zero, but some are correct value not zero.

This is my vsctl on sender end:

Port "vxlan-0ab49c21"
    Interface "vxlan-0ab49c21"
        type: vxlan
        options: {csum="true", df_default="true", in_key=flow,
local_ip="10.180.156.34", out_key=flow, remote_ip="10.180.156.33"}

and its dp-flow when doing perf:

$ sudo ovs-dpctl dump-flows
recirc_id(0),in_port(3),eth(src=fa:16:3e:d8:06:a8,dst=fa:16:3e:7b:22:c1),eth_type(0x0800),ipv4(tos=0/0x3,frag=no),
packets:11587, bytes:192152422, used:0.001s, flags:P.,
actions:set(tunnel(tun_id=0x190,src=10.180.156.34,dst=10.180.156.33,ttl=64,flags(df,csum,key))),1
recirc_id(0),tunnel(tun_id=0x190,src=10.180.156.33,dst=10.180.156.34,ttl=64,flags(-df+csum+key)),in_port(1),skb_mark(0),eth(src=fa:16:3e:7b:22:c1,dst=fa:16:3e:d8:06:a8),eth_type(0x0800),ipv4(frag=no),
packets:32832, bytes:2332180, used:0.001s, flags:., actions:3

After some investment, finally I found the bug. All udp gso packet
doesn't have checksum. Here is the patch to fix it:

commit df4620805747bb7065eebe5b432b16b01973202c
Author: Zang MingJie <zealot0630@gmail.com>
Date:   Mon Nov 23 19:15:02 2015 +0800

    Fix vxlan udp csum of gso packet

    Signed-off-by: Zang MingJie <zealot0630@gmail.com>

Comments

Jesse Gross Nov. 23, 2015, 7:21 p.m. UTC | #1
On Mon, Nov 23, 2015 at 3:17 AM, Zang MingJie <zealot0630@gmail.com> wrote:
> Hi
>
> I have set up an environment using ovs 2.4 with ovs shipped datapath
> and kernel 3.14.
>
> When perfing vxlan performance with csum enabled, I found checksum of
> most udp packets are zero, but some are correct value not zero.
>
> This is my vsctl on sender end:
>
> Port "vxlan-0ab49c21"
>     Interface "vxlan-0ab49c21"
>         type: vxlan
>         options: {csum="true", df_default="true", in_key=flow,
> local_ip="10.180.156.34", out_key=flow, remote_ip="10.180.156.33"}
>
> and its dp-flow when doing perf:
>
> $ sudo ovs-dpctl dump-flows
> recirc_id(0),in_port(3),eth(src=fa:16:3e:d8:06:a8,dst=fa:16:3e:7b:22:c1),eth_type(0x0800),ipv4(tos=0/0x3,frag=no),
> packets:11587, bytes:192152422, used:0.001s, flags:P.,
> actions:set(tunnel(tun_id=0x190,src=10.180.156.34,dst=10.180.156.33,ttl=64,flags(df,csum,key))),1
> recirc_id(0),tunnel(tun_id=0x190,src=10.180.156.33,dst=10.180.156.34,ttl=64,flags(-df+csum+key)),in_port(1),skb_mark(0),eth(src=fa:16:3e:7b:22:c1,dst=fa:16:3e:d8:06:a8),eth_type(0x0800),ipv4(frag=no),
> packets:32832, bytes:2332180, used:0.001s, flags:., actions:3
>
> After some investment, finally I found the bug. All udp gso packet
> doesn't have checksum. Here is the patch to fix it:

Thanks a lot for tracking that down. I applied this patch to master
and branch-2.4.
diff mbox

Patch

diff --git a/datapath/linux/compat/udp_tunnel.c
b/datapath/linux/compat/udp_tunnel.c
index a3223fd..19a1ea5 100644
--- a/datapath/linux/compat/udp_tunnel.c
+++ b/datapath/linux/compat/udp_tunnel.c
@@ -133,7 +133,7 @@  void ovs_udp_csum_gso(struct sk_buff *skb)
        /* csum segment if tunnel sets skb with csum. The cleanest way
         * to do this just to set it up from scratch. */
        skb->ip_summed = CHECKSUM_NONE;
-       udp_set_csum(true, skb, iph->saddr, iph->daddr,
+       udp_set_csum(false, skb, iph->saddr, iph->daddr,
                     skb->len - udp_offset);
 }
 EXPORT_SYMBOL_GPL(ovs_udp_csum_gso);