examples/vhost: fix retry logic on Rx path
authorYuan Wang <yuanx.wang@intel.com>
Wed, 22 Jun 2022 09:25:55 +0000 (17:25 +0800)
committerMaxime Coquelin <maxime.coquelin@redhat.com>
Fri, 1 Jul 2022 13:49:49 +0000 (15:49 +0200)
commit1907ce4baec392a750fbeba5e946920b2f00ae73
tree5f393f64c855de8ada25f7eaf7ced486b8299f18
parentb90574b10e81d13f3760bf196dd9cfc237707425
examples/vhost: fix retry logic on Rx path

drain_eth_rx() uses rte_vhost_avail_entries() to calculate
the available entries to determine if a retry is required.
However, this function only works with split rings, and
calculating packed rings will return the wrong value and cause
unnecessary retries resulting in a significant performance penalty.

This patch fix that by using the difference between tx/rx burst
as the retry condition.

Fixes: be800696c26e ("examples/vhost: use burst enqueue and dequeue from lib")
Cc: stable@dpdk.org
Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Tested-by: Wei Ling <weix.ling@intel.com>
examples/vhost/main.c