vhost: optimize dequeue for small packets
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Tue, 3 May 2016 00:46:17 +0000 (17:46 -0700)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Wed, 22 Jun 2016 07:47:12 +0000 (09:47 +0200)
commit1d41d77cf81c448c1b09e1e859bfd300e2054a98
tree73ae8134037d5d8c9dc6a1adcf4cf7d72cd4ede0
parent7f74b95c444f617ac36c77253ade1bbb8dea4c88
vhost: optimize dequeue for small packets

A virtio driver normally uses at least 2 desc buffers for Tx: the
first for storing the header, and the others for storing the data.

Therefore, we could fetch the first data desc buf before the main
loop, and do the copy first before the check of "are we done yet?".
This could save one check for small packets that just have one data
desc buffer and need one mbuf to store it.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
lib/librte_vhost/vhost_rxtx.c