From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4FC2CA050B; Thu, 7 Apr 2022 09:04:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E77FF40689; Thu, 7 Apr 2022 09:04:08 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 650584014F for ; Thu, 7 Apr 2022 09:04:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649315046; 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=9RjEtgE/BejVYXPI6S6YHiOfrFxoCklShPUUvz1vivA=; b=Af2mmoYSYhSrCHK98+6YfTtoXuMsdWVYU+21Z1YxKz7qyM23NZ35mbPsv2AsNB/cVtEogJ oSDc1lfVj5lzR1q1QFsFd7QNtz5gj2xS76b8ylPQeNDnCN4xykSbHx2UY1aeRqBb6VRHKq L5/kJy2/QPgyl0V6ykXl+UwdXRPydBc= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-193-V6Db5YI6OdeI7j8KS8xz8Q-1; Thu, 07 Apr 2022 03:04:02 -0400 X-MC-Unique: V6Db5YI6OdeI7j8KS8xz8Q-1 Received: by mail-lj1-f197.google.com with SMTP id s24-20020a2e98d8000000b00249800e5b87so1802867ljj.22 for ; Thu, 07 Apr 2022 00:04:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9RjEtgE/BejVYXPI6S6YHiOfrFxoCklShPUUvz1vivA=; b=WCw1AXWkLby7YufWIh0SaNl+FKFPeGQDSYgTIDIN/VEGk13t3sXR11VNyNvNkNFA2y al8Ub27EfZ/FkoLRnpqSw7hLlo/2Y9HDAD/yLGngYbRUTvfqwJRTRWXcdie4Re/EaCSN RG7XmKFO+HeQbLLPsHajNs07vVmPujNjnC1CdTWkLKQO7OqLYrgNp69++J1J2AsM95UK Ax/2RaEy3EfGt2Md0GW7GgmNgT5fN/eSi3OlIi+rqmVKsVE1odKuP7TBTyQQL5a/6cls ZWLcqaQyOb5nE8Zw3XjCzUvteN8xHmTjIYxffZwMvHqCV/TP1SrAaN+xrYQDScku6saA a/cA== X-Gm-Message-State: AOAM531BmNYTAY/uLYSLqLQiv8PZ0/2OrAFzaKK0uSxoX5H2EGKFhGte 6e0qH3ZzPk/XL+uxF9ZNaLJrGRIL6fabb2wheaxR9GWRYTV8c8txwOuLSIY9MDQktOFbpWKi3DO feSArX11mEk7o8y62i6w= X-Received: by 2002:a2e:864c:0:b0:24b:4c8:d0df with SMTP id i12-20020a2e864c000000b0024b04c8d0dfmr7789400ljj.333.1649315041223; Thu, 07 Apr 2022 00:04:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8Aew+8HN0NiLuPlU3rVhoQf/77bdFCraAhMUejsnm99nSQR1YUq39lGSFqGnrOdCAdEim3/QK5UIVoIAxc0c= X-Received: by 2002:a2e:864c:0:b0:24b:4c8:d0df with SMTP id i12-20020a2e864c000000b0024b04c8d0dfmr7789391ljj.333.1649315041012; Thu, 07 Apr 2022 00:04:01 -0700 (PDT) MIME-Version: 1.0 References: <20220328121758.26632-1-david.marchand@redhat.com> <20220330134956.18927-1-david.marchand@redhat.com> <20220330134956.18927-4-david.marchand@redhat.com> In-Reply-To: From: David Marchand Date: Thu, 7 Apr 2022 09:03:49 +0200 Message-ID: Subject: Re: [RFC PATCH v2 3/9] vhost: annotate virtqueue access lock To: "Hu, Jiayu" Cc: "dev@dpdk.org" , "maxime.coquelin@redhat.com" , "Xia, Chenbo" , "Wang, YuanX" , "Ding, Xuan" Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, Apr 7, 2022 at 3:40 AM Hu, Jiayu wrote: > > diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h index > > a9edc271aa..158460b7d7 100644 > > --- a/lib/vhost/vhost.h > > +++ b/lib/vhost/vhost.h > > @@ -834,6 +834,7 @@ vhost_need_event(uint16_t event_idx, uint16_t > > new_idx, uint16_t old) > > > > static __rte_always_inline void > > vhost_vring_call_split(struct virtio_net *dev, struct vhost_virtqueue *vq) > > + RTE_EXC_LOCK_REQUIRES(vq->access_lock) > > vhost_vring_call_split() is called in rte_vhost_vring_call() too, but it doesn't > acquire vq->access_lock before calling vhost_vring_call_split(). I have some issues with sending patches from other people (Mimecast seems to think I try to impersonate them and strip the content of the mail?). You'll notice the series in patchwork starts at patch 2. https://patchwork.dpdk.org/project/dpdk/list/?series=22292&state=* My intent was to have Maxime fix (already in next-virtio: https://git.dpdk.org/next/dpdk-next-virtio/commit/?id=53d8fffcf8e3c89c9785f8ce50db892f2cdfd7c7) in this series. [snip] > > @@ -1955,11 +1957,11 @@ write_back_completed_descs_packed(struct > > vhost_virtqueue *vq, } > > > > static __rte_always_inline uint16_t > > -vhost_poll_enqueue_completed(struct virtio_net *dev, uint16_t queue_id, > > +vhost_poll_enqueue_completed(struct virtio_net *dev, struct > > +vhost_virtqueue *vq, > > struct rte_mbuf **pkts, uint16_t count, int16_t dma_id, > > uint16_t vchan_id) > > + RTE_EXC_LOCK_REQUIRES(vq->access_lock) > > rte_vhost_clear_queue_thread_unsafe() doesn't acquire vq->access_lock. > Will it cause a compiler warning? Mm, probably a rebase/split error on my side when doing rfc v2. On the other hand I don't think we can enable the check at this point of the series in any case (there would be other warnings, at least for rwlocks). I'll double check before sending next revision, thanks for pointing out. -- David Marchand