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 179D142850; Mon, 27 Mar 2023 18:04:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9358041140; Mon, 27 Mar 2023 18:04:33 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 2E1AD410D0 for ; Mon, 27 Mar 2023 18:04:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679933070; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QWqATi8b+8TWQbXUUwdHICKXJFySVs4L3ZKcD+Y9fuw=; b=PZbbl8Iw7RaqiHi4dQHGzcUzrrgVFmpzytWImM4QwBXC5UJZ6zGMmi7hRS/GDnoCJfTxez qPXJU7kV81aHjiFJCCkfQZyfidFFTyYkz8AwFJmOWBrKoKIWRIr/KcGdEHMrG0rupMOLIk RLd6rVOaF5vb5FcFz4NBmGSKycNA3WM= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-624---3YNaPrOQmLAktrd4Px6w-1; Mon, 27 Mar 2023 12:04:25 -0400 X-MC-Unique: --3YNaPrOQmLAktrd4Px6w-1 Received: by mail-ed1-f70.google.com with SMTP id a40-20020a509eab000000b005024c025bf4so961181edf.14 for ; Mon, 27 Mar 2023 09:04:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679933064; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YIect31ZyMj2XPzD/x3Pv+FVyShna+Xs5OymklcV6aQ=; b=TnK/z8DCZuuc5Cj8MxsPAeBkAOhNBN6260ECWhT/KN4/GXh5T9ciayohMxj171zOLl Z5V08X8LsyklACfa32hqMar+2JdghWJxNw/3+p2ZFcbJZC3NDPM1vRVPEbZsbK5BVmtm Aa5euAUUVRBRWeTR7XqJHeLSkeFUWFhjgsIeX5pkPUnNYH4wUvtomYvkwYIog7Ps0fa6 bq6l1cvYPk+iX2O8gUXUojTBKad0clZrGdz7uSJFc2xLWNGIlVCU2SdhW1iMiUCBT6Y2 fY4si8PLO/jzbfT/uf6m9geNnKRmOpncu5Tq3+RpIEMvg4gIeLo9reww/dPtHCpBrjjg t1KQ== X-Gm-Message-State: AAQBX9eXu6KbG4+VmX6pxuY7nLwUYrBSnVqGVmVBoyeAKbT+KrvGZx/s ZMLarTOYepDCkdszqHXsLY9Hp8pypJgn2er7I7DOgN8iLosa+s3KkphQ7tiUOB6LWkXIssBdvx+ 8YnHs32b7NBA= X-Received: by 2002:a17:906:49d9:b0:932:217c:b85d with SMTP id w25-20020a17090649d900b00932217cb85dmr11840972ejv.37.1679933064013; Mon, 27 Mar 2023 09:04:24 -0700 (PDT) X-Google-Smtp-Source: AKy350a3JFaIr8jxvygNYMqp/cas5VsyuTUlLspmLMJ/u0XGPI99FNVdab21PjOxJRGc+iAwLIh0+g== X-Received: by 2002:a17:906:49d9:b0:932:217c:b85d with SMTP id w25-20020a17090649d900b00932217cb85dmr11840947ejv.37.1679933063706; Mon, 27 Mar 2023 09:04:23 -0700 (PDT) Received: from [10.39.192.159] (5920ab7b.static.cust.trined.nl. [89.32.171.123]) by smtp.gmail.com with ESMTPSA id f23-20020a1709064dd700b00931536d461fsm14143894ejw.20.2023.03.27.09.04.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Mar 2023 09:04:23 -0700 (PDT) From: Eelco Chaudron To: Gowrishankar Muthukrishnan Cc: maxime.coquelin@redhat.com, chenbo.xia@intel.com, dev@dpdk.org Subject: Re: [EXT] [PATCH] vhost: add device op to offload the interrupt kick Date: Mon, 27 Mar 2023 18:04:22 +0200 X-Mailer: MailMate (1.14r5950) Message-ID: <4FB0405A-41E0-4CE2-B8B1-0974CD398956@redhat.com> In-Reply-To: References: <167992139724.45323.17979512439014217881.stgit@ebuild.local> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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 27 Mar 2023, at 17:16, Gowrishankar Muthukrishnan wrote: > Hi Eelco, > >> +void >> +rte_vhost_notify_guest(int vid, uint16_t queue_id) { >> +=09struct virtio_net *dev =3D get_device(vid); >> +=09struct vhost_virtqueue *vq; >> + >> +=09if (!dev || queue_id >=3D VHOST_MAX_VRING) >> +=09=09return; >> + >> +=09vq =3D dev->virtqueue[queue_id]; >> +=09if (!vq) >> +=09=09return; >> + >> +=09rte_spinlock_lock(&vq->access_lock); >> + > > Is spin lock needed here before system call ? I assumed access_lock is protecting all the following fields in this struct= ure, so I need the lock to read the vq->callfd, however, I can/should move = the eventfd_write outside of the lock. >> +=09if (vq->callfd >=3D 0) >> +=09=09eventfd_write(vq->callfd, (eventfd_t)1); >> + >> +=09rte_spinlock_unlock(&vq->access_lock); >> +} >> + > > Thanks.