linux/net/ipv4
Eric Dumazet cef401de7b net: fix possible wrong checksum generation
Pravin Shelar mentioned that GSO could potentially generate
wrong TX checksum if skb has fragments that are overwritten
by the user between the checksum computation and transmit.

He suggested to linearize skbs but this extra copy can be
avoided for normal tcp skbs cooked by tcp_sendmsg().

This patch introduces a new SKB_GSO_SHARED_FRAG flag, set
in skb_shinfo(skb)->gso_type if at least one frag can be
modified by the user.

Typical sources of such possible overwrites are {vm}splice(),
sendfile(), and macvtap/tun/virtio_net drivers.

Tested:

$ netperf -H 7.7.8.84
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to
7.7.8.84 () port 0 AF_INET
Recv   Send    Send
Socket Socket  Message  Elapsed
Size   Size    Size     Time     Throughput
bytes  bytes   bytes    secs.    10^6bits/sec

 87380  16384  16384    10.00    3959.52

$ netperf -H 7.7.8.84 -t TCP_SENDFILE
TCP SENDFILE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 7.7.8.84 ()
port 0 AF_INET
Recv   Send    Send
Socket Socket  Message  Elapsed
Size   Size    Size     Time     Throughput
bytes  bytes   bytes    secs.    10^6bits/sec

 87380  16384  16384    10.00    3216.80

Performance of the SENDFILE is impacted by the extra allocation and
copy, and because we use order-0 pages, while the TCP_STREAM uses
bigger pages.

Reported-by: Pravin Shelar <pshelar@nicira.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-28 00:27:15 -05:00
..
netfilter Merge branch 'master' of git://1984.lsi.us.es/nf-next 2013-01-27 00:56:10 -05:00
af_inet.c net: fix possible wrong checksum generation 2013-01-28 00:27:15 -05:00
ah4.c
arp.c arp: fix a regression in arp_solicit() 2012-12-24 18:42:58 -08:00
cipso_ipv4.c
datagram.c
devinet.c ipv4: fix NULL checking in devinet_ioctl() 2013-01-06 21:11:18 -08:00
esp4.c
fib_frontend.c ipv4: fib: fix a comment. 2013-01-11 15:58:08 -08:00
fib_lookup.h
fib_rules.c
fib_semantics.c
fib_trie.c
gre.c
icmp.c
igmp.c
inet_connection_sock.c soreuseport: fix use of uid in tb->fastuid 2013-01-27 01:01:42 -05:00
inet_diag.c
inet_fragment.c
inet_hashtables.c soreuseport: TCP/IPv4 implementation 2013-01-23 13:44:01 -05:00
inet_lro.c
inet_timewait_sock.c
inetpeer.c
ip_forward.c
ip_fragment.c net: increase fragment memory usage limits 2013-01-17 14:29:53 -05:00
ip_gre.c net: fix possible wrong checksum generation 2013-01-28 00:27:15 -05:00
ip_input.c
ip_options.c
ip_output.c
ip_sockglue.c net: prevent setting ttl=0 via IP_TTL 2013-01-08 17:57:10 -08:00
ip_vti.c
ipcomp.c
ipconfig.c net/ipv4/ipconfig: really display the BOOTP/DHCP server's address. 2013-01-04 15:14:14 -08:00
ipip.c net: fix possible wrong checksum generation 2013-01-28 00:27:15 -05:00
ipmr.c ipmr: fix sparse warning when testing origin or group 2013-01-22 14:24:29 -05:00
Kconfig
Makefile
netfilter.c
ping.c
proc.c
protocol.c
raw.c
route.c
syncookies.c tcp: make sysctl_tcp_ecn namespace aware 2013-01-06 21:09:56 -08:00
sysctl_net_ipv4.c tcp: make sysctl_tcp_ecn namespace aware 2013-01-06 21:09:56 -08:00
tcp_bic.c
tcp_cong.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-12-13 12:00:02 -08:00
tcp_cubic.c
tcp_diag.c
tcp_fastopen.c
tcp_highspeed.c
tcp_htcp.c
tcp_hybla.c
tcp_illinois.c
tcp_input.c net: fix possible wrong checksum generation 2013-01-28 00:27:15 -05:00
tcp_ipv4.c soreuseport: TCP/IPv4 implementation 2013-01-23 13:44:01 -05:00
tcp_lp.c
tcp_memcontrol.c
tcp_metrics.c
tcp_minisocks.c
tcp_output.c net: fix possible wrong checksum generation 2013-01-28 00:27:15 -05:00
tcp_probe.c
tcp_scalable.c
tcp_timer.c
tcp_vegas.c
tcp_vegas.h
tcp_veno.c
tcp_westwood.c
tcp_yeah.c
tcp.c net: fix possible wrong checksum generation 2013-01-28 00:27:15 -05:00
tunnel4.c
udp_diag.c
udp_impl.h
udp.c soreuseport: UDP/IPv4 implementation 2013-01-23 13:44:01 -05:00
udplite.c
xfrm4_input.c
xfrm4_mode_beet.c
xfrm4_mode_transport.c
xfrm4_mode_tunnel.c
xfrm4_output.c
xfrm4_policy.c
xfrm4_state.c
xfrm4_tunnel.c