From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id BBD794CC3 for ; Tue, 2 Oct 2018 16:09:26 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181002140925euoutp01edd1c30d6d777f53772867ae500c2eb7~Zz_1EfRGX2836328363euoutp01b for ; Tue, 2 Oct 2018 14:09:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181002140925euoutp01edd1c30d6d777f53772867ae500c2eb7~Zz_1EfRGX2836328363euoutp01b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1538489365; bh=Hd/1mYiW5SJPXCCGzX2u55ToET1YrOf+iSCtwVYw/nk=; h=From:Subject:To:Cc:Date:In-Reply-To:References:From; b=vVBQR0RACrqWRdjj/EppiAgDHbF5q4V6am2kwD5QIluQSqg0R57mQFPSSgPyo7thm WBGsjQAEvdZK0/++Miad27KXkvNncvYIypDtKJVzTozjQIxO7CXt8ViyQhOfpM/DA0 0F9cg3EnemS/P5VZ+Cjqz6qugH1FfN4PAWy0PtVQ= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181002140925eucas1p1d3fb0692002ac405cc051d3c09ebbb5c~Zz_0nTb_f1028410284eucas1p1I; Tue, 2 Oct 2018 14:09:25 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 18.9F.04441.41C73BB5; Tue, 2 Oct 2018 15:09:24 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20181002140924eucas1p26a29e124daef119ec3a4b7aafbc4e547~Zz_zzwcE_2001420014eucas1p2L; Tue, 2 Oct 2018 14:09:24 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20181002140924eusmtrp2a6644b394affe090ae23c7ee61bbbcc7~Zz_zisZme0311103111eusmtrp2M; Tue, 2 Oct 2018 14:09:24 +0000 (GMT) X-AuditID: cbfec7f2-5c9ff70000001159-fb-5bb37c140504 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id BB.35.04284.31C73BB5; Tue, 2 Oct 2018 15:09:24 +0100 (BST) Received: from [106.109.129.180] (unknown [106.109.129.180]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20181002140923eusmtip1dc045b780e8f49d44ce9b1628c860fb8~Zz_y586Q70077100771eusmtip1i; Tue, 2 Oct 2018 14:09:23 +0000 (GMT) From: Ilya Maximets 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 Date: Tue, 2 Oct 2018 17:11:36 +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: <20181002093651.24795-11-maxime.coquelin@redhat.com> Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrAKsWRmVeSWpSXmKPExsWy7djPc7oiNZujDXo+mVic+7SMyeLGKnuL d5+2M1n0brvHbnGl/Se7xbk1S1ksjnXuYbE4vfAai8W/jj/sFlsb/jNZbL44icmB2+PXgqWs Hjtn3WX3WLznJZPH9O6HzB7v911l8+jbsooxgC2KyyYlNSezLLVI3y6BK+P1ZsmC9+IVi+/9 Zm5gfCDcxcjBISFgIrHmiU4XIxeHkMAKRon/U54xdjFyAjlfGCWW7jS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YtLSwgCTYBHYlTq48wgtjCAn4S 827+BpskInCHUWLLrDNgCWYBDYn1V58wQnSfYpR4dWszUBUHB6+AncTqjwkgNSwCKhIv/14E GyoqECGxevkLsM28AoISJ2c+AYtzCjhKnOx4zAoxU13iz7xLzBC2uETTl5VQcXmJ7W/nME9g FJqFpH0WkpZZSFpmIWlZwMiyilEktbQ4Nz232FCvODG3uDQvXS85P3cTIzBKtx37uXkH46WN wYcYBTgYlXh4GeQ3RQuxJpYVV+YeYpTgYFYS4e1L3BwtxJuSWFmVWpQfX1Sak1p8iNEU6LmJ zFKiyfnABJJXEm9oamhuYWlobmxubGahJM573qAySkggPbEkNTs1tSC1CKaPiYNTqoGRI/qe JK9r+HZvSXXOuwxKXnPnR+s8qVLIbC1aYq32zfpqT/DSb80fPyezCP2auei5NFsz2x2Bp7Ve x87u/fHYfL3yRtH9VSnTPTj2dV60+Hdu+5mJv05ONtjweUfKq7n8p5z7uN2lj7vN/jDzypuu 7FsGl203pr3ctjBvQencs6VLpzhtl9eMUGIpzkg01GIuKk4EAEM2wBzoAgAA Message-Id: <20181002140924eucas1p26a29e124daef119ec3a4b7aafbc4e547~Zz_zzwcE_2001420014eucas1p2L@eucas1p2.samsung.com> X-CMS-MailID: 20181002140924eucas1p26a29e124daef119ec3a4b7aafbc4e547 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20181002093808epcas3p2c9382f8412722cdb3db4558b3c312c38 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181002093808epcas3p2c9382f8412722cdb3db4558b3c312c38 References: <20181002093651.24795-1-maxime.coquelin@redhat.com> <20181002093651.24795-11-maxime.coquelin@redhat.com> Subject: Re: [dpdk-dev] [PATCH v2 10/17] 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: Tue, 02 Oct 2018 14:09:26 -0000 On 02.10.2018 12:36, 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 | 4 +++- > 3 files changed, 23 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 71721edc7..bd468ca12 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 */ > @@ -1548,6 +1549,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); > @@ -1576,6 +1594,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..73b1fe2b9 100644 > --- a/lib/librte_vhost/vhost_user.h > +++ b/lib/librte_vhost/vhost_user.h > @@ -51,7 +51,9 @@ 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_POSTCOPY_END = 30, I think, this should be part of patch 14 for consistency. > + VHOST_USER_MAX = 31 > } VhostUserRequest; > > typedef enum VhostUserSlaveRequest { >