net/virtio: fix oversized packets in vectorized Rx
authorMarvin Liu <yong.liu@intel.com>
Sun, 26 Sep 2021 09:28:42 +0000 (17:28 +0800)
committerMaxime Coquelin <maxime.coquelin@redhat.com>
Thu, 21 Oct 2021 12:24:21 +0000 (14:24 +0200)
commit99ebada2d6d9db23be39f737f26c7bf5f0a26b9c
tree521a9f157816a367776507906bc966a76f101a3e
parent8011a09adda4d99121bcc0fe34c98356559eb32f
net/virtio: fix oversized packets in vectorized Rx

If packed ring size is not power of two, it is possible that remained
number less than one batch and meanwhile batch operation can pass.
This will cause incorrect remained number calculation and then lead to
receiving oversized packets. The patch fixed the issue by added
remained number check before batch operation.

Fixes: 77d66da83834 ("net/virtio: add vectorized packed ring Rx")
Cc: stable@dpdk.org
Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/virtio/virtio_rxtx_packed.c