From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id B356023D for ; Fri, 5 Oct 2018 14:00:26 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20181005120025euoutp02e3842b4fd3b2a716d42dcf30c9f72888~atKDWSza_2349723497euoutp02Y for ; Fri, 5 Oct 2018 12:00:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181005120025euoutp02e3842b4fd3b2a716d42dcf30c9f72888~atKDWSza_2349723497euoutp02Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1538740825; bh=Vo+xoBz1pyRcHj3NLNnOqBLOBfB9ajm4k7PfpnJFVIQ=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=upYeAZK0k3xw0agbAmmBhDRzCOh9lAq6IDNwuDkiyEu0KwSVpu0HbSUkwk94CMxUv cFfazDWy2rCVPOOdBB1Z7u/RMxz9nYZxwl8sQWOMuGunFvoXo/Q2DFxnhwzlroxB+B 60U6re9Rb+ln9Qkl8F4PaGo0BUUiBqOAawX3b9AE= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181005120025eucas1p18526d6f8a814a990d574a9d1c990633c~atKC2SY6z0201202012eucas1p1e; Fri, 5 Oct 2018 12:00:25 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 0D.F5.04294.85257BB5; Fri, 5 Oct 2018 13:00:24 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20181005120024eucas1p16e3484dd8d92c422f99ba1774b338ca1~atKCBaG2Y0203402034eucas1p1d; Fri, 5 Oct 2018 12:00:24 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20181005120023eusmtrp17bb19745fb120ca5037187967d2fab2d~atKBwaz4T0363903639eusmtrp1L; Fri, 5 Oct 2018 12:00:23 +0000 (GMT) X-AuditID: cbfec7f4-84fff700000010c6-ac-5bb7525894fd Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 35.77.04128.75257BB5; Fri, 5 Oct 2018 13:00:23 +0100 (BST) Received: from [106.109.129.180] (unknown [106.109.129.180]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20181005120023eusmtip1f7e09ed02e2c51620b90d1656456ae12~atKBHLvjE3235432354eusmtip1T; Fri, 5 Oct 2018 12:00:23 +0000 (GMT) To: Maxime Coquelin , dev@dpdk.org, tiwei.bie@intel.com, zhihong.wang@intel.com, jfreimann@redhat.com, nicknickolaev@gmail.com, bruce.richardson@intel.com, alejandro.lucero@netronome.com Cc: dgilbert@redhat.com, stable@dpdk.org From: Ilya Maximets Date: Fri, 5 Oct 2018 15:02:42 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181004081403.8039-13-maxime.coquelin@redhat.com> Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMKsWRmVeSWpSXmKPExsWy7djP87oRQdujDf636lic+7SMyeLGKnuL d5+2M1n0brvHbnGl/Se7xbk1S1ksjnXuYbE4vfAai8W/jj/sFlsb/jNZbL44icmB2+PXgqWs Hjtn3WX3WLznJZPH9O6HzB7v911l8+jbsooxgC2KyyYlNSezLLVI3y6BK+Pc1W8sBaskK46s WsHewPhdpIuRk0NCwERiyZYfrF2MXBxCAisYJQ6u3M4E4XxhlLhx+BlU5jOjxPyOBYwwL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W8HbjOCJEQE 7jBKbJl1hhEkwSygIbH+6hNGiI4TjBKXZu8A62AT0JE4tfoIWBGvgJ3E7kfTweIsAioSq7d8 ZQaxRQUiJFYvf8EKUSMocXLmE5YuRg4OTgEHiZY70RDz1SX+zLvEDGGLSzR9WckKYctLbH87 h3kCo9AsJN2zkLTMQtIyC0nLAkaWVYwiqaXFuem5xUZ6xYm5xaV56XrJ+bmbGIGRuu3Yzy07 GLveBR9iFOBgVOLhnaC4LVqINbGsuDL3EKMEB7OSCK+jx/ZoId6UxMqq1KL8+KLSnNTiQ4ym QL9NZJYSTc4HJpG8knhDU0NzC0tDc2NzYzMLJXHe8waVUUIC6YklqdmpqQWpRTB9TBycUg2M qX7Vr09M8gqM6TvcE3rnxo5PS6YeXLGq/nTNmY1d+1jqTQQPCfVvP1buPCnhcMHpI2rWGVxT 91dqHT7PGLRPKiRg4bIkv+se1qveMueoFom+/MlUpPPtWU/k9BeiJxJXTExw47ynNi35986i 6NpSa6nT30J7vX3eJz/rU+2azncnISTn0tyzSizFGYmGWsxFxYkAFJFKf+oCAAA= Message-Id: <20181005120024eucas1p16e3484dd8d92c422f99ba1774b338ca1~atKCBaG2Y0203402034eucas1p1d@eucas1p1.samsung.com> X-CMS-MailID: 20181005120024eucas1p16e3484dd8d92c422f99ba1774b338ca1 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20181004081547epcas3p4f39fd5b30d59f9b884dfb1e0e4d54f4c X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181004081547epcas3p4f39fd5b30d59f9b884dfb1e0e4d54f4c References: <20181004081403.8039-1-maxime.coquelin@redhat.com> <20181004081403.8039-13-maxime.coquelin@redhat.com> Subject: Re: [dpdk-dev] [PATCH v3 12/19] vhost: add support for postcopy's listen message X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Oct 2018 12:00:26 -0000 Same here. 'postcopy_listening' should be cleared on backend cleanup. One minor comment inline. Best regards, Ilya Maximets. On 04.10.2018 11:13, Maxime Coquelin wrote: > Signed-off-by: Dr. David Alan Gilbert > Signed-off-by: Maxime Coquelin > --- > lib/librte_vhost/vhost.h | 1 + > lib/librte_vhost/vhost_user.c | 19 +++++++++++++++++++ > lib/librte_vhost/vhost_user.h | 3 ++- > 3 files changed, 22 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h > index 21722d8a8..9453cb28d 100644 > --- a/lib/librte_vhost/vhost.h > +++ b/lib/librte_vhost/vhost.h > @@ -364,6 +364,7 @@ struct virtio_net { > rte_spinlock_t slave_req_lock; > > int postcopy_ufd; > + int postcopy_listening; > > /* > * Device id to identify a specific backend device. > diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c > index 3d4fc60fc..ffb3ea60a 100644 > --- a/lib/librte_vhost/vhost_user.c > +++ b/lib/librte_vhost/vhost_user.c > @@ -76,6 +76,7 @@ static const char *vhost_message_str[VHOST_USER_MAX] = { > [VHOST_USER_CRYPTO_CREATE_SESS] = "VHOST_USER_CRYPTO_CREATE_SESS", > [VHOST_USER_CRYPTO_CLOSE_SESS] = "VHOST_USER_CRYPTO_CLOSE_SESS", > [VHOST_USER_POSTCOPY_ADVISE] = "VHOST_USER_POSTCOPY_ADVISE", > + [VHOST_USER_POSTCOPY_LISTEN] = "VHOST_USER_POSTCOPY_LISTEN", > }; > > /* The possible results of a message handling function */ > @@ -1552,6 +1553,23 @@ vhost_user_set_postcopy_advise(struct virtio_net **pdev, > #endif > } > > +static int > +vhost_user_set_postcopy_listen(struct virtio_net **pdev, > + struct VhostUserMsg *msg __rte_unused, > + int main_fd __rte_unused) > +{ > + struct virtio_net *dev = *pdev; > + > + if (dev->mem && dev->mem->nregions) { > + RTE_LOG(ERR, VHOST_CONFIG, > + "Regions already registered at postcopy-listen\n"); > + return VH_RESULT_ERR; > + } > + dev->postcopy_listening = 1; > + > + return VH_RESULT_OK; > +} > + > typedef int (*vhost_message_handler_t)(struct virtio_net **pdev, > struct VhostUserMsg *msg, > int main_fd); > @@ -1580,6 +1598,7 @@ static vhost_message_handler_t vhost_message_handlers[VHOST_USER_MAX] = { > [VHOST_USER_SET_SLAVE_REQ_FD] = vhost_user_set_req_fd, > [VHOST_USER_IOTLB_MSG] = vhost_user_iotlb_msg, > [VHOST_USER_POSTCOPY_ADVISE] = vhost_user_set_postcopy_advise, > + [VHOST_USER_POSTCOPY_LISTEN] = vhost_user_set_postcopy_listen, > }; > > > diff --git a/lib/librte_vhost/vhost_user.h b/lib/librte_vhost/vhost_user.h > index 2030b40a5..298279b91 100644 > --- a/lib/librte_vhost/vhost_user.h > +++ b/lib/librte_vhost/vhost_user.h > @@ -51,7 +51,8 @@ typedef enum VhostUserRequest { > VHOST_USER_CRYPTO_CREATE_SESS = 26, > VHOST_USER_CRYPTO_CLOSE_SESS = 27, > VHOST_USER_POSTCOPY_ADVISE = 28, > - VHOST_USER_MAX = 29 > + VHOST_USER_POSTCOPY_LISTEN = 29, > + VHOST_USER_MAX = 31 You didn't change the MAX value after moving the END request to another patch. Not sure if this is important, but I'd like to keep it correct here. > } VhostUserRequest; > > typedef enum VhostUserSlaveRequest { >