From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [119.145.14.66]) by dpdk.org (Postfix) with ESMTP id 251252C7A for ; Mon, 9 Feb 2015 05:12:50 +0100 (CET) Received: from 172.24.2.119 (EHLO szxeml431-hub.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BBQ08023; Mon, 09 Feb 2015 12:12:48 +0800 (CST) Received: from [127.0.0.1] (10.177.19.115) by szxeml431-hub.china.huawei.com (10.82.67.208) with Microsoft SMTP Server id 14.3.158.1; Mon, 9 Feb 2015 12:11:14 +0800 Message-ID: <54D8335A.4090400@huawei.com> Date: Mon, 9 Feb 2015 12:11:06 +0800 From: Linhaifeng User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: "Xu, Qian Q" , "Xie, Huawei" References: <1422527404-12424-1-git-send-email-haifeng.lin@huawei.com> <54CA29F4.8080108@huawei.com> <54CA3ABF.3010203@huawei.com> <82F45D86ADE5454A95A89742C8D1410E01C9FC50@shsmsx102.ccr.corp.intel.com> <54CDC1D3.9000806@huawei.com> <82F45D86ADE5454A95A89742C8D1410E01CA1DA3@shsmsx102.ccr.corp.intel.com> <54CF6BB3.7080002@huawei.com> <54D08AFA.2030404@huawei.com> <82F45D86ADE5454A95A89742C8D1410E01CA3197@shsmsx102.ccr.corp.intel.com> <54D0926D.9010304@huawei.com> <82F45D86ADE5454A95A89742C8D1410E01CA3873@shsmsx102.ccr.corp.intel.com> <54D43CCF.1000509@huawei.com> <82F45D86ADE5454A95A89742C8D1410E01CB7717@shsmsx102.ccr.corp.intel.com> <54D593F9.4070200@huawei.com> <82F45D86ADE5454A95A89742C8D1410E01CBABBB@shsmsx102.ccr.corp.intel.com> In-Reply-To: <82F45D86ADE5454A95A89742C8D1410E01CBABBB@shsmsx102.ccr.corp.intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.177.19.115] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.54D833C1.004A, ss=1, re=0.001, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 8c95a5a79a1f7d9d78d2f39e4a6b1865 Cc: "liuyongan@huawei.com" , "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] vhost: notify guest to fill buffer when there is no buffer 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: Mon, 09 Feb 2015 04:12:52 -0000 On 2015/2/9 10:57, Xu, Qian Q wrote: > Haifeng, > No matter mergeable =0 or 1, I have not met the issue that the vhost-user crash when start VM. Have u changed the code? As you said below, vhost-switch will notify guest after sending every packet, yes, it's the current code, and Huawei, Xie will plan to optimize it in future. Is the crash caused by changing code or any other step? > What do you want for the vhost-user, changing the notification mechanism? > Thx. By the way, sth means something. > Yes,I have modify the code for compile errors(I replace it with memset(&msgh, 0, sizeof msgh)). The issue is failed to mmap(memory size not align to hugepage's size).I guess this is qemu's bug. In file included from /mnt/sdc/linhf/dpdk-vhost-user/dpdk/lib/librte_vhost/virtio-net.c:34: /usr/include/linux/vhost.h:33: error: expected specifier-qualifier-list before ‘pid_t’ == Build lib/librte_port cc1: warnings being treated as errors /mnt/sdc/linhf/dpdk-vhost-user/dpdk/lib/librte_vhost/vhost_user/vhost-net-:.c: In function ‘read_fd_message’: /mnt/sdc/linhf/dpdk-vhost-user/dpdk/lib/librte_vhost/vhost_user/vhost-net-user.c:141: error: missing initializer /mnt/sdc/linhf/dpdk-vhost-user/dpdk/lib/librte_vhost/vhost_user/vhost-net-user.c:141: error: (near initialization for ‘msgh.msg_namelen’) /mnt/sdc/linhf/dpdk-vhost-user/dpdk/lib/librte_vhost/vhost_user/vhost-net-user.c: In function ‘send_fd_message’: /mnt/sdc/linhf/dpdk-vhost-user/dpdk/lib/librte_vhost/vhost_user/vhost-net-user.c:213: error: missing initializer /mnt/sdc/linhf/dpdk-vhost-user/dpdk/lib/librte_vhost/vhost_user/vhost-net-user.c:213: error: (near initialization for ‘msgh.msg_namelen’) /mnt/sdc/linhf/dpdk-vhost-user/dpdk/lib/librte_vhost/vhost_user/vhost-net-user.c: In function ‘vserver_new_vq_conn’: /mnt/sdc/linhf/dpdk-vhost-user/dpdk/lib/librte_vhost/vhost_user/vhost-net-user.c:276: error: missing initializer /mnt/sdc/linhf/dpdk-vhost-user/dpdk/lib/librte_vhost/vhost_user/vhost-net-user.c:276: error: (near initialization for ‘vdev_ctx.fh’) make[5]: *** [vhost_user/vhost-net-user.o] Error 1 make[5]: *** Waiting for unfinished jobs.... cc1: warnings being treated as errors /mnt/sdc/linhf/dpdk-vhost-user/dpdk/lib/librte_vhost/vhost_user/virtio-net-user.c: In function ‘user_set_mem_table’: /mnt/sdc/linhf/dpdk-vhost-user/dpdk/lib/librte_vhost/vhost_user/virtio-net-user.c:104: error: missing initializer /mnt/sdc/linhf/dpdk-vhost-user/dpdk/lib/librte_vhost/vhost_user/virtio-net-user.c:104: error: (near initialization for ‘tmp[0].mapped_address’) > -----Original Message----- > From: Linhaifeng [mailto:haifeng.lin@huawei.com] > Sent: Saturday, February 07, 2015 12:27 PM > To: Xu, Qian Q; Xie, Huawei > Cc: lilijun; liuyongan@huawei.com; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] vhost: notify guest to fill buffer when there is no buffer > > > > On 2015/2/6 13:54, Xu, Qian Q wrote: >> Haifeng >> Are you using the latest dpdk branch with vhost-user patches? I have never met the issue. >> When is the vhost sample crashed? When you start VM or when you run sth in VM? Is your qemu 2.2? How about your memory info? Could you give more details about your steps? >> >> > > I have knew why you never met the issue.Because vhost-switch will notify guest after send every packets(performance is not every well). > > static inline int __attribute__((always_inline)) virtio_tx_local(struct vhost_dev *vdev, struct rte_mbuf *m) { > ... > ret = rte_vhost_enqueue_burst(tdev, VIRTIO_RXQ, &m, 1/*you cant try to fill with rx_count*/); > .. > > } > >> >> -----Original Message----- >> From: Linhaifeng [mailto:haifeng.lin@huawei.com] >> Sent: Friday, February 06, 2015 12:02 PM >> To: Xu, Qian Q; Xie, Huawei >> Cc: lilijun; liuyongan@huawei.com; dev@dpdk.org >> Subject: Re: [dpdk-dev] [PATCH] vhost: notify guest to fill buffer >> when there is no buffer >> >> >> >> On 2015/2/4 9:38, Xu, Qian Q wrote: >>> 4. Launch the VM1 and VM2 with virtio device, note: you need use qemu version>2.1 to enable the vhost-user server's feature. Old qemu such as 1.5,1.6 didn't support it. >>> Below is my VM1 startup command, for your reference, similar for VM2. >>> /home/qemu-2.2.0/x86_64-softmmu/qemu-system-x86_64 -name us-vhost-vm1 >>> -cpu host -enable-kvm -m 2048 -object >>> memory-backend-file,id=mem,size=2048M,mem-path=/mnt/huge,share=on >>> -numa node,memdev=mem -mem-prealloc -smp 2 -drive >>> file=/home/img/dpdk1-vm1.img -chardev >>> socket,id=char0,path=/home/dpdk-vhost/vhost-net -netdev >>> type=vhost-user,id=mynet1,chardev=char0,vhostforce -device >>> virtio-net-pci,mac=00:00:00:00:00:01, -nographic >>> >>> 5. Then in the VM, you can have the same operations as before, send packet from virtio1 to virtio2. >>> >>> Pls let me know if any questions, issues. >> >> Hi xie & xu >> >> When I try to start VM vhost-switch crashed. >> >> VHOST_CONFIG: read message VHOST_USER_SET_MEM_TABLE >> VHOST_CONFIG: mapped region 0 fd:19 to 0xffffffffffffffff sz:0xa0000 >> off:0x0 >> VHOST_CONFIG: mmap qemu guest failed. >> VHOST_CONFIG: read message VHOST_USER_SET_VRING_NUM >> VHOST_CONFIG: read message VHOST_USER_SET_VRING_BASE >> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ADDR >> run_dpdk_vhost.sh: line 19: 1854 Segmentation fault ${RTE_SDK}/examples/vhost/build/app/vhost-switch -c 0x300 -n 4 --huge-dir /dev/hugepages -m 2048 -- -p 0x1 --vm2vm 2 --mergeable 0 --zero-copy 0 >> >> >> > > -- > Regards, > Haifeng > > > . > -- Regards, Haifeng