vhost: access header only if offloading is supported
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Fri, 14 Oct 2016 08:07:07 +0000 (10:07 +0200)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Wed, 26 Oct 2016 11:39:09 +0000 (13:39 +0200)
commitc843af3aa13ed45bd9c6cc118c7cac372e5cd2ee
tree3f1095f3926789ea277887f5166364b719785b59
parentdbffbf80e99aad7c7a5ffaf78e750ae69963f9e0
vhost: access header only if offloading is supported

If offloading features are not negotiated, parsing the virtio header
is not needed.

Micro-benchmark with testpmd shows that the gain is +4% with indirect
descriptors, +1% when using direct descriptors.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
lib/librte_vhost/virtio_net.c