From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH] examples/vhost: introduce a new vhost-user-scsi sample application Date: Fri, 7 Jul 2017 08:50:35 +0800 Message-ID: <20170707005035.GT11626@yliu-home> References: <1498728512-12728-1-git-send-email-changpeng.liu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Changpeng Liu Return-path: Received: from mail-pf0-f180.google.com (mail-pf0-f180.google.com [209.85.192.180]) by dpdk.org (Postfix) with ESMTP id 18C712C8 for ; Fri, 7 Jul 2017 02:50:42 +0200 (CEST) Received: by mail-pf0-f180.google.com with SMTP id c73so8793403pfk.2 for ; Thu, 06 Jul 2017 17:50:42 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1498728512-12728-1-git-send-email-changpeng.liu@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 not, > + the latest Qemu code is recommended. You should specify the least QEMU version that supports vhost-user scsi here. > + > +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 allocate > + memory for the Virtual Machine on the hugetlbfs. This is typically due 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=on`` QEMU option is given. 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. > +* vhost_scsi can not start with block size 512 Bytes: > + > + Currently DPDK vhost library was designed for NET device(althrough the APIs > + are generic now), for 512 Bytes block device, Qemu BIOS(x86 BIOS Enhanced > + 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 process such > + scenarios(both BIOS and OS will enumerate the block device), so as a > + workaround, the vhost_scsi example application hardcoded the block size > + with 512 Bytes. A bit confused here. You said we can not use 512 bytes while you hardcode it with 512 bytes? > +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 = 0x70; /* Current + Fixed format */ Could you add macros for those magic numbers? I saw quite a lot of them. BTW, you might want to build it on a 32bit system. I think this patch won't build successfully on it. --yliu