Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4151637ybg; Sun, 7 Jun 2020 23:48:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysgbV2HvjbGbKBhxfjZM+q7fCkSxqLxO5+V6xYN3M83nu6eiO0HG0gzoVvUAGSLIB3m5vi X-Received: by 2002:a17:906:2343:: with SMTP id m3mr18929776eja.301.1591598893560; Sun, 07 Jun 2020 23:48:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591598893; cv=none; d=google.com; s=arc-20160816; b=n7OrVm1EIDMFMaozvRdXpzqjlt0HKvscUaZwOipt2IbIpM/DvgS1xcT9cjgEoFJ+jq y+TA/PHBryCV1kdRtd/b1eNK7J9zTeGC4cpvyJ8eKhsFq5StGKxXZocA1WHTI0ymHdkj c/DtZ2PFRsAQjQmg0RY8I73P21gXnsk/sx8EDEP4POdNaiI+H0D8Y+ISSoEQdSfJJgyD GDEKIe98HOWbfoAL29CltGKoeOK+JhhZWbYEGQV9wtSUWWFUYrgwEHcidBDK4dhmQMxg DrTX/TSjYAsmRPIPEh0drTjr4StAlhHJL5ic8jr+EdfkHO1tmdS1w0fw/plpu5GdG0f4 8uvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=05DDfjAfIHUdRf5Uem2N9ccJI7OdmXrAgeiSijOGnoQ=; b=TTKoXeOYDLAQhixB/ypig1GVPcjG5J9kKadycr2GR/rP1kJGpqWu2LqVUW9LnN+/Gr 5DWfJBkAFzQSdBeGJ4wx9YzDM7q0i7QFihFFiLKEvk0VUDlm9RReaGltxC3jaoEBqyLQ 4CoRy88EtsN3pAhkqHnlO6wdyc/yx70jUl5kpV0GEp3VzgzY16BFJ0n+LGagIJIvgmkD nrOPFyyDNps3z4xbtPyg5BuRMaFHT/BY+bEzOIK5yEVG01tIgefBXfJ7/9rojq2bt9jA nYJrAHBEyaM1GGkp2y9zk2R8da+XvzG43z98kTk1oKCd+GrNs6qvCrYKkDnH/DntXe4h mz3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fwRjNkpG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rp11si7982676ejb.744.2020.06.07.23.47.50; Sun, 07 Jun 2020 23:48:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fwRjNkpG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728970AbgFHGp7 (ORCPT + 99 others); Mon, 8 Jun 2020 02:45:59 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:26544 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728334AbgFHGp6 (ORCPT ); Mon, 8 Jun 2020 02:45:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591598756; 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=05DDfjAfIHUdRf5Uem2N9ccJI7OdmXrAgeiSijOGnoQ=; b=fwRjNkpGXZWdAMpa4vXELZvaRC/oEUa7Ee1E8TWf45Fdo/S3Pdf42us8QV/Cy1AuMMKKLK ZUm2WEAC3+iZU+pnHCF2fnpeEby3b+DXIb0Y7qQut8oVjMGJD46ySi4ZlkGx+tUg/yLIZd dQbKGDEgnX0fNhuRJrTywMIlIQcIMkE= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-312-i_BKgQR2M-O67UGS5LlGwg-1; Mon, 08 Jun 2020 02:45:54 -0400 X-MC-Unique: i_BKgQR2M-O67UGS5LlGwg-1 Received: by mail-wr1-f70.google.com with SMTP id f4so6748499wrp.21 for ; Sun, 07 Jun 2020 23:45:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=05DDfjAfIHUdRf5Uem2N9ccJI7OdmXrAgeiSijOGnoQ=; b=YZOMqqg92i6/2W2lZ40Wl2f0hfXkgCXErEyDO4ZRqr1yrRXniyRsXNOlOVh+CfmQaH THWxBCpZtEhrgGwCGb7qGRlxBH+/t93qAXif0+OseNXm33OGXBQDx0mtWdzvxLnkP75R OHH7XDGXIUAKRwdTZBUPb6mS5XQ8T86tGbgrL8sEx6AO2L+OLQmK1+Elhhsm/M5MtwJz JdmVE1WfVD974C0rq0DjIWWZP5T9wUExScAHwZMFthmvj2S7yaKtwupyr/pz5zQJzCQV A+AI8wGJUQsDA4+HWyvPqnmYS6CcGLCj39vcFCjNeZmoSG88j9abnLe1m0vAn/EKxrTt HwJg== X-Gm-Message-State: AOAM531ibzuMN/sKN+OwXsZUxKcPKw+dG53gSug1eEhmtrFgS/vc/svd F5Uwgj6fZIockB+oUMhS1LCeprbJDu6Y7u61Gyp4SRvCwO6KjtOZEZUNt/wpQBwIniKzRrmvtGP GiRHb9cqna6ixIwQcOoLKK5Q6 X-Received: by 2002:a5d:5261:: with SMTP id l1mr22608224wrc.246.1591598753584; Sun, 07 Jun 2020 23:45:53 -0700 (PDT) X-Received: by 2002:a5d:5261:: with SMTP id l1mr22608211wrc.246.1591598753423; Sun, 07 Jun 2020 23:45:53 -0700 (PDT) Received: from redhat.com (bzq-109-64-41-91.red.bezeqint.net. [109.64.41.91]) by smtp.gmail.com with ESMTPSA id x18sm20730927wmi.35.2020.06.07.23.45.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 23:45:52 -0700 (PDT) Date: Mon, 8 Jun 2020 02:45:50 -0400 From: "Michael S. Tsirkin" To: Jason Wang Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, eperezma@redhat.com Subject: Re: [PATCH RFC v5 13/13] vhost: drop head based APIs Message-ID: <20200608023311-mutt-send-email-mst@kernel.org> References: <20200607141057.704085-1-mst@redhat.com> <20200607141057.704085-14-mst@redhat.com> <8e3f5b6f-a47b-73cd-e8e3-959d40f6c91c@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8e3f5b6f-a47b-73cd-e8e3-959d40f6c91c@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 08, 2020 at 11:57:48AM +0800, Jason Wang wrote: > > On 2020/6/7 下午10:11, Michael S. Tsirkin wrote: > > Everyone's using buf APIs, no need for head based ones anymore. > > > > Signed-off-by: Michael S. Tsirkin > > --- > > drivers/vhost/vhost.c | 36 ++++++++---------------------------- > > drivers/vhost/vhost.h | 12 ------------ > > 2 files changed, 8 insertions(+), 40 deletions(-) > > > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > > index 72ee55c810c4..e6931b760b61 100644 > > --- a/drivers/vhost/vhost.c > > +++ b/drivers/vhost/vhost.c > > @@ -2299,12 +2299,12 @@ static int fetch_buf(struct vhost_virtqueue *vq) > > return 1; > > } > > -/* Reverse the effect of vhost_get_vq_desc. Useful for error handling. */ > > +/* Revert the effect of fetch_buf. Useful for error handling. */ > > +static > > void vhost_discard_vq_desc(struct vhost_virtqueue *vq, int n) > > { > > vq->last_avail_idx -= n; > > } > > -EXPORT_SYMBOL_GPL(vhost_discard_vq_desc); > > > The same question as previous version. > > Do we need to rewind cached descriptor here? > > Thanks Good point. This needs more thought, we need to also rewind the avail idx each time we flush the descriptor cache. -- MST