From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Xie, Huawei" Subject: Re: [PATCH 1/4] vhost: handle VHOST_USER_SET_LOG_BASE request 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: Victor Kaplansky , "Michael S. Tsirkin" To: Yuanhan Liu , "dev@dpdk.org" 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) Content-Language: en-US List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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=