[PATCH v3] vhost: fix packed ring descriptor update in async enqueue

Maxime Coquelin maxime.coquelin at redhat.com
Tue Nov 16 11:25:37 CET 2021



On 11/16/21 16:17, Jiayu Hu wrote:
> If the packet uses multiple descriptors and its descriptor indices are
> wrapped, the first descriptor flag is not updated last, which may cause
> virtio read the incomplete packet. For example, given a packet uses 64
> descriptors, and virtio ring size is 256, and its descriptor indices are
> 224~255 and 0~31, current implementation will update 224~255 descriptor
> flags earlier than 0~31 descriptor flags.
> 
> This patch fixes this issue by updating descriptor flags in one loop,
> so that the first descriptor flag is always updated last.
> 
> Fixes: 873e8dad6f49 ("vhost: support packed ring in async datapath")
> 
> Signed-off-by: Jiayu Hu <jiayu.hu at intel.com>
> Reviewed-by: Chenbo Xia <chenbo.xia at intel.com>
> ---
> v3:
> * fix typo
> v2:
> * update commit log
> ---
>   lib/vhost/virtio_net.c | 122 ++++++++++++++++++-----------------------
>   1 file changed, 54 insertions(+), 68 deletions(-)
> 

Applied to dpdk-next-virtio/main.

Thanks,
Maxime



More information about the dev mailing list