From patchwork Mon Nov 23 10:54:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 547465 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id CF8351402A8 for ; Mon, 23 Nov 2015 21:55:40 +1100 (AEDT) Received: from localhost ([::1]:59853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0omD-0004ZW-PY for incoming@patchwork.ozlabs.org; Mon, 23 Nov 2015 05:55:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0olx-0004Dm-IS for qemu-devel@nongnu.org; Mon, 23 Nov 2015 05:55:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0olw-0000iI-LA for qemu-devel@nongnu.org; Mon, 23 Nov 2015 05:55:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0olw-0000iE-FQ for qemu-devel@nongnu.org; Mon, 23 Nov 2015 05:55:00 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 1186AA074E; Mon, 23 Nov 2015 10:55:00 +0000 (UTC) Received: from redhat.com (ovpn-116-71.ams2.redhat.com [10.36.116.71]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id tANAsv4p017732; Mon, 23 Nov 2015 05:54:58 -0500 Date: Mon, 23 Nov 2015 12:54:56 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1448276065-15183-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Marcel Apfelbaum , =?us-ascii?B?PT9VVEYtOD9xP01hcmMtQW5kcj1DMz1BOT0yMEx1cmVhdT89?= , Yuanhan Liu , Victor Kaplansky , Changchun Ouyang Subject: [Qemu-devel] [PATCH for-2.5] vhost-user: clarify start and enable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org It seems that we currently have some duplication between started and enabled states. The actual reason is that enable is not documented correctly: what it does is connecting ring to the backend. This is important for MQ, because a Linux guest expects TX packets to be completed even if it disables some queues temporarily. Cc: Yuanhan Liu Cc: Victor Kaplansky Signed-off-by: Michael S. Tsirkin Reviewed-by: Yuanhan Liu --- docs/specs/vhost-user.txt | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/docs/specs/vhost-user.txt b/docs/specs/vhost-user.txt index 7b9cd6d..0312d40 100644 --- a/docs/specs/vhost-user.txt +++ b/docs/specs/vhost-user.txt @@ -148,13 +148,23 @@ a feature bit was dedicated for this purpose: Starting and stopping rings ---------------------- -Client must only process each ring when it is both started and enabled. +Client must only process each ring when it is started. + +Client must only pass data between the ring and the +backend, when the ring is enabled. + +If ring is started but disabled, client must process the +ring without talking to the backend. + +For example, for a networking device, in the disabled state +client must not supply any new RX packets, but must process +and discard any TX packets. If VHOST_USER_F_PROTOCOL_FEATURES has not been negotiated, the ring is initialized in an enabled state. If VHOST_USER_F_PROTOCOL_FEATURES has been negotiated, the ring is initialized -in a disabled state. Client must not process it until ring is enabled by +in a disabled state. Client must not pass data to/from the backend until ring is enabled by VHOST_USER_SET_VRING_ENABLE with parameter 1, or after it has been disabled by VHOST_USER_SET_VRING_ENABLE with parameter 0. @@ -166,7 +176,7 @@ descriptor is readable) on the descriptor specified by VHOST_USER_SET_VRING_KICK, and stop ring upon receiving VHOST_USER_GET_VRING_BASE. -While processing the rings (when they are started and enabled), client must +While processing the rings (whether they are enabled or not), client must support changing some configuration aspects on the fly. Multiple queue support @@ -309,11 +319,11 @@ Message types Id: 4 Master payload: N/A - This is no longer used. Used to be sent to request stopping + This is no longer used. Used to be sent to request disabling all rings, but some clients interpreted it to also discard connection state (this interpretation would lead to bugs). It is recommended that clients either ignore this message, - or use it to stop all rings. + or use it to disable all rings. * VHOST_USER_SET_MEM_TABLE