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 <[email protected]>
Reviewed-by: Chenbo Xia <[email protected]>
---
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