From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [119.145.14.64]) by dpdk.org (Postfix) with ESMTP id 412299AAB for ; Tue, 3 Feb 2015 08:35:22 +0100 (CET) Received: from 172.24.2.119 (EHLO szxeml426-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CJA00911; Tue, 03 Feb 2015 15:35:17 +0800 (CST) Received: from [127.0.0.1] (10.177.19.115) by szxeml426-hub.china.huawei.com (10.82.67.181) with Microsoft SMTP Server id 14.3.158.1; Tue, 3 Feb 2015 15:35:04 +0800 Message-ID: <54D07A25.2060809@huawei.com> Date: Tue, 3 Feb 2015 15:35:01 +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: "dpd >> dev@dpdk.org" , "ms >> Michael S. Tsirkin" References: <54C744D9.3060900@huawei.com> In-Reply-To: <54C744D9.3060900@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.19.115] X-CFilter-Loop: Reflected Cc: 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: Tue, 03 Feb 2015 07:35:24 -0000 I found that the new code had try to notify guest after send each packet after 2bbb811. So this bug not exist now. static inline uint32_t __attribute__((always_inline)) virtio_dev_merge_rx(struct virtio_net *dev, uint16_t queue_id, struct rte_mbuf **pkts, uint32_t count) { ... ... for (pkt_idx = 0; pkt_idx < count; pkt_idx++) { ... ... /* Kick the guest if necessary. */ if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT)) eventfd_write((int)vq->kickfd, 1); } return count; } thank you very much! On 2015/1/27 15:57, 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? > 2.Why virtio_net stop to fill avail? > > > > > > -- Regards, Haifeng