From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 151F38D85 for ; Fri, 13 May 2016 08:11:23 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 12 May 2016 23:11:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,612,1455004800"; d="scan'208";a="975524107" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by orsmga002.jf.intel.com with ESMTP; 12 May 2016 23:11:22 -0700 From: Yuanhan Liu To: dev@dpdk.org Cc: huawei.xie@intel.com, Traynor Kevin , marcandre.lureau@redhat.com, Yuanhan Liu Date: Thu, 12 May 2016 23:16:26 -0700 Message-Id: <1463120192-24200-1-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1462603224-29510-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1462603224-29510-1-git-send-email-yuanhan.liu@linux.intel.com> Subject: [dpdk-dev] [PATCH v2 0/6] vhost: add vhost-user client mode and reconnect ability X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2016 06:11:24 -0000 v2: - added release doc - do not remove socket file for the client mode - create one thread ony to handle all reconnects NOTE: I created a branch at dpdk.org [0] for more convenient testing: [0]: git://dpdk.org/next/dpdk-next-virtio for-testing When the DPDK vhost-user application (such as OVS) restarts (due to crash, or update), the vhost-user connection between DPDK and QEMU won't be established automatically again. In another word, the virtio net is broken. The reason it doesn't work is that DPDK just acts as server only. A restart of the server needs a reconnection from the client (QEMU). However, reconnect from QEMU is not supported from QEMU. Adding the support of client mode and let DPDK be the client somehow would resolve above issue a bit easier: DPDK vhost-user as the client, a restart of DPDK would naturally try to connect to the server (QEMU) automatically. Therefore, this patchset implements the DPDK vhost-user client mode, by introducing a new arg (flags) for API rte_vhost_driver_register(). And the client mode is enabled when RTE_VHOST_USER_CLIENT is given. Note that this implies an API breakage. However, since this release deals with ABI/API refactoring, it should not be an issue. Another interesting thing to make it work is that you not only have to consider that case the DPDK vhost-user app might restart, but also have to think that QEMU might restart as well: guest OS sometimes just reboots. In such case, when the server is down, the client has to keep reconnecting with the server until the server is back and the connection is established again. And that's what "reconnect" patch for. Note that current QEMU doesn't not support a second time connection from client, thus a restart of DPDK vhost-user will not work. This is because current QEMU won't be able to detect the disconnect from restart, thus it will not listen for later connections. Patches [1] have been sent, it's just not merged yet. But unlike the vhost-user mulitple queue case, that we have critical depends on QEMU implementation, here we have no such dependency, therefore, I think it's okay to make DPDK be ready for the "reconnect" stuff first. (note that I also mentioned this fact in the release doc). [1]: http://lists.nongnu.org/archive/html/qemu-devel/2016-05/msg01507.html Thanks. --yliu --- Yuanhan Liu (6): vhost: rename structs for enabling client mode vhost: add vhost-user client mode vhost: add reconnect ability vhost: workaround stale vring base examples/vhost: add client and reconnect option vhost: add pmd client and reconnect option doc/guides/rel_notes/release_16_07.rst | 23 ++ drivers/net/vhost/rte_eth_vhost.c | 54 +++- examples/vhost/main.c | 23 +- lib/librte_vhost/rte_virtio_net.h | 12 +- lib/librte_vhost/vhost_cuse/vhost-net-cdev.c | 8 +- lib/librte_vhost/vhost_user/vhost-net-user.c | 403 ++++++++++++++++++--------- lib/librte_vhost/vhost_user/vhost-net-user.h | 6 - lib/librte_vhost/virtio-net.c | 9 + 8 files changed, 390 insertions(+), 148 deletions(-) -- 1.9.0