virtio: fix ring size negotiation
authorStephen Hemminger <shemming@brocade.com>
Thu, 11 Jun 2015 15:53:27 +0000 (08:53 -0700)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 12 Jun 2015 12:44:59 +0000 (14:44 +0200)
commitd78deadae4dca240e85054bf2d604a801676becc
tree980acd0265929e2fa2a785772cd5c58bbf18a472
parent4a92b67151be116ac69faec67dc570d543123205
virtio: fix ring size negotiation

Negotiate the virtio ring size. The host may allow for very large
rings but application may only want a smaller ring.
Conversely, if the number of descriptors requested exceeds the virtio
host queue size, then just silently use the smaller host size.

This fixes issues with virtio in non-QEMU envirionments.
For example Google Compute Engine allows up to 16K elements
in ring.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
drivers/net/virtio/virtio_ethdev.c