From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752285AbdHIEhP (ORCPT ); Wed, 9 Aug 2017 00:37:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56302 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750792AbdHIEhN (ORCPT ); Wed, 9 Aug 2017 00:37:13 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9F4724A700 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=mst@redhat.com Date: Wed, 9 Aug 2017 07:37:11 +0300 From: "Michael S. Tsirkin" To: Jason Wang Cc: "K. Den" , virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] Revert "vhost: cache used event for better performance" Message-ID: <20170809073422-mutt-send-email-mst@kernel.org> References: <1501056197-3368-1-git-send-email-jasowang@redhat.com> <20170726155435-mutt-send-email-mst@kernel.org> <117542fc-eef9-c043-7c9e-daafceb7db4e@redhat.com> <6b3a9a98-c095-1729-3528-dd521f136797@redhat.com> <20170726190745-mutt-send-email-mst@kernel.org> <1501396011.21001.11.camel@klaipeden.com> <6698b85c-18f4-17e6-db70-7708692fb761@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6698b85c-18f4-17e6-db70-7708692fb761@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 09 Aug 2017 04:37:13 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 09, 2017 at 10:38:10AM +0800, Jason Wang wrote: > I think don't think current code can work well if vq.num is grater than > 2^15. Since all cached idx is u16. This looks like a bug which needs to be > fixed. That's a limitation of virtio 1.0. > > * else if the interval of vq.num is [2^15, 2^16): > > the logic in the original patch (809ecb9bca6a9) suffices > > * else (= less than 2^15) (optional): > > checking only (vring_need_event(vq->last_used_event, new + vq->num, new) > > would suffice. > > > > Am I missing something, or is this irrelevant? Could you pls repost the suggestion copying virtio-dev mailing list (subscriber only, sorry about that, but host/guest ABI discussions need to copy that list)? > Looks not, I think this may work. Let me do some test. > > Thanks I think that at this point it's prudent to add a feature bit as the virtio spec does not require to never move the event index back.