From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0106C433F5 for ; Thu, 3 Feb 2022 11:32:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350235AbiBCLci (ORCPT ); Thu, 3 Feb 2022 06:32:38 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44451 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242857AbiBCLch (ORCPT ); Thu, 3 Feb 2022 06:32:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643887956; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=itWiruytU2kLGOGapHpMQOUeYdsg6uAbojfcTpmhA2E=; b=TbI7e/nlDzsEU3kHhROZ8iXIB2Tf0jx5o8VMrkc8Of31Ihru2HVJWQI6gs8DvnN8ttwi7M p9IjKYiX3P/Dc0QqFOmVqXP9HNWBYdF+pclEbYDQ6wN8WyrTKVMbFjoBFq5BQu70rakZpG 2tzM/J3pkjGCZn1HEg1UQ9YHMLSeSgw= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-670-hcx4XKbxOPW6cEycXh4z_A-1; Thu, 03 Feb 2022 06:32:35 -0500 X-MC-Unique: hcx4XKbxOPW6cEycXh4z_A-1 Received: by mail-wr1-f71.google.com with SMTP id k7-20020adfb347000000b001dd761d46c7so552568wrd.4 for ; Thu, 03 Feb 2022 03:32:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=itWiruytU2kLGOGapHpMQOUeYdsg6uAbojfcTpmhA2E=; b=Cioj5c/WrRt4liLUB+ZNOSZQ1Fh4IPLSv6jREmwgs97T+2c3rQ0evjCV/1PGhdblyx y4SQTLp9BGi2mHj1S5PRbCIJ1UOmglkB6MoKQ8JhlccZpsRkB2OITS7pcf56TrgWuXFP 98lKBfARMRCEu6FEzgq6MCaxu8Ui1ybPurn8ja+zgnnhZjbaS59RDcZwYKdEKrcrKn8f GCCnok6K84tzgx78XF6L4wbaoLX9Oy9Ny70Yp/sCafX6L/lzFRavAGs7Sn1UCO88+qCF HRRFLP9zCjz7jllGYmAoocZ7CjRKfVeCek2pVjuvOR1JWYffhztopsWEed61jJRgAC9Z Z3Cg== X-Gm-Message-State: AOAM531jpcskAkcdZV7L5NT+dMeL/4Mlysne0Jg0doWTUgsxXKfHrmzl YidUS5mHZ9NfvNDWAWsA+GbrxFI70UxlLELN5A0883MjQJhrCSoTc3gmXoMdS6lBzD2f8ettu2L 6jnk1hMLoW734I85rVqr+3oyN X-Received: by 2002:a5d:588e:: with SMTP id n14mr30777354wrf.45.1643887954389; Thu, 03 Feb 2022 03:32:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzdLaO64Cw0scAK+697PXreQjSocOclVGkxGWknz3mN3YgqgeWd6Q25NgJrPtGirlAqR87WZw== X-Received: by 2002:a5d:588e:: with SMTP id n14mr30777336wrf.45.1643887954184; Thu, 03 Feb 2022 03:32:34 -0800 (PST) Received: from redhat.com ([2.52.9.182]) by smtp.gmail.com with ESMTPSA id bg23sm8886500wmb.5.2022.02.03.03.32.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 03:32:33 -0800 (PST) Date: Thu, 3 Feb 2022 06:32:29 -0500 From: "Michael S. Tsirkin" To: Cristian Marussi Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, sudeep.holla@arm.com, james.quinlan@broadcom.com, Jonathan.Cameron@huawei.com, f.fainelli@gmail.com, etienne.carriere@linaro.org, vincent.guittot@linaro.org, souvik.chakravarty@arm.com, peter.hilber@opensynergy.com, igor.skalkin@opensynergy.com, virtualization@lists.linux-foundation.org Subject: Re: [PATCH v2 3/9] [RFC] virtio_ring: Embed a wrap counter in opaque poll index value Message-ID: <20220203063115-mutt-send-email-mst@kernel.org> References: <20220201171601.53316-1-cristian.marussi@arm.com> <20220201171601.53316-4-cristian.marussi@arm.com> <20220201131434-mutt-send-email-mst@kernel.org> <20220203105105.GB2535@e120937-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220203105105.GB2535@e120937-lin> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 03, 2022 at 10:51:19AM +0000, Cristian Marussi wrote: > On Tue, Feb 01, 2022 at 01:27:38PM -0500, Michael S. Tsirkin wrote: > > Looks correct, thanks. Some minor comments below: > > > > Hi Michael, > > thanks for the feedback. > > > On Tue, Feb 01, 2022 at 05:15:55PM +0000, Cristian Marussi wrote: > > > Exported API virtqueue_poll() can be used to support polling mode operation > > > on top of virtio layer if needed; currently the parameter last_used_idx is > > > the opaque value that needs to be passed to the virtqueue_poll() function > > > to check if there are new pending used buffers in the queue: such opaque > > > value would have been previously obtained by a call to the API function > > > virtqueue_enable_cb_prepare(). > > > > > > Since such opaque value is indeed containing simply a snapshot in time of > > > the internal > > > > to add: 16 bit > > > > > last_used_index (roughly), it is possible that, > > > > to add here: > > > > if another thread calls virtqueue_add_*() > > at the same time (which existing drivers don't do, > > but does not seem to be documented as prohibited anywhere), and > > > > > if exactly > > > 2**16 buffers are marked as used between two successive calls to > > > virtqueue_poll(), the caller is fooled into thinking that nothing is > > > pending (ABA problem). > > > Keep a full fledged internal wraps counter > > > > s/full fledged/a 16 bit/ > > > > since I don't see why is a 16 bit counter full but not e.g. a 32 bit one > > > .. :D I wanted to stress the fact that this being a 16bits counter has a > higher rollover than a 1-bit one wrap_counter already used...but indeed > all are just counters at the end, it's justthe wrapround that changes... > > I'll fix. > > > > per virtqueue and embed it into > > > the upper 16bits of the returned opaque value, so that the above scenario > > > can be detected transparently by virtqueue_poll(): this way each single > > > possible last_used_idx value is really belonging to a different wrap. > > > > Just to add here: the ABA problem can in theory still happen but > > now that's after 2^32 requests, which seems sufficient in practice. > > > > Sure, I'll fix the commit message as above advised. > > > > Cc: "Michael S. Tsirkin" > > > Cc: Igor Skalkin > > > Cc: Peter Hilber > > > Cc: virtualization@lists.linux-foundation.org > > > Signed-off-by: Cristian Marussi > > > --- > > > Still no perf data on this, I was wondering what exactly to measure in > > > term of perf metrics to evaluate the impact of the rolling vq->wraps > > > counter. > > > --- > > > drivers/virtio/virtio_ring.c | 51 +++++++++++++++++++++++++++++++++--- > > > 1 file changed, 47 insertions(+), 4 deletions(-) > > > > > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > > > index 00f64f2f8b72..613ec0503509 100644 > > > --- a/drivers/virtio/virtio_ring.c > > > +++ b/drivers/virtio/virtio_ring.c > > > @@ -12,6 +12,8 @@ > > > #include > > > #include > > > #include > > > +#include > > > +#include > > > #include > > > > > > static bool force_used_validation = false; > > > @@ -69,6 +71,17 @@ module_param(force_used_validation, bool, 0444); > > > #define LAST_ADD_TIME_INVALID(vq) > > > #endif > > > > > > +#define VRING_IDX_MASK GENMASK(15, 0) > > > +#define VRING_GET_IDX(opaque) \ > > > + ((u16)FIELD_GET(VRING_IDX_MASK, (opaque))) > > > + > > > +#define VRING_WRAPS_MASK GENMASK(31, 16) > > > +#define VRING_GET_WRAPS(opaque) \ > > > + ((u16)FIELD_GET(VRING_WRAPS_MASK, (opaque))) > > > + > > > +#define VRING_BUILD_OPAQUE(idx, wraps) \ > > > + (FIELD_PREP(VRING_WRAPS_MASK, (wraps)) | ((idx) & VRING_IDX_MASK)) > > > + > > > > Maybe prefix with VRING_POLL_ since that is the only user. > > > > I'll do. > > > > > > struct vring_desc_state_split { > > > void *data; /* Data for callback. */ > > > struct vring_desc *indir_desc; /* Indirect descriptor, if any. */ > > > @@ -117,6 +130,8 @@ struct vring_virtqueue { > > > /* Last used index we've seen. */ > > > u16 last_used_idx; > > > > > > + u16 wraps; > > > + > > > /* Hint for event idx: already triggered no need to disable. */ > > > bool event_triggered; > > > > > > @@ -806,6 +821,8 @@ static void *virtqueue_get_buf_ctx_split(struct virtqueue *_vq, > > > ret = vq->split.desc_state[i].data; > > > detach_buf_split(vq, i, ctx); > > > vq->last_used_idx++; > > > + if (unlikely(!vq->last_used_idx)) > > > + vq->wraps++; > > > /* If we expect an interrupt for the next entry, tell host > > > * by writing event index and flush out the write before > > > * the read in the next get_buf call. */ > > > > So most drivers don't call virtqueue_poll. > > Concerned about the overhead here: another option is > > with a flag that will have to be set whenever a driver > > wants to use virtqueue_poll. > > Do you mean a compile time flag/Kconfig to just remove the possible > overhead instructions as a whole when not needed by the driver ? > > Or do you mean at runtime since checking the flag evry time should be > less costly than checking the wrpas each time AND counting when it > happens ? The later. > > Could you pls do a quick perf test e.g. using tools/virtio/ > > to see what's faster? > > Yes I'll do, thanks for the hint, I have some compilation issues in > tools/virtio due to my additions (missing mirrored hehaders) or to some > recently added stuff (missing drv_to_virtio & friends for > suppressed_used_validation thing)...anyway I fixed those now and I'll > post related tools/virtio patches with next iteration. > > Anyway, do you mean perf data about vringh_test and virtio_test/vhost > right ? (ringtest/ excluded 'cause does not use any API is just > prototyping) can be either or both, virtio_test/vhost is a bit easier to use. > > > > > > > > > @@ -1508,6 +1525,7 @@ static void *virtqueue_get_buf_ctx_packed(struct virtqueue *_vq, > > > if (unlikely(vq->last_used_idx >= vq->packed.vring.num)) { > > > vq->last_used_idx -= vq->packed.vring.num; > > > vq->packed.used_wrap_counter ^= 1; > > > + vq->wraps++; > > > } > > > > > > /* > > > @@ -1744,6 +1762,7 @@ static struct virtqueue *vring_create_virtqueue_packed( > > > vq->weak_barriers = weak_barriers; > > > vq->broken = false; > > > vq->last_used_idx = 0; > > > + vq->wraps = 0; > > > vq->event_triggered = false; > > > vq->num_added = 0; > > > vq->packed_ring = true; > > > @@ -2092,13 +2111,17 @@ EXPORT_SYMBOL_GPL(virtqueue_disable_cb); > > > */ > > > unsigned virtqueue_enable_cb_prepare(struct virtqueue *_vq) > > > { > > > + unsigned int last_used_idx; > > > struct vring_virtqueue *vq = to_vvq(_vq); > > > > > > if (vq->event_triggered) > > > vq->event_triggered = false; > > > > > > - return vq->packed_ring ? virtqueue_enable_cb_prepare_packed(_vq) : > > > - virtqueue_enable_cb_prepare_split(_vq); > > > + last_used_idx = vq->packed_ring ? > > > + virtqueue_enable_cb_prepare_packed(_vq) : > > > + virtqueue_enable_cb_prepare_split(_vq); > > > + > > > + return VRING_BUILD_OPAQUE(last_used_idx, vq->wraps); > > > } > > > EXPORT_SYMBOL_GPL(virtqueue_enable_cb_prepare); > > > > > > @@ -2107,6 +2130,21 @@ EXPORT_SYMBOL_GPL(virtqueue_enable_cb_prepare); > > > * @_vq: the struct virtqueue we're talking about. > > > * @last_used_idx: virtqueue state (from call to virtqueue_enable_cb_prepare). > > > * > > > + * The provided last_used_idx, as returned by virtqueue_enable_cb_prepare(), > > > + * is an opaque value representing the queue state and it is built as follows: > > > + * > > > + * --------------------------------------------------------- > > > + * | vq->wraps | vq->last_used_idx | > > > + * 31------------------------------------------------------0 > > > + * > > > + * The MSB 16bits embedding the wraps counter for the underlying virtqueue > > > + * is stripped out here before reaching into the lower layer helpers. > > > + * > > > + * This structure of the opaque value mitigates the scenario in which, when > > > + * exactly 2**16 messages are marked as used between two successive calls to > > > + * virtqueue_poll(), the caller is fooled into thinking nothing new has arrived > > > + * since the pure last_used_idx is exactly the same. > > > + * > > > > Do you want to move this comment to where the macros implementing it > > are? > > > > Sure, I'll do. > > Thanks, > Cristian From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 88B83C433EF for ; Thu, 3 Feb 2022 11:32:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 27E1460FD8; Thu, 3 Feb 2022 11:32:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q-oyYRypLP_C; Thu, 3 Feb 2022 11:32:41 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 767C360774; Thu, 3 Feb 2022 11:32:40 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4CD05C001A; Thu, 3 Feb 2022 11:32:40 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id E85F3C000B for ; Thu, 3 Feb 2022 11:32:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id CFAB584060 for ; Thu, 3 Feb 2022 11:32:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cEHRCN4RGmxM for ; Thu, 3 Feb 2022 11:32:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id D676E84059 for ; Thu, 3 Feb 2022 11:32:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643887956; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=itWiruytU2kLGOGapHpMQOUeYdsg6uAbojfcTpmhA2E=; b=TbI7e/nlDzsEU3kHhROZ8iXIB2Tf0jx5o8VMrkc8Of31Ihru2HVJWQI6gs8DvnN8ttwi7M p9IjKYiX3P/Dc0QqFOmVqXP9HNWBYdF+pclEbYDQ6wN8WyrTKVMbFjoBFq5BQu70rakZpG 2tzM/J3pkjGCZn1HEg1UQ9YHMLSeSgw= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-670-XEc_6PH2OiqlyvRtN-_-cg-1; Thu, 03 Feb 2022 06:32:35 -0500 X-MC-Unique: XEc_6PH2OiqlyvRtN-_-cg-1 Received: by mail-wm1-f69.google.com with SMTP id m20-20020a05600c3b1400b003539593ea39so663464wms.0 for ; Thu, 03 Feb 2022 03:32:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=itWiruytU2kLGOGapHpMQOUeYdsg6uAbojfcTpmhA2E=; b=7jMG68r4QDZDZ97CH6tcfzJIuKcY5M7E4qndnI357gjIGxX2O1n0rSt9urv0F5zlWP zARw99OwvScA55+oeDw/I23wSSWdqJFVBG1zP5IPdwFwC0VLHY7LxVga9LHxPaeBnp8T zRtQgMeZs7S+uhcnKFMuM6KCCiLzyDU3daagOV7Xr2YRXc2rPs74ftvgRRqaRoZAZZ7B 3pCywA5ELL9lJ4aw6T7xLh5w1PkhUEPQECfqhJuE9niolSvv4uiQ/I62hnNkNPFMLw8N COISlKU+qhUuubk2UqlI0+6PUJkmEdhRf3e2IXJAeDcPnjKQbbKIKV/EIKgyoJzPma4x Wvig== X-Gm-Message-State: AOAM530TD3TFV83bu2jC0g6X2dkWM7mdDfFM8XdAn3cBjlnNgqA+kYez h+HlHiuNBZs/Jk/6acsVC3859SPLFwk/E92sugZP9lfE1BYYoDq14ivovoKfiM8Bu7y2tQBiz6M ulNoPe1JmHR3vJfZRUfDtb7x4mN6/jhKsGZ9/wmBRAw== X-Received: by 2002:a5d:588e:: with SMTP id n14mr30777351wrf.45.1643887954390; Thu, 03 Feb 2022 03:32:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzdLaO64Cw0scAK+697PXreQjSocOclVGkxGWknz3mN3YgqgeWd6Q25NgJrPtGirlAqR87WZw== X-Received: by 2002:a5d:588e:: with SMTP id n14mr30777336wrf.45.1643887954184; Thu, 03 Feb 2022 03:32:34 -0800 (PST) Received: from redhat.com ([2.52.9.182]) by smtp.gmail.com with ESMTPSA id bg23sm8886500wmb.5.2022.02.03.03.32.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 03:32:33 -0800 (PST) Date: Thu, 3 Feb 2022 06:32:29 -0500 From: "Michael S. Tsirkin" To: Cristian Marussi Subject: Re: [PATCH v2 3/9] [RFC] virtio_ring: Embed a wrap counter in opaque poll index value Message-ID: <20220203063115-mutt-send-email-mst@kernel.org> References: <20220201171601.53316-1-cristian.marussi@arm.com> <20220201171601.53316-4-cristian.marussi@arm.com> <20220201131434-mutt-send-email-mst@kernel.org> <20220203105105.GB2535@e120937-lin> MIME-Version: 1.0 In-Reply-To: <20220203105105.GB2535@e120937-lin> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Cc: f.fainelli@gmail.com, vincent.guittot@linaro.org, igor.skalkin@opensynergy.com, sudeep.holla@arm.com, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, peter.hilber@opensynergy.com, james.quinlan@broadcom.com, Jonathan.Cameron@huawei.com, souvik.chakravarty@arm.com, etienne.carriere@linaro.org, linux-arm-kernel@lists.infradead.org X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On Thu, Feb 03, 2022 at 10:51:19AM +0000, Cristian Marussi wrote: > On Tue, Feb 01, 2022 at 01:27:38PM -0500, Michael S. Tsirkin wrote: > > Looks correct, thanks. Some minor comments below: > > > > Hi Michael, > > thanks for the feedback. > > > On Tue, Feb 01, 2022 at 05:15:55PM +0000, Cristian Marussi wrote: > > > Exported API virtqueue_poll() can be used to support polling mode operation > > > on top of virtio layer if needed; currently the parameter last_used_idx is > > > the opaque value that needs to be passed to the virtqueue_poll() function > > > to check if there are new pending used buffers in the queue: such opaque > > > value would have been previously obtained by a call to the API function > > > virtqueue_enable_cb_prepare(). > > > > > > Since such opaque value is indeed containing simply a snapshot in time of > > > the internal > > > > to add: 16 bit > > > > > last_used_index (roughly), it is possible that, > > > > to add here: > > > > if another thread calls virtqueue_add_*() > > at the same time (which existing drivers don't do, > > but does not seem to be documented as prohibited anywhere), and > > > > > if exactly > > > 2**16 buffers are marked as used between two successive calls to > > > virtqueue_poll(), the caller is fooled into thinking that nothing is > > > pending (ABA problem). > > > Keep a full fledged internal wraps counter > > > > s/full fledged/a 16 bit/ > > > > since I don't see why is a 16 bit counter full but not e.g. a 32 bit one > > > .. :D I wanted to stress the fact that this being a 16bits counter has a > higher rollover than a 1-bit one wrap_counter already used...but indeed > all are just counters at the end, it's justthe wrapround that changes... > > I'll fix. > > > > per virtqueue and embed it into > > > the upper 16bits of the returned opaque value, so that the above scenario > > > can be detected transparently by virtqueue_poll(): this way each single > > > possible last_used_idx value is really belonging to a different wrap. > > > > Just to add here: the ABA problem can in theory still happen but > > now that's after 2^32 requests, which seems sufficient in practice. > > > > Sure, I'll fix the commit message as above advised. > > > > Cc: "Michael S. Tsirkin" > > > Cc: Igor Skalkin > > > Cc: Peter Hilber > > > Cc: virtualization@lists.linux-foundation.org > > > Signed-off-by: Cristian Marussi > > > --- > > > Still no perf data on this, I was wondering what exactly to measure in > > > term of perf metrics to evaluate the impact of the rolling vq->wraps > > > counter. > > > --- > > > drivers/virtio/virtio_ring.c | 51 +++++++++++++++++++++++++++++++++--- > > > 1 file changed, 47 insertions(+), 4 deletions(-) > > > > > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > > > index 00f64f2f8b72..613ec0503509 100644 > > > --- a/drivers/virtio/virtio_ring.c > > > +++ b/drivers/virtio/virtio_ring.c > > > @@ -12,6 +12,8 @@ > > > #include > > > #include > > > #include > > > +#include > > > +#include > > > #include > > > > > > static bool force_used_validation = false; > > > @@ -69,6 +71,17 @@ module_param(force_used_validation, bool, 0444); > > > #define LAST_ADD_TIME_INVALID(vq) > > > #endif > > > > > > +#define VRING_IDX_MASK GENMASK(15, 0) > > > +#define VRING_GET_IDX(opaque) \ > > > + ((u16)FIELD_GET(VRING_IDX_MASK, (opaque))) > > > + > > > +#define VRING_WRAPS_MASK GENMASK(31, 16) > > > +#define VRING_GET_WRAPS(opaque) \ > > > + ((u16)FIELD_GET(VRING_WRAPS_MASK, (opaque))) > > > + > > > +#define VRING_BUILD_OPAQUE(idx, wraps) \ > > > + (FIELD_PREP(VRING_WRAPS_MASK, (wraps)) | ((idx) & VRING_IDX_MASK)) > > > + > > > > Maybe prefix with VRING_POLL_ since that is the only user. > > > > I'll do. > > > > > > struct vring_desc_state_split { > > > void *data; /* Data for callback. */ > > > struct vring_desc *indir_desc; /* Indirect descriptor, if any. */ > > > @@ -117,6 +130,8 @@ struct vring_virtqueue { > > > /* Last used index we've seen. */ > > > u16 last_used_idx; > > > > > > + u16 wraps; > > > + > > > /* Hint for event idx: already triggered no need to disable. */ > > > bool event_triggered; > > > > > > @@ -806,6 +821,8 @@ static void *virtqueue_get_buf_ctx_split(struct virtqueue *_vq, > > > ret = vq->split.desc_state[i].data; > > > detach_buf_split(vq, i, ctx); > > > vq->last_used_idx++; > > > + if (unlikely(!vq->last_used_idx)) > > > + vq->wraps++; > > > /* If we expect an interrupt for the next entry, tell host > > > * by writing event index and flush out the write before > > > * the read in the next get_buf call. */ > > > > So most drivers don't call virtqueue_poll. > > Concerned about the overhead here: another option is > > with a flag that will have to be set whenever a driver > > wants to use virtqueue_poll. > > Do you mean a compile time flag/Kconfig to just remove the possible > overhead instructions as a whole when not needed by the driver ? > > Or do you mean at runtime since checking the flag evry time should be > less costly than checking the wrpas each time AND counting when it > happens ? The later. > > Could you pls do a quick perf test e.g. using tools/virtio/ > > to see what's faster? > > Yes I'll do, thanks for the hint, I have some compilation issues in > tools/virtio due to my additions (missing mirrored hehaders) or to some > recently added stuff (missing drv_to_virtio & friends for > suppressed_used_validation thing)...anyway I fixed those now and I'll > post related tools/virtio patches with next iteration. > > Anyway, do you mean perf data about vringh_test and virtio_test/vhost > right ? (ringtest/ excluded 'cause does not use any API is just > prototyping) can be either or both, virtio_test/vhost is a bit easier to use. > > > > > > > > > @@ -1508,6 +1525,7 @@ static void *virtqueue_get_buf_ctx_packed(struct virtqueue *_vq, > > > if (unlikely(vq->last_used_idx >= vq->packed.vring.num)) { > > > vq->last_used_idx -= vq->packed.vring.num; > > > vq->packed.used_wrap_counter ^= 1; > > > + vq->wraps++; > > > } > > > > > > /* > > > @@ -1744,6 +1762,7 @@ static struct virtqueue *vring_create_virtqueue_packed( > > > vq->weak_barriers = weak_barriers; > > > vq->broken = false; > > > vq->last_used_idx = 0; > > > + vq->wraps = 0; > > > vq->event_triggered = false; > > > vq->num_added = 0; > > > vq->packed_ring = true; > > > @@ -2092,13 +2111,17 @@ EXPORT_SYMBOL_GPL(virtqueue_disable_cb); > > > */ > > > unsigned virtqueue_enable_cb_prepare(struct virtqueue *_vq) > > > { > > > + unsigned int last_used_idx; > > > struct vring_virtqueue *vq = to_vvq(_vq); > > > > > > if (vq->event_triggered) > > > vq->event_triggered = false; > > > > > > - return vq->packed_ring ? virtqueue_enable_cb_prepare_packed(_vq) : > > > - virtqueue_enable_cb_prepare_split(_vq); > > > + last_used_idx = vq->packed_ring ? > > > + virtqueue_enable_cb_prepare_packed(_vq) : > > > + virtqueue_enable_cb_prepare_split(_vq); > > > + > > > + return VRING_BUILD_OPAQUE(last_used_idx, vq->wraps); > > > } > > > EXPORT_SYMBOL_GPL(virtqueue_enable_cb_prepare); > > > > > > @@ -2107,6 +2130,21 @@ EXPORT_SYMBOL_GPL(virtqueue_enable_cb_prepare); > > > * @_vq: the struct virtqueue we're talking about. > > > * @last_used_idx: virtqueue state (from call to virtqueue_enable_cb_prepare). > > > * > > > + * The provided last_used_idx, as returned by virtqueue_enable_cb_prepare(), > > > + * is an opaque value representing the queue state and it is built as follows: > > > + * > > > + * --------------------------------------------------------- > > > + * | vq->wraps | vq->last_used_idx | > > > + * 31------------------------------------------------------0 > > > + * > > > + * The MSB 16bits embedding the wraps counter for the underlying virtqueue > > > + * is stripped out here before reaching into the lower layer helpers. > > > + * > > > + * This structure of the opaque value mitigates the scenario in which, when > > > + * exactly 2**16 messages are marked as used between two successive calls to > > > + * virtqueue_poll(), the caller is fooled into thinking nothing new has arrived > > > + * since the pure last_used_idx is exactly the same. > > > + * > > > > Do you want to move this comment to where the macros implementing it > > are? > > > > Sure, I'll do. > > Thanks, > Cristian _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2F777C433F5 for ; Thu, 3 Feb 2022 11:34:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=co7lGaI4XcQKoZrQTN2bOGgDBZ56c8mrAQ2NYTDQaFA=; b=VJh7fjhIeaE/31 53YAcLJCLvh7R1/V/YLeVOLlOyakp3sCjly9qZwskl0aHaipZAC54BMI6xLBAsDIOZDgV33gJl+Ah LETsZXV0waJALphtQsKIgcZK6YSIZf+5GI1YZFBPTYcLHSVCGwihzNdbhxiSdARy78fe0P1NH8QbR mENcgxXsDMaYrFmcPiFJyn60Rqks0eJil3fL07HWkHe8wB0n4fDCOlaQz2gtnuEtEdneoC2ctbByI vI9xAKgAcfu0Lqlzg7lHVhmHJGbbKF1cRRQKb2iuzwf2Eys3HD0OFTk0n6ITIk2+ApKhb5nThzCRY +WAj+CkWkjpqJQ4H8SoA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFaM0-000zeJ-Ex; Thu, 03 Feb 2022 11:32:44 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFaLv-000zcE-Ki for linux-arm-kernel@lists.infradead.org; Thu, 03 Feb 2022 11:32:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643887956; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=itWiruytU2kLGOGapHpMQOUeYdsg6uAbojfcTpmhA2E=; b=TbI7e/nlDzsEU3kHhROZ8iXIB2Tf0jx5o8VMrkc8Of31Ihru2HVJWQI6gs8DvnN8ttwi7M p9IjKYiX3P/Dc0QqFOmVqXP9HNWBYdF+pclEbYDQ6wN8WyrTKVMbFjoBFq5BQu70rakZpG 2tzM/J3pkjGCZn1HEg1UQ9YHMLSeSgw= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-622-YaIV5ty0NpO7GalTVrSKTg-1; Thu, 03 Feb 2022 06:32:35 -0500 X-MC-Unique: YaIV5ty0NpO7GalTVrSKTg-1 Received: by mail-wm1-f70.google.com with SMTP id v190-20020a1cacc7000000b0034657bb6a66so640186wme.6 for ; Thu, 03 Feb 2022 03:32:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=itWiruytU2kLGOGapHpMQOUeYdsg6uAbojfcTpmhA2E=; b=7SI1yRsesOggPhOkU11V1Ca90X4enpwwobHPaz7rfhtqszWFEJZY6Jy6XuLHphFZwe LnEBNJSa/UC9CZ5Hf4Iw77jsC/HU7ebAOkutemvXmBvEczhJE4mr/tiJTHchc3N/qIjM db/WpGdPlseEzU4hClYGyBTQt0TPrYRCO5oZ6a5yEPs7Pvg8KzyaFCXupRu/hI9BoUx9 mLUScXGiRUN8rKq3TNLTfDGYDdnQAo5zETAK7GIKdoidylvvWdlGIovQay1ubW2lQWz5 GZe/NaX9Ev4UkDTJqTONbIBjdEUHkAJkxYdqjCjkf77M91QrCZHIogTm+eNemmkqAsIa sAAA== X-Gm-Message-State: AOAM533oJFoiwpxL/5b21f25BCiZRL3Tk0HTaTE9BxDBpcQN8myRQwdV yAjwL9/plbAWSTqP4Ju6mMX4/xWza6nX9Nfv0pE78kztC0MX+e8VDwf7vhxtgzKvU39Nk3+x3Gb Ing5zXOVJTIi3hbazZX7f5yyP34UKXmmNJzs= X-Received: by 2002:a5d:588e:: with SMTP id n14mr30777356wrf.45.1643887954389; Thu, 03 Feb 2022 03:32:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzdLaO64Cw0scAK+697PXreQjSocOclVGkxGWknz3mN3YgqgeWd6Q25NgJrPtGirlAqR87WZw== X-Received: by 2002:a5d:588e:: with SMTP id n14mr30777336wrf.45.1643887954184; Thu, 03 Feb 2022 03:32:34 -0800 (PST) Received: from redhat.com ([2.52.9.182]) by smtp.gmail.com with ESMTPSA id bg23sm8886500wmb.5.2022.02.03.03.32.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 03:32:33 -0800 (PST) Date: Thu, 3 Feb 2022 06:32:29 -0500 From: "Michael S. Tsirkin" To: Cristian Marussi Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, sudeep.holla@arm.com, james.quinlan@broadcom.com, Jonathan.Cameron@huawei.com, f.fainelli@gmail.com, etienne.carriere@linaro.org, vincent.guittot@linaro.org, souvik.chakravarty@arm.com, peter.hilber@opensynergy.com, igor.skalkin@opensynergy.com, virtualization@lists.linux-foundation.org Subject: Re: [PATCH v2 3/9] [RFC] virtio_ring: Embed a wrap counter in opaque poll index value Message-ID: <20220203063115-mutt-send-email-mst@kernel.org> References: <20220201171601.53316-1-cristian.marussi@arm.com> <20220201171601.53316-4-cristian.marussi@arm.com> <20220201131434-mutt-send-email-mst@kernel.org> <20220203105105.GB2535@e120937-lin> MIME-Version: 1.0 In-Reply-To: <20220203105105.GB2535@e120937-lin> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220203_033239_806120_4C3A7444 X-CRM114-Status: GOOD ( 60.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Feb 03, 2022 at 10:51:19AM +0000, Cristian Marussi wrote: > On Tue, Feb 01, 2022 at 01:27:38PM -0500, Michael S. Tsirkin wrote: > > Looks correct, thanks. Some minor comments below: > > > > Hi Michael, > > thanks for the feedback. > > > On Tue, Feb 01, 2022 at 05:15:55PM +0000, Cristian Marussi wrote: > > > Exported API virtqueue_poll() can be used to support polling mode operation > > > on top of virtio layer if needed; currently the parameter last_used_idx is > > > the opaque value that needs to be passed to the virtqueue_poll() function > > > to check if there are new pending used buffers in the queue: such opaque > > > value would have been previously obtained by a call to the API function > > > virtqueue_enable_cb_prepare(). > > > > > > Since such opaque value is indeed containing simply a snapshot in time of > > > the internal > > > > to add: 16 bit > > > > > last_used_index (roughly), it is possible that, > > > > to add here: > > > > if another thread calls virtqueue_add_*() > > at the same time (which existing drivers don't do, > > but does not seem to be documented as prohibited anywhere), and > > > > > if exactly > > > 2**16 buffers are marked as used between two successive calls to > > > virtqueue_poll(), the caller is fooled into thinking that nothing is > > > pending (ABA problem). > > > Keep a full fledged internal wraps counter > > > > s/full fledged/a 16 bit/ > > > > since I don't see why is a 16 bit counter full but not e.g. a 32 bit one > > > .. :D I wanted to stress the fact that this being a 16bits counter has a > higher rollover than a 1-bit one wrap_counter already used...but indeed > all are just counters at the end, it's justthe wrapround that changes... > > I'll fix. > > > > per virtqueue and embed it into > > > the upper 16bits of the returned opaque value, so that the above scenario > > > can be detected transparently by virtqueue_poll(): this way each single > > > possible last_used_idx value is really belonging to a different wrap. > > > > Just to add here: the ABA problem can in theory still happen but > > now that's after 2^32 requests, which seems sufficient in practice. > > > > Sure, I'll fix the commit message as above advised. > > > > Cc: "Michael S. Tsirkin" > > > Cc: Igor Skalkin > > > Cc: Peter Hilber > > > Cc: virtualization@lists.linux-foundation.org > > > Signed-off-by: Cristian Marussi > > > --- > > > Still no perf data on this, I was wondering what exactly to measure in > > > term of perf metrics to evaluate the impact of the rolling vq->wraps > > > counter. > > > --- > > > drivers/virtio/virtio_ring.c | 51 +++++++++++++++++++++++++++++++++--- > > > 1 file changed, 47 insertions(+), 4 deletions(-) > > > > > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > > > index 00f64f2f8b72..613ec0503509 100644 > > > --- a/drivers/virtio/virtio_ring.c > > > +++ b/drivers/virtio/virtio_ring.c > > > @@ -12,6 +12,8 @@ > > > #include > > > #include > > > #include > > > +#include > > > +#include > > > #include > > > > > > static bool force_used_validation = false; > > > @@ -69,6 +71,17 @@ module_param(force_used_validation, bool, 0444); > > > #define LAST_ADD_TIME_INVALID(vq) > > > #endif > > > > > > +#define VRING_IDX_MASK GENMASK(15, 0) > > > +#define VRING_GET_IDX(opaque) \ > > > + ((u16)FIELD_GET(VRING_IDX_MASK, (opaque))) > > > + > > > +#define VRING_WRAPS_MASK GENMASK(31, 16) > > > +#define VRING_GET_WRAPS(opaque) \ > > > + ((u16)FIELD_GET(VRING_WRAPS_MASK, (opaque))) > > > + > > > +#define VRING_BUILD_OPAQUE(idx, wraps) \ > > > + (FIELD_PREP(VRING_WRAPS_MASK, (wraps)) | ((idx) & VRING_IDX_MASK)) > > > + > > > > Maybe prefix with VRING_POLL_ since that is the only user. > > > > I'll do. > > > > > > struct vring_desc_state_split { > > > void *data; /* Data for callback. */ > > > struct vring_desc *indir_desc; /* Indirect descriptor, if any. */ > > > @@ -117,6 +130,8 @@ struct vring_virtqueue { > > > /* Last used index we've seen. */ > > > u16 last_used_idx; > > > > > > + u16 wraps; > > > + > > > /* Hint for event idx: already triggered no need to disable. */ > > > bool event_triggered; > > > > > > @@ -806,6 +821,8 @@ static void *virtqueue_get_buf_ctx_split(struct virtqueue *_vq, > > > ret = vq->split.desc_state[i].data; > > > detach_buf_split(vq, i, ctx); > > > vq->last_used_idx++; > > > + if (unlikely(!vq->last_used_idx)) > > > + vq->wraps++; > > > /* If we expect an interrupt for the next entry, tell host > > > * by writing event index and flush out the write before > > > * the read in the next get_buf call. */ > > > > So most drivers don't call virtqueue_poll. > > Concerned about the overhead here: another option is > > with a flag that will have to be set whenever a driver > > wants to use virtqueue_poll. > > Do you mean a compile time flag/Kconfig to just remove the possible > overhead instructions as a whole when not needed by the driver ? > > Or do you mean at runtime since checking the flag evry time should be > less costly than checking the wrpas each time AND counting when it > happens ? The later. > > Could you pls do a quick perf test e.g. using tools/virtio/ > > to see what's faster? > > Yes I'll do, thanks for the hint, I have some compilation issues in > tools/virtio due to my additions (missing mirrored hehaders) or to some > recently added stuff (missing drv_to_virtio & friends for > suppressed_used_validation thing)...anyway I fixed those now and I'll > post related tools/virtio patches with next iteration. > > Anyway, do you mean perf data about vringh_test and virtio_test/vhost > right ? (ringtest/ excluded 'cause does not use any API is just > prototyping) can be either or both, virtio_test/vhost is a bit easier to use. > > > > > > > > > @@ -1508,6 +1525,7 @@ static void *virtqueue_get_buf_ctx_packed(struct virtqueue *_vq, > > > if (unlikely(vq->last_used_idx >= vq->packed.vring.num)) { > > > vq->last_used_idx -= vq->packed.vring.num; > > > vq->packed.used_wrap_counter ^= 1; > > > + vq->wraps++; > > > } > > > > > > /* > > > @@ -1744,6 +1762,7 @@ static struct virtqueue *vring_create_virtqueue_packed( > > > vq->weak_barriers = weak_barriers; > > > vq->broken = false; > > > vq->last_used_idx = 0; > > > + vq->wraps = 0; > > > vq->event_triggered = false; > > > vq->num_added = 0; > > > vq->packed_ring = true; > > > @@ -2092,13 +2111,17 @@ EXPORT_SYMBOL_GPL(virtqueue_disable_cb); > > > */ > > > unsigned virtqueue_enable_cb_prepare(struct virtqueue *_vq) > > > { > > > + unsigned int last_used_idx; > > > struct vring_virtqueue *vq = to_vvq(_vq); > > > > > > if (vq->event_triggered) > > > vq->event_triggered = false; > > > > > > - return vq->packed_ring ? virtqueue_enable_cb_prepare_packed(_vq) : > > > - virtqueue_enable_cb_prepare_split(_vq); > > > + last_used_idx = vq->packed_ring ? > > > + virtqueue_enable_cb_prepare_packed(_vq) : > > > + virtqueue_enable_cb_prepare_split(_vq); > > > + > > > + return VRING_BUILD_OPAQUE(last_used_idx, vq->wraps); > > > } > > > EXPORT_SYMBOL_GPL(virtqueue_enable_cb_prepare); > > > > > > @@ -2107,6 +2130,21 @@ EXPORT_SYMBOL_GPL(virtqueue_enable_cb_prepare); > > > * @_vq: the struct virtqueue we're talking about. > > > * @last_used_idx: virtqueue state (from call to virtqueue_enable_cb_prepare). > > > * > > > + * The provided last_used_idx, as returned by virtqueue_enable_cb_prepare(), > > > + * is an opaque value representing the queue state and it is built as follows: > > > + * > > > + * --------------------------------------------------------- > > > + * | vq->wraps | vq->last_used_idx | > > > + * 31------------------------------------------------------0 > > > + * > > > + * The MSB 16bits embedding the wraps counter for the underlying virtqueue > > > + * is stripped out here before reaching into the lower layer helpers. > > > + * > > > + * This structure of the opaque value mitigates the scenario in which, when > > > + * exactly 2**16 messages are marked as used between two successive calls to > > > + * virtqueue_poll(), the caller is fooled into thinking nothing new has arrived > > > + * since the pure last_used_idx is exactly the same. > > > + * > > > > Do you want to move this comment to where the macros implementing it > > are? > > > > Sure, I'll do. > > Thanks, > Cristian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel