virtio: fix needed vring entry number
authorOuyang Changchun <changchun.ouyang@intel.com>
Wed, 15 Oct 2014 03:11:00 +0000 (11:11 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 15 Oct 2014 06:25:13 +0000 (08:25 +0200)
commita779ba05d470f533f7d8b25b570bacbecb01a88d
tree41a7e0e4456401c994a0971e71ff7a8f0cf0a325
parent8933dae15c7c868a7f7679605e6d3d074f3843d3
virtio: fix needed vring entry number

Fix one issue in virtio TX: it needs one more vring descriptor to hold the virtio
header when transmitting packets, it is used later to determine whether to free
more entries from used vring.
It fixes failing to transmit any packet with 1 segment in the circumstance of only
1 descriptor in the vring free list.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_pmd_virtio/virtio_rxtx.c