From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAwsR-0000OG-Dt for qemu-devel@nongnu.org; Thu, 09 Jun 2016 06:07:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAwsN-0005oe-5F for qemu-devel@nongnu.org; Thu, 09 Jun 2016 06:07:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAwsM-0005oa-VW for qemu-devel@nongnu.org; Thu, 09 Jun 2016 06:07:47 -0400 Date: Thu, 9 Jun 2016 13:07:42 +0300 From: Victor Kaplansky Message-ID: <20160609130242-mutt-send-email-victork@redhat.com> References: <1465231508-30183-1-git-send-email-marcandre.lureau@redhat.com> <1465231508-30183-4-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1465231508-30183-4-git-send-email-marcandre.lureau@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 03/10] tests/vhost-user-bridge: workaround stale vring base List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: marcandre.lureau@redhat.com Cc: qemu-devel@nongnu.org, "Michael S . Tsirkin" , Tetsuya Mukawa , jonshin@cisco.com, Ilya Maximets , Yuanhan Liu On Mon, Jun 06, 2016 at 06:45:01PM +0200, marcandre.lureau@redhat.com wro= te: > From: Marc-Andr=E9 Lureau >=20 > This patch is a similar solution to what Yuanhan Liu/Huawei Xie have > suggested for DPDK. When vubr quits (killed or crashed), a restart of > vubr would get stale vring base from QEMU. That would break the kernel > virtio net completely, making it non-work any more, unless a driver > reset is done. >=20 > So, instead of getting the stale vring base from QEMU, Huawei suggested > we could get a proper one from used->idx. This works because the queues > packets are processed in order. >=20 > Signed-off-by: Marc-Andr=E9 Lureau > Tested-by: Yuanhan Liu > Reviewed-by: Yuanhan Liu > --- > tests/vhost-user-bridge.c | 7 +++++++ > 1 file changed, 7 insertions(+) >=20 > diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c > index f907ce7..38963e4 100644 > --- a/tests/vhost-user-bridge.c > +++ b/tests/vhost-user-bridge.c > @@ -946,6 +946,13 @@ vubr_set_vring_addr_exec(VubrDev *dev, VhostUserMs= g *vmsg) > DPRINT(" vring_avail at %p\n", vq->avail); > =20 > vq->last_used_index =3D vq->used->idx; > + > + if (vq->last_avail_index !=3D vq->used->idx) { > + DPRINT("Last avail index !=3D used index: %d !=3D %d, resuming= ", > + vq->last_avail_index, vq->used->idx); > + vq->last_avail_index =3D vq->used->idx; > + } > + What if set_vring_base is called after set_vring_addr? Maybe it is worth to add the fixup to the set_vring_base as well? > return 0; > } > =20 > --=20 > 2.7.4 >=20 >=20