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 9AA804F90 for ; Tue, 2 Oct 2018 16:16:27 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181002141626euoutp010bd2e0ee55fb38584d4fcebcf4ecefc1~Z0E9Ra-DY3201032010euoutp01K for ; Tue, 2 Oct 2018 14:16:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181002141626euoutp010bd2e0ee55fb38584d4fcebcf4ecefc1~Z0E9Ra-DY3201032010euoutp01K DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1538489786; bh=ldJj3lu6LcX+NaFhJogXKeoDhXSK4tqfxMuvR8pU3gs=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=DaTptYKHkGhOoOnFV664TLIna/sth1WeR/UQuEy5R+QgiYhF7pSAjmZ+lb7xJ8EnD msS9wdd3kwF8zoAa+NINc2rOK6zgZuu/iLkI9Yw92Pul02vyPHBuUCkOmVPao/OROh Ki9YmMKl6eRRsSbb8sBAdbc4noFb6xxkmh8vuj/U= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181002141626eucas1p111817045d66a522aef9161e6054e5cd0~Z0E8sx07I1525515255eucas1p1i; Tue, 2 Oct 2018 14:16:26 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id E5.E5.04294.9BD73BB5; Tue, 2 Oct 2018 15:16:25 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20181002141625eucas1p229ea75e76bb8b48baa7a842fa8603be0~Z0E73oLiy2051120511eucas1p2m; Tue, 2 Oct 2018 14:16:25 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20181002141625eusmtrp1b5a5f4d06ad4d3d14509b8e7ef3df80a~Z0E7lrEGE2215322153eusmtrp1c; Tue, 2 Oct 2018 14:16:25 +0000 (GMT) X-AuditID: cbfec7f4-84fff700000010c6-b9-5bb37db9efe5 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 9B.E4.04128.8BD73BB5; Tue, 2 Oct 2018 15:16:24 +0100 (BST) Received: from [106.109.129.180] (unknown [106.109.129.180]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20181002141624eusmtip1a1485b7d20dcc6240eabf361d450dfac~Z0E65159a0273502735eusmtip1u; Tue, 2 Oct 2018 14:16:24 +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: Tue, 2 Oct 2018 17:18:41 +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-15-maxime.coquelin@redhat.com> Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMKsWRmVeSWpSXmKPExsWy7djP87o7azdHGyxebGRx7tMyJosbq+wt 3n3azmTRu+0eu8WV9p/sFufWLGWxONa5h8Xi9MJrLBb/Ov6wW2xt+M9ksfniJCYHbo9fC5ay euycdZfdY/Gel0we07sfMnu833eVzaNvyyrGALYoLpuU1JzMstQifbsErow5P38zF+wVqlj4 roe1gXExfxcjJ4eEgInEotOf2bsYuTiEBFYwSkz/vxvK+cIo0X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1jiz7UuNoii94wSv378YAFJCAt4SUxZ/JEFJCEi cIdRYsusM4wgCWYBDYn1V58wQnScAurYs4EdJMEmoCNxavURsCJeATuJ1VNXsIHYLAIqEmva LoPZogIREquXv2CFqBGUODnzCdg2TgFHia2X7rNCLFCX+DPvEjOELS7R9GUlVFxeYvvbOcwT GIVmIWmfhaRlFpKWWUhaFjCyrGIUSS0tzk3PLTbSK07MLS7NS9dLzs/dxAiM1W3Hfm7Zwdj1 LvgQowAHoxIPL4P8pmgh1sSy4srcQ4wSHMxKIrx9iZujhXhTEiurUovy44tKc1KLDzGaAj03 kVlKNDkfmEbySuINTQ3NLSwNzY3Njc0slMR5zxtURgkJpCeWpGanphakFsH0MXFwSjUwduhz MLZ5uj9rY53S+eOQmobKz4t2zaqK+6Y+2qwqVyI7m++tuFZSleTcPuMcF802E6NdPzdt/Jp0 yUTsqP6qnfPSts9eEZbueTLx9Ecpzku8RYmxhbv/JD6bmd7k881Mpejv4ocZD1YXT71n/Pvo uX+7Uq/WHX7aWq82bdGePc9MuZK5fTK/KbEUZyQaajEXFScCAHUOFSHrAgAA Message-Id: <20181002141625eucas1p229ea75e76bb8b48baa7a842fa8603be0~Z0E73oLiy2051120511eucas1p2m@eucas1p2.samsung.com> X-CMS-MailID: 20181002141625eucas1p229ea75e76bb8b48baa7a842fa8603be0 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20181002093841epcas5p187dd8b787cd34d6bbdc56a554013e340 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181002093841epcas5p187dd8b787cd34d6bbdc56a554013e340 References: <20181002093651.24795-1-maxime.coquelin@redhat.com> <20181002093651.24795-15-maxime.coquelin@redhat.com> Subject: Re: [dpdk-dev] [PATCH v2 14/17] vhost: add support to postcopy's end request 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:16:27 -0000 On 02.10.2018 12:36, Maxime Coquelin wrote: > The master sends this message before stopping handling > userfaults, so that the backend closes the userfaultfd. > > The master waits for the slave to acknowledge the request > with an empty 64bits payload for synchronization purpose. > > Signed-off-by: Dr. David Alan Gilbert > Signed-off-by: Maxime Coquelin > --- > lib/librte_vhost/vhost_user.c | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c > index b207de6e0..ee7337ac8 100644 > --- a/lib/librte_vhost/vhost_user.c > +++ b/lib/librte_vhost/vhost_user.c > @@ -77,6 +77,7 @@ static const char *vhost_message_str[VHOST_USER_MAX] = { > [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", > + [VHOST_USER_POSTCOPY_END] = "VHOST_USER_POSTCOPY_END", > }; > > /* The possible results of a message handling function */ > @@ -1640,6 +1641,25 @@ vhost_user_set_postcopy_listen(struct virtio_net **pdev, > return VH_RESULT_OK; > } > > +static int > +vhost_user_postcopy_end(struct virtio_net **pdev, struct VhostUserMsg *msg, > + int main_fd __rte_unused) > +{ > + struct virtio_net *dev = *pdev; > + > + dev->postcopy_listening = 0; > + if (dev->postcopy_ufd >= 0) { > + close(dev->postcopy_ufd); > + dev->postcopy_ufd = -1; > + } > + > + msg->payload.u64 = 0; > + msg->size = sizeof(msg->payload.u64); > + msg->fd_num = 0; > + > + return 0; I think, it should return VH_RESULT_REPLY as the reply is mandatory according to specification. In pair with change in patch #1 this will not produce double replies. > +} > + > typedef int (*vhost_message_handler_t)(struct virtio_net **pdev, > struct VhostUserMsg *msg, > int main_fd); > @@ -1669,6 +1689,7 @@ static vhost_message_handler_t vhost_message_handlers[VHOST_USER_MAX] = { > [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, > + [VHOST_USER_POSTCOPY_END] = vhost_user_postcopy_end, > }; > > >