Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vxlan: Fix to enable UDP checksums on interface

Add definition to vxlan nla_policy for UDP checksum. This is necessary
to enable UDP checksums on VXLAN.

In some instances, enabling UDP checksums can improve performance on
receive for devices that return legacy checksum-unnecessary for UDP/IP.
Also, UDP checksum provides some protection against VNI corruption.

Testing:

Ran 200 instances of TCP_STREAM and TCP_RR on bnx2x.

TCP_STREAM
IPv4, without UDP checksums
14.41% TX CPU utilization
25.71% RX CPU utilization
9083.4 Mbps
IPv4, with UDP checksums
13.99% TX CPU utilization
13.40% RX CPU utilization
9095.65 Mbps

TCP_RR
IPv4, without UDP checksums
94.08% TX CPU utilization
156/248/462 90/95/99% latencies
1.12743e+06 tps
IPv4, with UDP checksums
94.43% TX CPU utilization
158/250/462 90/95/99% latencies
1.13345e+06 tps

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Tom Herbert and committed by
David S. Miller
5c91ae08 a1f5313c

+3
+3
drivers/net/vxlan.c
··· 2233 2233 [IFLA_VXLAN_L2MISS] = { .type = NLA_U8 }, 2234 2234 [IFLA_VXLAN_L3MISS] = { .type = NLA_U8 }, 2235 2235 [IFLA_VXLAN_PORT] = { .type = NLA_U16 }, 2236 + [IFLA_VXLAN_UDP_CSUM] = { .type = NLA_U8 }, 2237 + [IFLA_VXLAN_UDP_ZERO_CSUM6_TX] = { .type = NLA_U8 }, 2238 + [IFLA_VXLAN_UDP_ZERO_CSUM6_RX] = { .type = NLA_U8 }, 2236 2239 }; 2237 2240 2238 2241 static int vxlan_validate(struct nlattr *tb[], struct nlattr *data[])