vhost: improve performance by supporting large buffer
authorFlavio Leitner <fbl@sysclose.org>
Tue, 15 Oct 2019 18:59:51 +0000 (15:59 -0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 23 Oct 2019 14:43:09 +0000 (16:43 +0200)
commitc3ff0ac70acb1f4a1b22fa24160fdc3be4597724
tree3c25730b15ecb41e185046fa6b2abb52c9301e0f
parentbe048a1aaa7276cc99a5a6a30e7825cfcb523112
vhost: improve performance by supporting large buffer

The rte_vhost_dequeue_burst supports two ways of dequeuing data.
If the data fits into a buffer, then all data is copied and a
single linear buffer is returned. Otherwise it allocates
additional mbufs and chains them together to return a multiple
segments mbuf.

While that covers most use cases, it forces applications that
need to work with larger data sizes to support multiple segments
mbufs. The non-linear characteristic brings complexity and
performance implications to the application.

To resolve the issue, add support to attach external buffer
to a pktmbuf and let the host provide during registration if
attaching an external buffer to pktmbuf is supported and if
only linear buffer are supported.

Signed-off-by: Flavio Leitner <fbl@sysclose.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
doc/guides/prog_guide/vhost_lib.rst
lib/librte_vhost/rte_vhost.h
lib/librte_vhost/socket.c
lib/librte_vhost/vhost.c
lib/librte_vhost/vhost.h
lib/librte_vhost/virtio_net.c