> -----Original Message----- > From: Hu, Jiayu <[email protected]> > Sent: Wednesday, November 10, 2021 8:40 PM > To: [email protected] > Cc: [email protected]; Xia, Chenbo <[email protected]>; He, > Xingguang <[email protected]>; Hu, Jiayu <[email protected]> > Subject: [PATCH v2] vhost: fix packed ring descriptor update in async enqueue > > If the packet uses multiple descrptors and its descriptor indices are
descrptors -> descriptors With this fixed: Reviewed-by: Chenbo Xia <[email protected]> > 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 is > 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]> > --- > v2: > * update commit log > --- > lib/vhost/virtio_net.c | 122 ++++++++++++++++++----------------------- > 1 file changed, 54 insertions(+), 68 deletions(-)

