From patchwork Thu Apr 16 07:56:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eugenio Perez Martin X-Patchwork-Id: 11492453 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E568615AB for ; Thu, 16 Apr 2020 07:58:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C213621556 for ; Thu, 16 Apr 2020 07:58:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="d3JE1EZv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2441080AbgDPH6l (ORCPT ); Thu, 16 Apr 2020 03:58:41 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:35919 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2440761AbgDPH5E (ORCPT ); Thu, 16 Apr 2020 03:57:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587023823; 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=NIXtCxLH9qE2Xr1d3NAPwfOyt7PzhZHgvlWtNr1RJhc=; b=d3JE1EZvYQGzk0bHCiofiQ/IQWQOjHHGd2OOPSShJr2Yq4j0hD5AcvvFivASUR8T5UQjrX Aptb1Z/k1b8eqFvHDg7389PbPHA901zZI/zH3TkHFjDHa6l5gMBtGRQcZBYdzB7HK4jVoh 63L6tAp4WOmlR0DKsmecY8+I/6EdoF8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-268-VibkYPSGNAO5AKaTj77VSw-1; Thu, 16 Apr 2020 03:56:59 -0400 X-MC-Unique: VibkYPSGNAO5AKaTj77VSw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 17F23800D5C; Thu, 16 Apr 2020 07:56:58 +0000 (UTC) Received: from eperezma.remote.csb (ovpn-112-194.ams2.redhat.com [10.36.112.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id B28567E7C5; Thu, 16 Apr 2020 07:56:55 +0000 (UTC) From: =?utf-8?q?Eugenio_P=C3=A9rez?= To: "Michael S. Tsirkin" Cc: Stephen Rothwell , "virtualization@lists.linux-foundation.org" , Christian Borntraeger , =?utf-8?q?Eugenio_P=C3=A9re?= =?utf-8?q?z?= , Linux Next Mailing List , kvm list , Cornelia Huck , Halil Pasic , "linux-kernel@vger.kernel.org" Subject: [PATCH v2 2/8] vhost: Not cleaning batched descs in VHOST_SET_VRING_BASE ioctl Date: Thu, 16 Apr 2020 09:56:37 +0200 Message-Id: <20200416075643.27330-3-eperezma@redhat.com> In-Reply-To: <20200416075643.27330-1-eperezma@redhat.com> References: <20200416075643.27330-1-eperezma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org They are cleaned in vhost_vq_set_backend, which can be called with an active backend. To set and remove backends already clean batched descriptors, so to do it here is completely redundant. Fixes: ("af3756cfed9a vhost: batching fetches") Signed-off-by: Eugenio PĂ©rez --- drivers/vhost/vhost.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 0395229486a9..882d0df57e24 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -1579,7 +1579,6 @@ long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *arg vq->last_avail_idx = s.num; /* Forget the cached index value. */ vq->avail_idx = vq->last_avail_idx; - vq->ndescs = vq->first_desc = 0; break; case VHOST_GET_VRING_BASE: s.index = idx;