]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
vhost_net: try batch dequing from skb array
authorJason Wang <jasowang@redhat.com>
Wed, 17 May 2017 04:14:45 +0000 (12:14 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 May 2017 14:07:42 +0000 (10:07 -0400)
commitc67df11f6e48061e43e9bf9dade83fe268b47d27
tree240db037b0414eda56435162247acabd75dd1477
parent3b4ba04acca8f98a62fd014a0826ea10bc93cde3
vhost_net: try batch dequing from skb array

We used to dequeue one skb during recvmsg() from skb_array, this could
be inefficient because of the bad cache utilization and spinlock
touching for each packet. This patch tries to batch them by calling
batch dequeuing helpers explicitly on the exported skb array and pass
the skb back through msg_control for underlayer socket to finish the
userspace copying. Batch dequeuing is also the requirement for more
batching improvement on receive path.

Tests were done by pktgen on tap with XDP1 in guest. Host is Intel(R)
Xeon(R) CPU E5-2650 0 @ 2.00GHz.

rx batch | pps

0   2.25Mpps
1   2.33Mpps (+3.56%)
4   2.33Mpps (+3.56%)
16  2.35Mpps (+4.44%)
64  2.42Mpps (+7.56%) <- Default rx batching
128 2.40Mpps (+6.67%)
256 2.38Mpps (+5.78%)

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/vhost/net.c