Skip to content
Snippets Groups Projects
Commit 71086617 authored by Dmitry Fleytman's avatar Dmitry Fleytman Committed by Avi Kivity
Browse files

netinet: Fix broken checksum verification in LRO mechanism

This patch applies bugfix published on FreeBSD list at Feb 2013:
http://lists.freebsd.org/pipermail/svn-src-stable-9/2013-February/003928.html



LRO mechanism is broken on systems without IP checksum verification offload.
Due to improper checksum verification RX packets omit LRO path and go
directly to TCP stack which is not good for performance.

EC2 Xen is one example of such a system.
This bug is one of the reasons we see bad performance on Amazon.

Some test results w/ and w/o the fix:

Buffer size    Before         After          Improvement %
TCP TX
32             557.52         1386.28        149
64             552.38         1385.99        151
128            546.43         1401.46        156
256            565.25         1382.28        145
512            557.32         1375.23        147
1024           549.71         1356.69        147
2048           551.11         1371.92        149
4096           556.13         1383.67        149
8192           559.49         1364.05        144
16384          567.25         1366.48        141
32768          546.18         1366.63        150
65536          553.4          1353.87        145

TCP RX
32             107.37         105.48         -2
64             187.56         179.9          -4
128            297.16         301.71         2
256            300.47         503.92         68
512            294.76         826.13         180
1024           299.95         1916.69        539
2048           287.04         1924.44        570
4096           300.78         1929.37        541
8192           304.52         1934.02        535
16384          305.04         1957.54        542
32768          309            1921.84        522
65536          296.48         1935.41        553

Still we are pretty far from Linux, there are other problems to be fixed.

Signed-off-by: default avatarDmitry Fleytman <dmitry@daynix.com>
Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
parent 08f353e6
No related branches found
No related tags found
No related merge requests found
......@@ -335,7 +335,7 @@ tcp_lro_rx_ipv4(struct lro_ctrl *lc, struct mbuf *m, struct ip *ip4,
}
} else {
csum = in_cksum_hdr(ip4);
if (__predict_false((csum ^ 0xffff) != 0)) {
if (__predict_false((csum) != 0)) {
lc->lro_bad_csum++;
return (TCP_LRO_CANNOT);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment