[dpdk-dev] [PATCH v5] vhost: add support for large buffers

Maxime Coquelin maxime.coquelin at redhat.com
Wed Oct 16 12:02:21 CEST 2019


Hi Flavio,

On 10/15/19 8:59 PM, Flavio Leitner wrote:
> 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 at sysclose.org>
> ---
>  doc/guides/prog_guide/vhost_lib.rst |  35 +++++++++
>  lib/librte_vhost/rte_vhost.h        |   4 +
>  lib/librte_vhost/socket.c           |  22 ++++++
>  lib/librte_vhost/vhost.c            |  22 ++++++
>  lib/librte_vhost/vhost.h            |   4 +
>  lib/librte_vhost/virtio_net.c       | 109 ++++++++++++++++++++++++----
>  6 files changed, 182 insertions(+), 14 deletions(-)
> 
> - Changelog:
>   v5:
>     - fixed to destroy mutex if incompatible flags
>   v4:
>     - allow to use pktmbuf if there is exact space
>     - removed log message if the buffer is too big
>     - fixed the length to include align padding
>     - free allocated buf if shinfo fails
>   v3:
>     - prevent the new features to be used with zero copy
>     - fixed sizeof() usage
>     - fixed log msg indentation
>     - removed/replaced asserts
>     - used the correct virt2iova function
>     - fixed the patch's title
>     - OvS PoC code:
>       https://github.com/fleitner/ovs/tree/rte_malloc-v3
>   v2:
>     - Used rte_malloc() instead of another mempool as suggested by Shahaf.
>     - Added the documentation section.
>     - Using driver registration to negotiate the features.
>     - OvS PoC code:
>       https://github.com/fleitner/ovs/commit/8fc197c40b1d4fda331686a7b919e9e2b670dda7
> 

I went through the patch, and it looks good to me.
I appreciate the fact that there is no rte_vhost_dequeue_burst API
change.

Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>

Thanks,
Maxime



More information about the dev mailing list