From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 820EC7E75 for ; Fri, 14 Nov 2014 02:20:21 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 13 Nov 2014 17:27:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,381,1413270000"; d="scan'208";a="636721929" Received: from kmsmsx152.gar.corp.intel.com ([172.21.73.87]) by orsmga002.jf.intel.com with ESMTP; 13 Nov 2014 17:30:20 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by KMSMSX152.gar.corp.intel.com (172.21.73.87) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 14 Nov 2014 09:28:22 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.86]) with mapi id 14.03.0195.001; Fri, 14 Nov 2014 09:28:20 +0800 From: "Xie, Huawei" To: Linhaifeng , 'Tetsuya Mukawa' , "dev@dpdk.org" Thread-Topic: [dpdk-dev] vhost-user technical isssues Thread-Index: Ac/997srCGFXGQlUQCu5VHdgBPnJPgA0CRoAADg9QFA= Date: Fri, 14 Nov 2014 01:28:19 +0000 Message-ID: References: <54644F5E.8080407@huawei.com> In-Reply-To: <54644F5E.8080407@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] vhost-user technical isssues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2014 01:20:22 -0000 > -----Original Message----- > From: Linhaifeng [mailto:haifeng.lin@huawei.com] > Sent: Wednesday, November 12, 2014 11:28 PM > To: Xie, Huawei; 'Tetsuya Mukawa'; dev@dpdk.org > Subject: Re: [dpdk-dev] vhost-user technical isssues >=20 >=20 >=20 > On 2014/11/12 5:37, Xie, Huawei wrote: > > Hi Tetsuya: > > There are two major technical issues in my mind for vhost-user > implementation. > > > > 1) memory region map > > Vhost-user passes us file fd and offset for each memory region. Unfortu= nately > the mmap offset is "very" wrong. I discovered this issue long time ago, a= nd also > found > > that I couldn't mmap the huge page file even with correct offset(need d= ouble > check). > > Just now I find that people reported this issue on Nov 3. > > [Qemu-devel] [PULL 27/29] vhost-user: fix mmap offset calculation > > Anyway, I turned to the same idea used in our DPDK vhost-cuse: only use= the fd > for region(0) to map the whole file. > > I think we should use this way temporarily to support qemu-2.1 as it ha= s that > bug. > > >=20 > the size of region 0 is not same as the file size. may be you should mmap= the > other region. Haifeng: Will calculate the maximum memory size, and use any file fd to mmap it. Here we assume the fds for different regions actually point to the same fil= e. In theory we should use the fd for each region to map each memory region. In fact we could map once. This will also save address space for 1GB huge p= age due to mmap alignment requirement. >=20 > region 0: > gpa =3D 0x0 > size =3D 655360 > ua =3D 0x2aaaaac00000 > offset =3D 0 >=20 > region 1:// use this region to mmap.BTW how to avoid mmap twice when ther= e > are two devices? > gpa =3D 0xC0000 > size =3D 2146697216 > ua =3D 0x2aaaaacc0000 > offset =3D 786432 What do you mean by two devices? >=20 >=20 >=20 > > 2) what message is the indicator for vhost start/release? > > Previously for vhost-cuse, it has SET_BACKEND message. > > What we should do for vhost-user? > > SET_VRING_KICK for start? > > What about for release? > > Unlike the kernel virtio, the DPDK virtio in guest could be restarted. > > > > Thoughts? > > > > -huawei > > > > >=20 > -- > Regards, > Haifeng