From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 9776411D4 for ; Tue, 19 Jul 2016 06:14:08 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 18 Jul 2016 21:14:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,387,1464678000"; d="scan'208";a="1009497565" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by fmsmga001.fm.intel.com with ESMTP; 18 Jul 2016 21:14:04 -0700 From: Yuanhan Liu To: dev@dpdk.org Cc: Thomas Monjalon , Yuanhan Liu Date: Tue, 19 Jul 2016 12:17:48 +0800 Message-Id: <1468901869-29609-1-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 Subject: [dpdk-dev] [PATCH] doc: note a pitfall on reconnect feature 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: Tue, 19 Jul 2016 04:14:09 -0000 The vhost feature negotiation only happens at virtio reset stage, say when a virtio-net device is firstly initiated, or when DPDK virtio PMD initiates. That means, if vhost APP restarts after the negotiation and reconnects, the feature negotiation process will not be triggered again, meaning the info is lost. To make reconnect work, QEMU simply saves the negotiated features before the restart and restores it afterwards. Therefore, the vhost supported features must be exactly the same before and after the restart. For example, if TSO is disabled and then enabled, nothing will work and issues undefined might happen. Signed-off-by: Yuanhan Liu --- I just put the part "people should not do this" into the doc, and I'm not quite sure I need put the "why" part there or not. --- doc/guides/prog_guide/vhost_lib.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/guides/prog_guide/vhost_lib.rst b/doc/guides/prog_guide/vhost_lib.rst index 14d5e67..6b0c6b2 100644 --- a/doc/guides/prog_guide/vhost_lib.rst +++ b/doc/guides/prog_guide/vhost_lib.rst @@ -189,7 +189,12 @@ vhost-user implementation has two options: When the DPDK vhost-user application restarts, DPDK vhost-user will try to connect to the server again. This is how the "reconnect" feature works. - Note: the "reconnect" feature requires **QEMU v2.7** (or above). + .. Note:: + * The "reconnect" feature requires **QEMU v2.7** (or above). + + * The vhost supported features must be exactly the same before and + after the restart. For example, if TSO is disabled and then enabled, + nothing will work and issues undefined might happen. No matter which mode is used, once a connection is established, DPDK vhost-user will start receiving and processing vhost messages from QEMU. -- 1.9.0