From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 9BCB510CE7 for ; Thu, 22 Dec 2016 08:36:47 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 21 Dec 2016 23:36:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,387,1477983600"; d="scan'208";a="1075133550" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga001.jf.intel.com with ESMTP; 21 Dec 2016 23:36:45 -0800 Date: Thu, 22 Dec 2016 15:38:34 +0800 From: Yuanhan Liu To: Gopakumar Choorakkot Edakkunni Cc: huawei.xie@intel.com, dev@dpdk.org Message-ID: <20161222073834.GZ18991@yliu-dev.sh.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] Bug in virtqueue_dequeue_burst_rx() 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: Thu, 22 Dec 2016 07:36:48 -0000 On Mon, Dec 19, 2016 at 09:59:33PM -0800, Gopakumar Choorakkot Edakkunni wrote: > While I was testing virtio with ubuntu 14.04 kvm as host and dpdk16.07 > linux as guest, quite often I have seen that I get into a situation where > virtio_recv_mergeable_pkts() gets into a forever loop, after sending > traffic for a while. In the below API, I see that it clearly leads to a > while loop, I am not quite familiar with virtio or mergeable buffers, so > thought of checking with dpdk alias on the intent here. > > I checked the linux kernel virtio_net.c file which does the similar > mergeable recieve, and the kernel code breaks out in case of error. > Shouldnt dpdk be breaking out of here on error instead of continue ? Yep, that looks buggy. > > virtio_recv_mergeable_pkts() > { > > while (i < nb_used) { > > * num = virtqueue_dequeue_burst_rx(rxvq, rcv_pkts, len, 1);* > * if (num != 1)* > * continue;* However, normally, virtqueue_dequeue_burst_rx() would be successful here: the outer check (i < nb_used) somehow ascertains it. Two options I can think of so far: - will it go back working once you do "break" here? - tell us how you managed to trigger this issue, so that I could also reproduce it that I can debug it. --yliu