vhost: add reconnect ability
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Thu, 12 May 2016 23:14:19 +0000 (07:14 +0800)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Wed, 22 Jun 2016 07:47:12 +0000 (09:47 +0200)
commite623e0c6d8a5005f9909165e8a034849fa841ed5
tree03b5ed2588887e68227655305b96a13b3c2af453
parent64ab701c3d1e848aa36b4c4ef61a9dd8c3633651
vhost: add reconnect ability

Allow reconnecting on failure by default when:

- DPDK app starts first and QEMU (as the server) is not started yet.
  Without reconnecting, DPDK app would simply fail on vhost-user
  registration.

- QEMU restarts, say due to OS reboot.
  Without reconnecting, you can't re-establish the connection without
  restarting DPDK app.

This patch make it work well for both above cases. It simply creates
a new thread, and keep trying calling "connect()", until it succeeds.

The reconnect could be disabled when RTE_VHOST_USER_NO_RECONNECT flag
is set.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
doc/guides/rel_notes/release_16_07.rst
lib/librte_vhost/rte_virtio_net.h
lib/librte_vhost/vhost_user/vhost-net-user.c