]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
net: ipv6: Add early demux handler for UDP unicast
authorsubashab@codeaurora.org <subashab@codeaurora.org>
Wed, 8 Mar 2017 23:36:49 +0000 (16:36 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Mar 2017 05:54:17 +0000 (22:54 -0700)
commit5425077d73e0c8e7e9267ca8397cc0e2293c1fb9
tree32a44a8f404bf3690be2bb1b6f933ef976119a42
parent49b499718fa1b0d639663cfd03085b9bfd23cdc8
net: ipv6: Add early demux handler for UDP unicast

While running a single stream UDPv6 test, we observed that amount
of CPU spent in NET_RX softirq was much greater than UDPv4 for an
equivalent receive rate. The test here was run on an ARM64 based
Android system. On further analysis with perf, we found that UDPv6
was spending significant time in the statistics netfilter targets
which did socket lookup per packet. These statistics rules perform
a lookup when there is no socket associated with the skb. Since
there are multiple instances of these rules based on UID, there
will be equal number of lookups per skb.

By introducing early demux for UDPv6, we avoid the redundant lookups.
This also helped to improve the performance (800Mbps -> 870Mbps) on a
CPU limited system in a single stream UDPv6 receive test with 1450
byte sized datagrams using iperf.

v1->v2: Use IPv6 cookie to validate dst instead of 0 as suggested
by Eric

Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/udp.c