numam-dpdk/lib/vhost
Jiayu Hu af4d7ad5d9 vhost: fix packed ring descriptor update in async enqueue
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: 873e8dad6f ("vhost: support packed ring in async datapath")

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-11-16 11:21:48 +01:00
..
fd_man.c lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
fd_man.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
iotlb.c mempool: add namespace to flags 2021-10-20 10:00:16 +02:00
iotlb.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
meson.build vhost: mark vDPA driver API as internal 2021-11-03 09:11:34 +01:00
rte_vdpa.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
rte_vhost_async.h vhost: remove notion of async descriptor 2021-10-29 12:32:30 +02:00
rte_vhost_crypto.h vhost: promote some APIs to stable 2021-09-14 13:21:57 +02:00
rte_vhost.h fix spelling in comments and doxygen 2021-11-16 17:57:09 +01:00
socket.c vhost: rename driver callbacks struct 2021-11-03 11:59:27 +01:00
vdpa_driver.h vhost: mark vDPA driver API as internal 2021-11-03 09:11:34 +01:00
vdpa.c vhost: mark vDPA driver API as internal 2021-11-03 09:11:34 +01:00
version.map vhost: mark vDPA driver API as internal 2021-11-03 09:11:34 +01:00
vhost_crypto.c vhost/crypto: check request pointer before dereference 2021-06-23 09:55:23 +02:00
vhost_user.c vhost: move async data in dedicated structure 2021-10-29 12:32:30 +02:00
vhost_user.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
vhost.c vhost: move async data in dedicated structure 2021-10-29 12:32:30 +02:00
vhost.h vhost: rename driver callbacks struct 2021-11-03 11:59:27 +01:00
virtio_crypto.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
virtio_net.c vhost: fix packed ring descriptor update in async enqueue 2021-11-16 11:21:48 +01:00