From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 2DB392C8 for ; Fri, 7 Jul 2017 04:01:25 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP; 06 Jul 2017 19:01:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,320,1496127600"; d="scan'208";a="108279642" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga002.jf.intel.com with ESMTP; 06 Jul 2017 19:01:20 -0700 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 6 Jul 2017 19:00:42 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 6 Jul 2017 19:00:41 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.197]) with mapi id 14.03.0319.002; Fri, 7 Jul 2017 10:00:38 +0800 From: "Liu, Changpeng" To: Yuanhan Liu CC: "dev@dpdk.org" Thread-Topic: [PATCH] examples/vhost: introduce a new vhost-user-scsi sample application Thread-Index: AQHS7+55prSq4kWcbE2c0sPjLm8tPKJHEByAgACX/NA= Date: Fri, 7 Jul 2017 02:00:38 +0000 Message-ID: References: <1498728512-12728-1-git-send-email-changpeng.liu@intel.com> <20170707005035.GT11626@yliu-home> In-Reply-To: <20170707005035.GT11626@yliu-home> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action 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] [PATCH] examples/vhost: introduce a new vhost-user-scsi sample application 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, 07 Jul 2017 02:01:29 -0000 > -----Original Message----- > From: Yuanhan Liu [mailto:yliu@fridaylinux.org] > Sent: Friday, July 7, 2017 8:51 AM > To: Liu, Changpeng > Cc: dev@dpdk.org > Subject: Re: [PATCH] examples/vhost: introduce a new vhost-user-scsi samp= le > application >=20 > On Thu, Jun 29, 2017 at 05:28:32PM +0800, Changpeng Liu wrote: > > +.. note:: > > + You must check whether you Qemu can support "vhost-user-scsi" or n= ot, > > + the latest Qemu code is recommended. >=20 > You should specify the least QEMU version that supports vhost-user scsi h= ere. Okay, will add Qemu version and commit ID. >=20 > > + > > +Common Issues > > +------------- > > + > > +* QEMU fails to allocate memory on hugetlbfs, with an error like the > > + following:: > > + > > + file_ram_alloc: can't mmap RAM pages: Cannot allocate memory > > + > > + When running QEMU the above error indicates that it has failed to al= locate > > + memory for the Virtual Machine on the hugetlbfs. This is typically d= ue to > > + insufficient hugepages being free to support the allocation request.= The > > + number of free hugepages can be checked as follows: > > + > > + .. code-block:: console > > + > > + cat /sys/kernel/mm/hugepages/hugepages-/nr_hugepages > > + > > + The command above indicates how many hugepages are free to support > QEMU's > > + allocation request. > > + > > +* vhost-user will not work with a QEMU version without shared memory > mapping: > > + > > + Make sure ``share=3Don`` QEMU option is given. >=20 > They are common pitfalls of vhost-user examples. You don't have to repeat > it again here. Instead, you could add a link to the vhost-example doc and > let this section only cover issues belong to vhost-user scsi. >=20 > > +* vhost_scsi can not start with block size 512 Bytes: > > + > > + Currently DPDK vhost library was designed for NET device(althrough t= he APIs > > + are generic now), for 512 Bytes block device, Qemu BIOS(x86 BIOS Enh= anced > > + Disk Device) will enumerate all block device and do some IO to those= block > > + devices with 512 Bytes sector size. DPDK vhost library can not proce= ss such > > + scenarios(both BIOS and OS will enumerate the block device), so as a > > + workaround, the vhost_scsi example application hardcoded the block s= ize > > + with 512 Bytes. >=20 > A bit confused here. You said we can not use 512 bytes while you hardcode= it > with 512 bytes? Typo, hardcoded 4096 now. >=20 > > +static void > > +scsi_task_build_sense_data(struct vhost_scsi_task *task, int sk, > > + int asc, int ascq) > > +{ > > + uint8_t *cp; > > + int resp_code; > > + > > + resp_code =3D 0x70; /* Current + Fixed format */ >=20 > Could you add macros for those magic numbers? I saw quite a lot of them. All the numbers are defined by SCSI specifications, I think this is okay, i= f you looked into kernel scsi module or kernel LIO scsi target, they also used the specification numbers directly. >=20 > BTW, you might want to build it on a 32bit system. I think this patch > won't build successfully on it. I didn't build it with 32bit system before, I don't know the result. >=20 > --yliu