From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id DAA39697C for ; Mon, 9 May 2016 15:39:29 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP; 09 May 2016 06:39:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,600,1455004800"; d="scan'208";a="99839686" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga004.fm.intel.com with ESMTP; 09 May 2016 06:39:28 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 9 May 2016 06:39:28 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 9 May 2016 06:39:28 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.148]) by shsmsx102.ccr.corp.intel.com ([169.254.2.104]) with mapi id 14.03.0248.002; Mon, 9 May 2016 21:39:26 +0800 From: "Xie, Huawei" To: Victor Kaplansky , Yuanhan Liu CC: "dev@dpdk.org" , "Michael S. Tsirkin" Thread-Topic: [dpdk-dev] [PATCH 4/6] vhost: workaround stale vring base Thread-Index: AdGp+DOIffOoJ2PcSEKOV7JBLe/VCA== Date: Mon, 9 May 2016 13:39:25 +0000 Message-ID: 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> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 4/6] vhost: workaround stale vring base 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 May 2016 13:39:30 -0000 On 5/9/2016 6:45 PM, Victor Kaplansky wrote:=0A= >> diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net= .c=0A= >> > index c88aaa3..df103aa 100644=0A= >> > --- a/lib/librte_vhost/virtio-net.c=0A= >> > +++ b/lib/librte_vhost/virtio-net.c=0A= >> > @@ -560,6 +560,14 @@ vhost_set_vring_addr(int vid, struct vhost_vring_= addr=0A= >> > *addr)=0A= >> > return -1;=0A= >> > }=0A= >> > =0A= >> > + if (vq->last_used_idx !=3D vq->used->idx) {=0A= >> > + RTE_LOG(WARNING, VHOST_CONFIG,=0A= >> > + "last_used_idx (%u) and vq->used->idx (%u) mismatch\n",=0A= > I agree with this approach. I just would add to the log message that last= _user_idx=0A= > have overrode by used_idx and some packets may be dropped.=0A= =0A= For TX, the packets are resent.=0A= For RX, the packets are dropped.=0A= =0A= >=0A= >> > + vq->last_used_idx, vq->used->idx);=0A= >> > + vq->last_used_idx =3D vq->used->idx;=0A= >> > + vq->last_used_idx_res =3D vq->used->idx;=0A= >> > + }=0A= >> > +=0A= >> > vq->log_guest_addr =3D addr->log_guest_addr;=0A= >> > =0A= >> > LOG_DEBUG(VHOST_CONFIG, "(%d) mapped address desc: %p\n",=0A= >> > --=0A= >> > 1.9.0=0A= >> > =0A= =0A=