examples/vhost: add --dequeue-zero-copy option
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Sun, 9 Oct 2016 07:27:59 +0000 (15:27 +0800)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Thu, 13 Oct 2016 08:29:31 +0000 (10:29 +0200)
commit00b8b70666f82cb5aae50f182cfc90ac3fdad739
tree95f0b8c75a3d8a312a608cbc8cbfd6e9c5eda074
parent9ba1e744ab6516c4ba593e60b56af16e443d8dbc
examples/vhost: add --dequeue-zero-copy option

Add an option, --dequeue-zero-copy, to enable dequeue zero copy.

One thing worth noting while using dequeue zero copy is the nb_tx_desc
has to be small enough so that the eth driver will hit the mbuf free
threshold easily and thus free mbuf more frequently.

The reason behind that is, when dequeue zero copy is enabled, guest Tx
used vring will be updated only when corresponding mbuf is freed. If mbuf
is not freed frequently, the guest Tx vring could be starved.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Qian Xu <qian.q.xu@intel.com>
examples/vhost/main.c