vhost: fix packed ring index wrapping
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Wed, 7 Jul 2021 10:30:04 +0000 (12:30 +0200)
committerChenbo Xia <chenbo.xia@intel.com>
Wed, 21 Jul 2021 05:56:13 +0000 (07:56 +0200)
commit92ed77dce68d45e7a343163cdc41ac9bdd099eec
tree8ffbf4523844c602c0e6c8d82488ba81c935c0fc
parent2d91b28730a945def257bc372a525c9b5dbf181c
vhost: fix packed ring index wrapping

Unlike split ring, packed ring does not mandate the ring size
to be a power of 2. So we have to use a modulo operation when
wrapping ring index.

Fixes: 873e8dad6f49 ("vhost: support packed ring in async datapath")
Cc: stable@dpdk.org
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
lib/vhost/virtio_net.c