From marcandre.lureau@redhat.com Thu Oct 12 20:53:26 2017 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507841727473890.2505739140663; Thu, 12 Oct 2017 13:55:27 -0700 (PDT) Received: from localhost ([::1]:47191 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2kVY-0002Nk-Vk for importer@patchew.org; Thu, 12 Oct 2017 16:55:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2kU7-0001XF-Jr for qemu-devel@nongnu.org; Thu, 12 Oct 2017 16:53:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2kU3-0000Xj-AM for qemu-devel@nongnu.org; Thu, 12 Oct 2017 16:53:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42574) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e2kU3-0000Wh-5C for qemu-devel@nongnu.org; Thu, 12 Oct 2017 16:53:35 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1C8CC2D0FA6 for ; Thu, 12 Oct 2017 20:53:34 +0000 (UTC) Received: from localhost (ovpn-112-16.ams2.redhat.com [10.36.112.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 644DA5D6A3; Thu, 12 Oct 2017 20:53:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1C8CC2D0FA6 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 12 Oct 2017 22:53:26 +0200 Message-Id: <20171012205330.29942-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 12 Oct 2017 20:53:34 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 0/4] vhost-user patches X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 The following changes since commit a0b261db8c030813e30a39eae47359ac2a37f7= e2: Merge remote-tracking branch 'remotes/ehabkost/tags/python-next-pull-re= quest' into staging (2017-10-12 10:02:09 +0100) are available in the Git repository at: https://github.com/elmarco/qemu.git tags/vu-pull-request for you to fetch changes up to 13384f158ce043744cf7542162a34953c7e05a70: libvhost-user: Support VHOST_USER_SET_SLAVE_REQ_FD (2017-10-12 16:57:50= +0200) ---------------------------------------------------------------- ---------------------------------------------------------------- Dr. David Alan Gilbert (4): libvhost-user: vu_queue_started vhost-user-bridge: Only process received packets on started queues libvhost-user: Update and fix feature and request lists libvhost-user: Support VHOST_USER_SET_SLAVE_REQ_FD contrib/libvhost-user/libvhost-user.h | 19 +++++++++++++++- contrib/libvhost-user/libvhost-user.c | 43 +++++++++++++++++++++++++++++= +----- tests/vhost-user-bridge.c | 1 + 3 files changed, 56 insertions(+), 7 deletions(-) --=20 2.15.0.rc0.40.gaefcc5f6f From peter.maydell@linaro.org Mon Oct 16 12:04:07 2017 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1508155541009821.0123830339131; Mon, 16 Oct 2017 05:05:41 -0700 (PDT) Received: from localhost ([::1]:60923 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e449C-0007nG-3H for importer@patchew.org; Mon, 16 Oct 2017 08:05:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e448I-0007Sw-5K for qemu-devel@nongnu.org; Mon, 16 Oct 2017 08:04:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e448D-0003bF-Ec for qemu-devel@nongnu.org; Mon, 16 Oct 2017 08:04:34 -0400 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:56735) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e448D-0003ah-8a for qemu-devel@nongnu.org; Mon, 16 Oct 2017 08:04:29 -0400 Received: by mail-wm0-x235.google.com with SMTP id l68so2473160wmd.5 for ; Mon, 16 Oct 2017 05:04:29 -0700 (PDT) Received: by 10.223.139.195 with HTTP; Mon, 16 Oct 2017 05:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=AtS7XJIi6ysrCqVz0BEEa2jWdeGKT8LJK+wN9LREsFk=; b=W35fqA6KNwaq7ggqZ2R5uDqilLkjCBHYdXjblkEw6sYC8n6zyyO0ESXKhX3Q7cOYb9 LkjXoOKpZpYzgY82yUhVQS8LGZ6of+yOexjxk1WuxhObis3eUekvTEOer/6AfCeAY8zd aX+ggs2QCazr25EdwYwsxkR08i6e+LMPy+rLU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=AtS7XJIi6ysrCqVz0BEEa2jWdeGKT8LJK+wN9LREsFk=; b=DE97PlmRnCZXArPgEeoxyLcWJ56zZsubccvxfKUO2w/6/9TVb45gt2TPWAZEWd/YM9 1j9Ofweu1qtOwU0mJruLoi6PyxHL79v37fbZKVOUQcbfeiGwP+O2zEi3tG4ckBWUOcL7 y+3AMmQCpx3dm4Z1v4Er1LUtjpqDbGDISvoI7qibYXwrXTGqrlE0Cvc7poiIrwezC0lQ zLbe4DCbuWCCqn7YX6yTFN2RIRfrn5QANUDKPGZMjseLulGqlxh/NofWPK1gNABLxjcv GWJ+XW9vAmWcTkc/nm8bjPOeCOEHG68Pkcu+H/jCzmUnqPv9ZQvN1lmrh5K/O2XMloKX k+nQ== X-Gm-Message-State: AMCzsaVgAKe4hfoRaRapy2TLqIQ9X1YY3bNdbrJ4rPKieAKk08ZD5jdw SGOTSoPDRJS9UC2piS42QZzwaVSTFPjKUTTz5OvL2Q== X-Google-Smtp-Source: ABhQp+TZb3dW88lrsbdlz9VUBmExdgkuqMDnpuqVzxNPa0RIH8cz6cfiEEnWu943X9Y6dEsz29Iq2JC84BBohWNGBmI= X-Received: by 10.223.147.166 with SMTP id 35mr444336wrp.90.1508155468144; Mon, 16 Oct 2017 05:04:28 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20171012205330.29942-1-marcandre.lureau@redhat.com> References: <20171012205330.29942-1-marcandre.lureau@redhat.com> From: Peter Maydell Date: Mon, 16 Oct 2017 13:04:07 +0100 Message-ID: To: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::235 Subject: Re: [Qemu-devel] [PULL 0/4] vhost-user patches X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: QEMU Developers Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZohoMail: RDKM_0 RSF_0 Z_629925259 SPT_0 On 12 October 2017 at 21:53, Marc-Andr=C3=A9 Lureau wrote: > The following changes since commit a0b261db8c030813e30a39eae47359ac2a37f7= e2: > > Merge remote-tracking branch 'remotes/ehabkost/tags/python-next-pull-re= quest' into staging (2017-10-12 10:02:09 +0100) > > are available in the Git repository at: > > https://github.com/elmarco/qemu.git tags/vu-pull-request > > for you to fetch changes up to 13384f158ce043744cf7542162a34953c7e05a70: > > libvhost-user: Support VHOST_USER_SET_SLAVE_REQ_FD (2017-10-12 16:57:50= +0200) > > ---------------------------------------------------------------- > > ---------------------------------------------------------------- > > Dr. David Alan Gilbert (4): > libvhost-user: vu_queue_started > vhost-user-bridge: Only process received packets on started queues > libvhost-user: Update and fix feature and request lists > libvhost-user: Support VHOST_USER_SET_SLAVE_REQ_FD > > contrib/libvhost-user/libvhost-user.h | 19 +++++++++++++++- > contrib/libvhost-user/libvhost-user.c | 43 +++++++++++++++++++++++++++++= +----- > tests/vhost-user-bridge.c | 1 + > 3 files changed, 56 insertions(+), 7 deletions(-) Applied, thanks. -- PMM From marcandre.lureau@redhat.com Thu Oct 12 20:53:27 2017 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507841727814450.63638692284053; Thu, 12 Oct 2017 13:55:27 -0700 (PDT) Received: from localhost ([::1]:47192 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2kVa-0002O1-5h for importer@patchew.org; Thu, 12 Oct 2017 16:55:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2kU8-0001XX-5S for qemu-devel@nongnu.org; Thu, 12 Oct 2017 16:53:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2kU5-0000aA-Sz for qemu-devel@nongnu.org; Thu, 12 Oct 2017 16:53:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56336) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e2kU5-0000Zi-Ne for qemu-devel@nongnu.org; Thu, 12 Oct 2017 16:53:37 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BB6708046F for ; Thu, 12 Oct 2017 20:53:36 +0000 (UTC) Received: from localhost (ovpn-112-16.ams2.redhat.com [10.36.112.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1BDFD5C1A3; Thu, 12 Oct 2017 20:53:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BB6708046F Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 12 Oct 2017 22:53:27 +0200 Message-Id: <20171012205330.29942-2-marcandre.lureau@redhat.com> In-Reply-To: <20171012205330.29942-1-marcandre.lureau@redhat.com> References: <20171012205330.29942-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 12 Oct 2017 20:53:36 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/4] libvhost-user: vu_queue_started X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 From: "Dr. David Alan Gilbert" Add a vu_queue_started method to complement vu_queue_enabled. Signed-off-by: Dr. David Alan Gilbert Message-Id: <20171002191521.15748-2-dgilbert@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Maxime Coquelin --- contrib/libvhost-user/libvhost-user.h | 9 +++++++++ contrib/libvhost-user/libvhost-user.c | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/contrib/libvhost-user/libvhost-user.h b/contrib/libvhost-use= r/libvhost-user.h index 5825b66880..ff8059257e 100644 --- a/contrib/libvhost-user/libvhost-user.h +++ b/contrib/libvhost-user/libvhost-user.h @@ -334,6 +334,15 @@ void vu_queue_set_notification(VuDev *dev, VuVirtq *= vq, int enable); */ bool vu_queue_enabled(VuDev *dev, VuVirtq *vq); =20 +/** + * vu_queue_started: + * @dev: a VuDev context + * @vq: a VuVirtq queue + * + * Returns: whether the queue is started. + */ +bool vu_queue_started(const VuDev *dev, const VuVirtq *vq); + /** * vu_queue_empty: * @dev: a VuDev context diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-use= r/libvhost-user.c index a0e0da4ccb..62be958f59 100644 --- a/contrib/libvhost-user/libvhost-user.c +++ b/contrib/libvhost-user/libvhost-user.c @@ -966,6 +966,12 @@ vu_queue_enabled(VuDev *dev, VuVirtq *vq) return vq->enable; } =20 +bool +vu_queue_started(const VuDev *dev, const VuVirtq *vq) +{ + return vq->started; +} + static inline uint16_t vring_avail_flags(VuVirtq *vq) { --=20 2.15.0.rc0.40.gaefcc5f6f From marcandre.lureau@redhat.com Thu Oct 12 20:53:28 2017 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 150784172747579.81687751593597; Thu, 12 Oct 2017 13:55:27 -0700 (PDT) Received: from localhost ([::1]:47193 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2kVb-0002Pm-KU for importer@patchew.org; Thu, 12 Oct 2017 16:55:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2kU9-0001YG-D6 for qemu-devel@nongnu.org; Thu, 12 Oct 2017 16:53:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2kU8-0000bM-OX for qemu-devel@nongnu.org; Thu, 12 Oct 2017 16:53:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35534) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e2kU8-0000b3-Id for qemu-devel@nongnu.org; Thu, 12 Oct 2017 16:53:40 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9A53E7F41D for ; Thu, 12 Oct 2017 20:53:39 +0000 (UTC) Received: from localhost (ovpn-112-16.ams2.redhat.com [10.36.112.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8CA8160635; Thu, 12 Oct 2017 20:53:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9A53E7F41D Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 12 Oct 2017 22:53:28 +0200 Message-Id: <20171012205330.29942-3-marcandre.lureau@redhat.com> In-Reply-To: <20171012205330.29942-1-marcandre.lureau@redhat.com> References: <20171012205330.29942-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 12 Oct 2017 20:53:39 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/4] vhost-user-bridge: Only process received packets on started queues X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 From: "Dr. David Alan Gilbert" Only process received packets if the queue has been started. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20171002191521.15748-3-dgilbert@redhat.com> Reviewed-by: Maxime Coquelin --- tests/vhost-user-bridge.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c index f922cc75ae..d820033a72 100644 --- a/tests/vhost-user-bridge.c +++ b/tests/vhost-user-bridge.c @@ -277,6 +277,7 @@ vubr_backend_recv_cb(int sock, void *ctx) DPRINT(" hdrlen =3D %d\n", hdrlen); =20 if (!vu_queue_enabled(dev, vq) || + !vu_queue_started(dev, vq) || !vu_queue_avail_bytes(dev, vq, hdrlen, 0)) { DPRINT("Got UDP packet, but no available descriptors on RX virtq= .\n"); return; --=20 2.15.0.rc0.40.gaefcc5f6f From marcandre.lureau@redhat.com Thu Oct 12 20:53:29 2017 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507841821888144.54620918657474; Thu, 12 Oct 2017 13:57:01 -0700 (PDT) Received: from localhost ([::1]:47201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2kXJ-0003wX-1t for importer@patchew.org; Thu, 12 Oct 2017 16:56:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2kUC-0001aA-5U for qemu-devel@nongnu.org; Thu, 12 Oct 2017 16:53:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2kUB-0000ca-5x for qemu-devel@nongnu.org; Thu, 12 Oct 2017 16:53:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60654) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e2kUA-0000c2-TO for qemu-devel@nongnu.org; Thu, 12 Oct 2017 16:53:43 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D9B935F299A for ; Thu, 12 Oct 2017 20:53:41 +0000 (UTC) Received: from localhost (ovpn-112-16.ams2.redhat.com [10.36.112.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3FAC517BA2; Thu, 12 Oct 2017 20:53:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D9B935F299A Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 12 Oct 2017 22:53:29 +0200 Message-Id: <20171012205330.29942-4-marcandre.lureau@redhat.com> In-Reply-To: <20171012205330.29942-1-marcandre.lureau@redhat.com> References: <20171012205330.29942-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 12 Oct 2017 20:53:42 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/4] libvhost-user: Update and fix feature and request lists X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 From: "Dr. David Alan Gilbert" Update the ProtocolFeature and UserRequest lists to match hw/virtio/vhost-user.c. Fix the text labelling in libvhost-user.c to match the list. Signed-off-by: Dr. David Alan Gilbert Message-Id: <20171002191521.15748-4-dgilbert@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Maxime Coquelin --- contrib/libvhost-user/libvhost-user.h | 9 ++++++++- contrib/libvhost-user/libvhost-user.c | 10 +++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/contrib/libvhost-user/libvhost-user.h b/contrib/libvhost-use= r/libvhost-user.h index ff8059257e..d54683feeb 100644 --- a/contrib/libvhost-user/libvhost-user.h +++ b/contrib/libvhost-user/libvhost-user.h @@ -34,6 +34,10 @@ enum VhostUserProtocolFeature { VHOST_USER_PROTOCOL_F_MQ =3D 0, VHOST_USER_PROTOCOL_F_LOG_SHMFD =3D 1, VHOST_USER_PROTOCOL_F_RARP =3D 2, + VHOST_USER_PROTOCOL_F_REPLY_ACK =3D 3, + VHOST_USER_PROTOCOL_F_NET_MTU =3D 4, + VHOST_USER_PROTOCOL_F_SLAVE_REQ =3D 5, + VHOST_USER_PROTOCOL_F_CROSS_ENDIAN =3D 6, =20 VHOST_USER_PROTOCOL_F_MAX }; @@ -61,7 +65,10 @@ typedef enum VhostUserRequest { VHOST_USER_GET_QUEUE_NUM =3D 17, VHOST_USER_SET_VRING_ENABLE =3D 18, VHOST_USER_SEND_RARP =3D 19, - VHOST_USER_INPUT_GET_CONFIG =3D 20, + VHOST_USER_NET_SET_MTU =3D 20, + VHOST_USER_SET_SLAVE_REQ_FD =3D 21, + VHOST_USER_IOTLB_MSG =3D 22, + VHOST_USER_SET_VRING_ENDIAN =3D 23, VHOST_USER_MAX } VhostUserRequest; =20 diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-use= r/libvhost-user.c index 62be958f59..e36aed72d0 100644 --- a/contrib/libvhost-user/libvhost-user.c +++ b/contrib/libvhost-user/libvhost-user.c @@ -56,13 +56,10 @@ } while (0) =20 static const char * -vu_request_to_string(int req) +vu_request_to_string(unsigned int req) { #define REQ(req) [req] =3D #req static const char *vu_request_str[] =3D { - REQ(VHOST_USER_NONE), - REQ(VHOST_USER_GET_FEATURES), - REQ(VHOST_USER_SET_FEATURES), REQ(VHOST_USER_NONE), REQ(VHOST_USER_GET_FEATURES), REQ(VHOST_USER_SET_FEATURES), @@ -83,7 +80,10 @@ vu_request_to_string(int req) REQ(VHOST_USER_GET_QUEUE_NUM), REQ(VHOST_USER_SET_VRING_ENABLE), REQ(VHOST_USER_SEND_RARP), - REQ(VHOST_USER_INPUT_GET_CONFIG), + REQ(VHOST_USER_NET_SET_MTU), + REQ(VHOST_USER_SET_SLAVE_REQ_FD), + REQ(VHOST_USER_IOTLB_MSG), + REQ(VHOST_USER_SET_VRING_ENDIAN), REQ(VHOST_USER_MAX), }; #undef REQ --=20 2.15.0.rc0.40.gaefcc5f6f From marcandre.lureau@redhat.com Thu Oct 12 20:53:30 2017 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507841822350246.49773856272134; Thu, 12 Oct 2017 13:57:02 -0700 (PDT) Received: from localhost ([::1]:47202 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2kXK-0003xX-KY for importer@patchew.org; Thu, 12 Oct 2017 16:56:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2kUK-0001h7-Hc for qemu-devel@nongnu.org; Thu, 12 Oct 2017 16:53:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2kUF-0000fK-Mc for qemu-devel@nongnu.org; Thu, 12 Oct 2017 16:53:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44344) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e2kUF-0000e4-EQ for qemu-devel@nongnu.org; Thu, 12 Oct 2017 16:53:47 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6DC7117FD for ; Thu, 12 Oct 2017 20:53:46 +0000 (UTC) Received: from localhost (ovpn-112-16.ams2.redhat.com [10.36.112.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id E810517B8A; Thu, 12 Oct 2017 20:53:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6DC7117FD Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 12 Oct 2017 22:53:30 +0200 Message-Id: <20171012205330.29942-5-marcandre.lureau@redhat.com> In-Reply-To: <20171012205330.29942-1-marcandre.lureau@redhat.com> References: <20171012205330.29942-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 12 Oct 2017 20:53:46 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/4] libvhost-user: Support VHOST_USER_SET_SLAVE_REQ_FD X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 From: "Dr. David Alan Gilbert" Allow the qemu to pass us a slave fd. We don't do anything with it yet. Signed-off-by: Dr. David Alan Gilbert Message-Id: <20171002191521.15748-5-dgilbert@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Maxime Coquelin --- contrib/libvhost-user/libvhost-user.h | 1 + contrib/libvhost-user/libvhost-user.c | 27 ++++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/contrib/libvhost-user/libvhost-user.h b/contrib/libvhost-use= r/libvhost-user.h index d54683feeb..2f5864b5c4 100644 --- a/contrib/libvhost-user/libvhost-user.h +++ b/contrib/libvhost-user/libvhost-user.h @@ -226,6 +226,7 @@ struct VuDev { VuDevRegion regions[VHOST_MEMORY_MAX_NREGIONS]; VuVirtq vq[VHOST_MAX_NR_VIRTQUEUE]; int log_call_fd; + int slave_fd; uint64_t log_size; uint8_t *log_table; uint64_t features; diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-use= r/libvhost-user.c index e36aed72d0..f409bd3d41 100644 --- a/contrib/libvhost-user/libvhost-user.c +++ b/contrib/libvhost-user/libvhost-user.c @@ -726,7 +726,8 @@ vu_set_vring_err_exec(VuDev *dev, VhostUserMsg *vmsg) static bool vu_get_protocol_features_exec(VuDev *dev, VhostUserMsg *vmsg) { - uint64_t features =3D 1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD; + uint64_t features =3D 1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD | + 1ULL << VHOST_USER_PROTOCOL_F_SLAVE_REQ; =20 if (dev->iface->get_protocol_features) { features |=3D dev->iface->get_protocol_features(dev); @@ -779,6 +780,23 @@ vu_set_vring_enable_exec(VuDev *dev, VhostUserMsg *v= msg) return false; } =20 +static bool +vu_set_slave_req_fd(VuDev *dev, VhostUserMsg *vmsg) +{ + if (vmsg->fd_num !=3D 1) { + vu_panic(dev, "Invalid slave_req_fd message (%d fd's)", vmsg->fd= _num); + return false; + } + + if (dev->slave_fd !=3D -1) { + close(dev->slave_fd); + } + dev->slave_fd =3D vmsg->fds[0]; + DPRINT("Got slave_fd: %d\n", vmsg->fds[0]); + + return false; +} + static bool vu_process_message(VuDev *dev, VhostUserMsg *vmsg) { @@ -842,6 +860,8 @@ vu_process_message(VuDev *dev, VhostUserMsg *vmsg) return vu_get_queue_num_exec(dev, vmsg); case VHOST_USER_SET_VRING_ENABLE: return vu_set_vring_enable_exec(dev, vmsg); + case VHOST_USER_SET_SLAVE_REQ_FD: + return vu_set_slave_req_fd(dev, vmsg); case VHOST_USER_NONE: break; default: @@ -915,6 +935,10 @@ vu_deinit(VuDev *dev) =20 =20 vu_close_log(dev); + if (dev->slave_fd !=3D -1) { + close(dev->slave_fd); + dev->slave_fd =3D -1; + } =20 if (dev->sock !=3D -1) { close(dev->sock); @@ -945,6 +969,7 @@ vu_init(VuDev *dev, dev->remove_watch =3D remove_watch; dev->iface =3D iface; dev->log_call_fd =3D -1; + dev->slave_fd =3D -1; for (i =3D 0; i < VHOST_MAX_NR_VIRTQUEUE; i++) { dev->vq[i] =3D (VuVirtq) { .call_fd =3D -1, .kick_fd =3D -1, .err_fd =3D -1, --=20 2.15.0.rc0.40.gaefcc5f6f