From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 7509F1F5 for ; Wed, 28 Jan 2015 15:05:33 +0100 (CET) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0SE5WFb004190 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 28 Jan 2015 09:05:32 -0500 Received: from redhat.com (ovpn-116-147.ams2.redhat.com [10.36.116.147]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t0SE5UWb017876 for ; Wed, 28 Jan 2015 09:05:31 -0500 Resent-From: "Michael S. Tsirkin" Resent-Date: Wed, 28 Jan 2015 16:05:30 +0200 Resent-Message-ID: <20150128140530.GA32234@redhat.com> Resent-To: dev@dpdk.org Date: Tue, 27 Jan 2015 11:37:15 +0200 From: "Michael S. Tsirkin" To: Linhaifeng Message-ID: <20150127093715.GB23066@redhat.com> References: <54C744D9.3060900@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54C744D9.3060900@huawei.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Cc: "dpd >> dev@dpdk.org" , liuyongan@huawei.com Subject: Re: [dpdk-dev] vhost: virtio-net rx-ring stop work after work many hours, bug? 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: Wed, 28 Jan 2015 14:05:33 -0000 On Tue, Jan 27, 2015 at 03:57:13PM +0800, Linhaifeng wrote: > Hi,all > > I use vhost-user to send data to VM at first it cant work well but after many hours VM can not receive data but can send data. > > (gdb)p avail_idx > $4 = 2668 > (gdb)p free_entries > $5 = 0 > (gdb)l > /* check that we have enough buffers */ > if (unlikely(count > free_entries)) > count = free_entries; > > if (count == 0){ > int b=0; > if(b) { // when set b=1 to notify guest rx_ring will restart to work > if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT)) { > > eventfd_write(vq->callfd, 1); > } > } > return 0; > } > > some info i print in guest: > > net eth3:vi->num=199 > net eth3:rvq info: num_free=57, used->idx=2668, avail->idx=2668 > net eth3:svq info: num_free=254, used->idx=1644, avail->idx=1644 > > net eth3:vi->num=199 > net eth3:rvq info: num_free=57, used->idx=2668, avail->idx=2668 > net eth3:svq info: num_free=254, used->idx=1645, avail->idx=1645 > > net eth3:vi->num=199 > net eth3:rvq info: num_free=57, used->idx=2668, avail->idx=2668 > net eth3:svq info: num_free=254, used->idx=1646, avail->idx=1646 > > # free > total used free shared buffers cached > Mem: 3924100 337252 3586848 0 95984 138060 > -/+ buffers/cache: 103208 3820892 > Swap: 970748 0 970748 > > I have two questions: > 1.Should we need to notify guest when there is no buffer in vq->avail? No unless NOTIFY_ON_EMPTY is set (most guests don't set it). > 2.Why virtio_net stop to fill avail? Most likely, it didn't get an interrupt. If so, it would be a dpdk vhost user bug. Which code are you using in dpdk? > > > > > > -- > Regards, > Haifeng