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

Merge branch 'ipip_sit_gro'

Tom Herbert says:

====================
net: enable GRO for IPIP and SIT

This patch sets populates the IPIP and SIT offload structures with
gro_receive and gro_complete functions. This enables use of GRO
for these. Also, fixed a problem in IPv6 where we were not properly
initializing flush_id.

Peformance results are below. Note that these tests were done on bnx2x
which doesn't provide RX checksum offload of IPIP or SIT (i.e. does
not give CHEKCSUM_COMPLETE). Also, we don't get 4-tuple hash for RSS
only 2-tuple in this case so all the packets between two hosts are
winding up on the same queue. Net result is the interrupting CPU is
the bottleneck in GRO (checksumming every packet there).

Testing:

netperf TCP_STREAM between two hosts using bnx2x.

* Before fix

IPIP
1 connection
6.53% CPU utilization
6544.71 Mbps
20 connections
13.79% CPU utilization
9284.54 Mbps

SIT
1 connection
6.68% CPU utilization
5653.36 Mbps
20 connections
18.88% CPU utilization
9154.61 Mbps

* After fix

IPIP
1 connection
5.73% CPU utilization
9279.53 Mbps
20 connections
7.14% CPU utilization
7279.35 Mbps

SIT
1 connection
2.95% CPU utilization
9143.36 Mbps
20 connections
7.09% CPU utilization
6255.3 Mbps
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+7
+2
net/ipv4/af_inet.c
··· 1666 1666 .callbacks = { 1667 1667 .gso_send_check = inet_gso_send_check, 1668 1668 .gso_segment = inet_gso_segment, 1669 + .gro_receive = inet_gro_receive, 1670 + .gro_complete = inet_gro_complete, 1669 1671 }, 1670 1672 }; 1671 1673
+5
net/ipv6/ip6_offload.c
··· 261 261 /* flush if Traffic Class fields are different */ 262 262 NAPI_GRO_CB(p)->flush |= !!(first_word & htonl(0x0FF00000)); 263 263 NAPI_GRO_CB(p)->flush |= flush; 264 + 265 + /* Clear flush_id, there's really no concept of ID in IPv6. */ 266 + NAPI_GRO_CB(p)->flush_id = 0; 264 267 } 265 268 266 269 NAPI_GRO_CB(skb)->flush |= flush; ··· 317 314 .callbacks = { 318 315 .gso_send_check = ipv6_gso_send_check, 319 316 .gso_segment = ipv6_gso_segment, 317 + .gro_receive = ipv6_gro_receive, 318 + .gro_complete = ipv6_gro_complete, 320 319 }, 321 320 }; 322 321