From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 19812B62 for ; Tue, 8 Dec 2015 06:57:57 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 07 Dec 2015 21:57:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,398,1444719600"; d="scan'208";a="856180427" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga001.fm.intel.com with ESMTP; 07 Dec 2015 21:57:56 -0800 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 7 Dec 2015 21:57:56 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 7 Dec 2015 21:57:56 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.138]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.92]) with mapi id 14.03.0248.002; Tue, 8 Dec 2015 13:57:54 +0800 From: "Xie, Huawei" To: Yuanhan Liu , "dev@dpdk.org" Thread-Topic: [PATCH 1/4] vhost: handle VHOST_USER_SET_LOG_BASE request Thread-Index: AdExfWDXqaY6TcQeSVm1FMgfx2iqnw== Date: Tue, 8 Dec 2015 05:57:54 +0000 Message-ID: References: <1449027793-30975-1-git-send-email-yuanhan.liu@linux.intel.com> <1449027793-30975-2-git-send-email-yuanhan.liu@linux.intel.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 Cc: Victor Kaplansky , "Michael S. Tsirkin" Subject: Re: [dpdk-dev] [PATCH 1/4] vhost: handle VHOST_USER_SET_LOG_BASE request 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: Tue, 08 Dec 2015 05:57:58 -0000 On 12/2/2015 11:40 AM, Yuanhan Liu wrote:=0A= [...]=0A= > +=0A= > + addr =3D mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, off);=0A= > + if (addr =3D=3D MAP_FAILED) {=0A= > + RTE_LOG(ERR, VHOST_CONFIG, "mmap log base failed!\n");=0A= > + return -1;=0A= > + }=0A= Yuanhan:=0A= mmap could fail with non-zero offset for huge page based mapping. Check=0A= our workaround in user_set_mem_table.=0A= I think you have done the validation, but i guess off is zero here.=0A= > +=0A= > + /* TODO: unmap on stop */=0A= > + dev->log_base =3D addr;=0A= > + dev->log_size =3D size;=0A= > +=0A= > + return 0;=0A= > +}=0A= > diff --git a/lib/librte_vhost/vhost_user/virtio-net-user.h b/lib/librte_v= host/vhost_user/virtio-net-user.h=0A= > index b82108d..013cf38 100644=0A= > --- a/lib/librte_vhost/vhost_user/virtio-net-user.h=0A= > +++ b/lib/librte_vhost/vhost_user/virtio-net-user.h=0A= > @@ -49,6 +49,7 @@ void user_set_vring_kick(struct vhost_device_ctx, struc= t VhostUserMsg *);=0A= > =0A= > void user_set_protocol_features(struct vhost_device_ctx ctx,=0A= > uint64_t protocol_features);=0A= > +int user_set_log_base(struct vhost_device_ctx ctx, struct VhostUserMsg *= );=0A= > =0A= > int user_get_vring_base(struct vhost_device_ctx, struct vhost_vring_stat= e *);=0A= > =0A= =0A=