• Jason Wang's avatar
    vhost_net: try batch dequing from skb array · c67df11f
    Jason Wang authored
    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: default avatarJason Wang <jasowang@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c67df11f
net.c 33.9 KB