From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH 4/6] vhost: workaround stale vring base Date: Mon, 9 May 2016 11:23:55 -0700 Message-ID: <20160509182355.GG5641@yliu-dev.sh.intel.com> References: <1462603224-29510-1-git-send-email-yuanhan.liu@linux.intel.com> <1462603224-29510-5-git-send-email-yuanhan.liu@linux.intel.com> <1245742132.28022376.1462790702229.JavaMail.zimbra@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Victor Kaplansky , "dev@dpdk.org" , "Michael S. Tsirkin" To: "Xie, Huawei" Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 34EAC58CF for ; Mon, 9 May 2016 20:19:40 +0200 (CEST) Content-Disposition: inline In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, May 09, 2016 at 01:39:25PM +0000, Xie, Huawei wrote: > On 5/9/2016 6:45 PM, Victor Kaplansky wrote: > >> diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c > >> > index c88aaa3..df103aa 100644 > >> > --- a/lib/librte_vhost/virtio-net.c > >> > +++ b/lib/librte_vhost/virtio-net.c > >> > @@ -560,6 +560,14 @@ vhost_set_vring_addr(int vid, struct vhost_vring_addr > >> > *addr) > >> > return -1; > >> > } > >> > > >> > + if (vq->last_used_idx != vq->used->idx) { > >> > + RTE_LOG(WARNING, VHOST_CONFIG, > >> > + "last_used_idx (%u) and vq->used->idx (%u) mismatch\n", > > I agree with this approach. I just would add to the log message that last_user_idx > > have overrode by used_idx and some packets may be dropped. Good suggestion. Will do in v2. > For TX, the packets are resent. > For RX, the packets are dropped. Yes. Thanks. --yliu