Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp149192imm; Wed, 30 May 2018 20:10:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJyEM39ZQar4CGZI7lkKb/CTfMU75m4rwkR0wyyArd9p1qphtmXoozlhyDqWiSvbd2ZVaD1 X-Received: by 2002:a17:902:1a8:: with SMTP id b37-v6mr5409308plb.326.1527736204954; Wed, 30 May 2018 20:10:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527736204; cv=none; d=google.com; s=arc-20160816; b=VhR9xO4z6xBrLtSKg7gh9qeV6iopEhGacji9vP0d2TJmTS8QaOAaDNtAb33/VVALA3 ds+aSsyIbJn+0vSYhPXce1MAA1m7zvS71O0lxZixJCJNoZR49FB7hSu7ECd7FkVFOuUe 5R0cpq3EcZHBx8ZZkaDy/pyBlRsF6RKGq/5u0whLje2jFZo9V9Th65VnIuJbkpB9/Tg8 86rTBJQN6mEmgUuYgSc0vIMGczB+IYrgZn/ETVdlwAc8OQSDXEep6ZdaPJuIB/FyFMDL oexoTk1oUS0qJ5wYY/pIDGP44D4kJK+H+HlqGhcG1Tbmu6LMdZQbFqEgMX7SriXH16qE FpkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=GY6bO7rrbEdTzufd/9dZc0Gf3nee+ubpOPe0BpmcQsA=; b=NndpkMz3HrrOZBf0ncHJh8yLI3IaM3jM6hp4ph+kTByW005hC0ugSKuqAZ7s/Ik0/b 8n4Rw3EwtMQptYYoW4RW33eiZZ6LrgEsUnSUEfDjEF2kE90N1ORot0Adloa0vnMmxTjr /lcxO1N0qDgVfbQ11dMp8EjDQPRosHzdU/fP4S+vOld3qgIqkOqtuR0vXn7kd6Vwr4DC iPVsbKAExQxYFIyKDhZELl/l3rMuufPFE7uIXg5ERzJ4sFE6NSDjLPB8SCE3nvs6KMSY orToouphSikhLTY4jhVR5DpycqWVWsZcULJ4bpoVHoeW+HBpMYDIyDtd6KSJx4O6SDAu AyCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5-v6si10208535pgb.430.2018.05.30.20.09.51; Wed, 30 May 2018 20:10:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932715AbeEaDJU (ORCPT + 99 others); Wed, 30 May 2018 23:09:20 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58224 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932637AbeEaDJS (ORCPT ); Wed, 30 May 2018 23:09:18 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DE03680401A8; Thu, 31 May 2018 03:09:17 +0000 (UTC) Received: from [10.72.12.130] (ovpn-12-130.pek2.redhat.com [10.72.12.130]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 756BF6353C; Thu, 31 May 2018 03:09:10 +0000 (UTC) Subject: Re: [RFC V5 PATCH 8/8] vhost: event suppression for packed ring To: Wei Xu Cc: mst@redhat.com, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jfreimann@redhat.com, tiwei.bie@intel.com References: <1527559830-8133-1-git-send-email-jasowang@redhat.com> <1527559830-8133-9-git-send-email-jasowang@redhat.com> <20180530114200.GA23792@wei-ubt> From: Jason Wang Message-ID: <12f2c455-5868-3b07-0eba-d49dcafd10f2@redhat.com> Date: Thu, 31 May 2018 11:09:07 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180530114200.GA23792@wei-ubt> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 31 May 2018 03:09:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 31 May 2018 03:09:17 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jasowang@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018年05月30日 19:42, Wei Xu wrote: >> /* This actually signals the guest, using eventfd. */ >> void vhost_signal(struct vhost_dev *dev, struct vhost_virtqueue *vq) >> { >> @@ -2802,10 +2930,34 @@ static bool vhost_enable_notify_packed(struct vhost_dev *dev, >> struct vhost_virtqueue *vq) >> { >> struct vring_desc_packed *d = vq->desc_packed + vq->avail_idx; >> - __virtio16 flags; >> + __virtio16 flags = RING_EVENT_FLAGS_ENABLE; >> int ret; >> >> - /* FIXME: disable notification through device area */ >> + if (!(vq->used_flags & VRING_USED_F_NO_NOTIFY)) >> + return false; >> + vq->used_flags &= ~VRING_USED_F_NO_NOTIFY; > 'used_flags' was originally designed for 1.0, why should we pay attetion to it here? > > Wei It was used to recored whether or not we've disabled notification. Then we can avoid unnecessary userspace writes or memory barriers. Thanks