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 0DC671B4BA for ; Fri, 28 Sep 2018 15:15:26 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180928131525euoutp013d0f146bffa1847f38a7a80bf7b9a2ee~Ykqisx4HB2183821838euoutp01D for ; Fri, 28 Sep 2018 13:15:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180928131525euoutp013d0f146bffa1847f38a7a80bf7b9a2ee~Ykqisx4HB2183821838euoutp01D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1538140525; bh=WZBMOF4KkTWkb+RwIGiOcUCu1SAF+rTl/nHfB2aG19Q=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=M9b/k0fcdCUxTIk4NRI6bfnYLO0mTvR4LnTjxcNO265abvnA+T78AqObNEdP+n95z PAlj0PJZOHlrdmht68YhgAR6KBh6Awxoul2Nv9J0ZUQVCAw3QGGCMx6YFsRnsYxwKm j9qLEZLcKQpiRy+KfW3Ktsk6ioOvYZzRYM+3p1cU= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180928131525eucas1p1adb6e74948f131235e3a85aa8243d5ef~YkqiRJ9VB3150031500eucas1p1Y; Fri, 28 Sep 2018 13:15:25 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id CA.65.04441.D692EAB5; Fri, 28 Sep 2018 14:15:25 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20180928131524eucas1p174f4057454f99c035b2025c4a7c7dec1~YkqhekGjc3150031500eucas1p1X; Fri, 28 Sep 2018 13:15:24 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20180928131524eusmtrp28ade6911fda48510789d04f0c9b3e309~YkqhdhmsV2788927889eusmtrp24; Fri, 28 Sep 2018 13:15:24 +0000 (GMT) X-AuditID: cbfec7f2-5e3ff70000001159-93-5bae296dd715 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 1C.27.04284.C692EAB5; Fri, 28 Sep 2018 14:15:24 +0100 (BST) Received: from [106.109.129.180] (unknown [106.109.129.180]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20180928131523eusmtip22417ec7b212f30dfae1b3b45f188a95b~Ykqg5P2J32184521845eusmtip2T; Fri, 28 Sep 2018 13:15:23 +0000 (GMT) To: Bruce Richardson Cc: Maxime Coquelin , dev@dpdk.org, tiwei.bie@intel.com, zhihong.wang@intel.com, jfreimann@redhat.com, dgilbert@redhat.com, Thomas Monjalon From: Ilya Maximets Date: Fri, 28 Sep 2018 16:17:34 +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: <20180928121334.GA6880@bricha3-MOBL.ger.corp.intel.com> Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0hTYRjuOxfP2XTyOZW9LCEYBWleEgQPZpogMfJHQj8sh+nK4wWd2o5a KphFpVmWWDgcaVaIZnZBnTfEcsnUJMNbzJTU6kfmJbxEWaS5HSX/Pe/zvM/3Pg98LCk30Uo2 OS2T16dpU1UOUqrFsvbOR+f5THOwb4LhrPWh3OJyK8GVtHxkuNHCNYYbbKihOMv1Topbnu6j OFPBBsE1DZURRyTq39U1tPpR5yyhtoyXM+rvXWMO6lvN9SiSjpYGx/Opydm83i8kTppUO/WL zDC4XR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CCOIzStgJ3HoywEWEJtFQFXi44pNYDWiAhESq5e/YIWoEZQ4 OfMJUA0HB6eAi0TjyyKQMLOAusSfeZeYIWxxiaYvK1khbHmJ7W/nME9gFJqFpHsWkpZZSFpm IWlZwMiyilEktbQ4Nz232FCvODG3uDQvXS85P3cTIzAStx37uXkH46WNwYcYBTgYlXh4Ex6t iRZiTSwrrsw9xCjBwawkwruvem20EG9KYmVValF+fFFpTmrxIUZToN8mMkuJJucDk0ReSbyh qaG5haWhubG5sZmFkjjveYPKKCGB9MSS1OzU1ILUIpg+Jg5OqQZG9Y68U/bMFy+cusCV9mTr UtbU/qsC2xsWBHW90Nh7ZYvcvtSppTFex9YzxJmmlSVGfWYpuaX4++hdXdVVpY5BebIZ3DNF xFxz5hz4LhaYP2tDmcyxZJGNfg8XPdoZfstY60LPdg2llZ9ms087vG3DmUeP5sd3rL5hfejs WYYFp12d1uke4b+zV4mlOCPRUIu5qDgRAAvINg/aAgAA Message-Id: <20180928131524eucas1p174f4057454f99c035b2025c4a7c7dec1~YkqhekGjc3150031500eucas1p1X@eucas1p1.samsung.com> X-CMS-MailID: 20180928131524eucas1p174f4057454f99c035b2025c4a7c7dec1 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20180927082608eucas1p17cd1d99e54134fb2a6de3151e52048f3 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180927082608eucas1p17cd1d99e54134fb2a6de3151e52048f3 References: <20180926072705.22641-1-maxime.coquelin@redhat.com> <20180926072705.22641-5-maxime.coquelin@redhat.com> <20180927082608eucas1p17cd1d99e54134fb2a6de3151e52048f3~YNErH8Swu2138421384eucas1p1G@eucas1p1.samsung.com> <20180928103815eucas1p1ddb4141bea8b9ef965073a4706ccdaea~YihUJIT9-2460124601eucas1p1Z@eucas1p1.samsung.com> <20180928121334.GA6880@bricha3-MOBL.ger.corp.intel.com> Subject: Re: [dpdk-dev] [04/12] vhost: introduce postcopy's advise 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, 28 Sep 2018 13:15:27 -0000 On 28.09.2018 15:13, Bruce Richardson wrote: > On Fri, Sep 28, 2018 at 01:40:25PM +0300, Ilya Maximets wrote: >> On 27.09.2018 11:28, Ilya Maximets wrote: >>> On 26.09.2018 10:26, Maxime Coquelin wrote: >>>> This patch opens a userfaultfd and sends it back to Qemu's >>>> VHOST_USER_POSTCOPY_ADVISE request. >>>> >>>> Signed-off-by: Dr. David Alan Gilbert >>>> Signed-off-by: Maxime Coquelin >>>> --- >>>> lib/librte_vhost/vhost.h | 2 ++ >>>> lib/librte_vhost/vhost_user.c | 37 +++++++++++++++++++++++++++++++++++ >>>> lib/librte_vhost/vhost_user.h | 3 ++- >>>> 3 files changed, 41 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h >>>> index 25ffd7614..21722d8a8 100644 >>>> --- a/lib/librte_vhost/vhost.h >>>> +++ b/lib/librte_vhost/vhost.h >>>> @@ -363,6 +363,8 @@ struct virtio_net { >>>> int slave_req_fd; >>>> rte_spinlock_t slave_req_lock; >>>> >>>> + int postcopy_ufd; >>>> + >>>> /* >>>> * Device id to identify a specific backend device. >>>> * It's set to -1 for the default software implementation. >>>> diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c >>>> index a9b429598..bdfe2cac0 100644 >>>> --- a/lib/librte_vhost/vhost_user.c >>>> +++ b/lib/librte_vhost/vhost_user.c >>>> @@ -24,9 +24,13 @@ >>>> #include >>>> #include >>>> #include >>>> +#include >>>> +#include >>> >>> Maybe we need compile time check for this header existence? >>> Otherwise, this will bump minimal kernel version for default linux build >>> to something like 4.3. >> >> We'll need a config option here (disabled by default) and guard all >> the postcopy related code. >> Meson build will be able to detect the header file and enable >> the config if possible. Like this: >> >> lib/librte_vhost/meson.build: >> if cc.has_header('linux/userfaultfd.h') >> dpdk_conf.set10('RTE_LIBRTE_VHOST_POSTCOPY', true) > > Are you sure you want 'set10' rather than 'set'. Set is probably easier > because it ensures no define on false, while set10 has a define of 0. This > has caught me out before. > > FYI, you can also avoid the if by putting the condition into the define: > > dpdk_conf.set('RTE_LIBRTE_VHOST_POSTCOPY', cc.has_header('...')) Sure, this variant looks better. Thanks for suggestions. I just copied my version from the similar code for 'RTE_HAS_LIBNUMA'. Best regards, Ilya Maximets.