Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3250727ybt; Mon, 22 Jun 2020 19:57:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiR7sjFlU9mIecVpG3JNTYrtsddU5BaL+4NBaU1dGMvdV3sKB6PJfcWNke52teJxaMy0kX X-Received: by 2002:a17:906:6403:: with SMTP id d3mr17940046ejm.386.1592881023850; Mon, 22 Jun 2020 19:57:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592881023; cv=none; d=google.com; s=arc-20160816; b=C/YtM2mWjbb6ieNyySXRV6JYg7BwpSBI1I7biOx4kTihVkaas79Azbz5lPGkkXY2kH c4rEYkNJydrSVKkZy62GhGsCM/f5kZbkYPdDMxpcVpRH0CQn74kmz8Y/3Uvphz6onN83 fChreMAUTOBLaRPSkxjcUiEtoyL8ERFEbqKwD0FJCx+8ztJuAs9nouY2pBnoUtdexKYz xnGfCcN51OntSehbuyGg8ih6HUjbu1/wvTrVyRUgf7O0TmejHi+oo7WtR09DaWIcCIG0 pp1FQSwPR2f7UhunmdWGk22lGSFZl52eL+JeSyGkPxJ/0ZWaqMz9Mg0M42XcOkoODtnk KIwg== 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:dkim-signature; bh=wItOOFxGoX9Yxy2T8076N6nMJmnVQApKKEzZUpOJV/A=; b=KWmGvRjX2g7/7h1bdErsZAPhkUcbRarTaeuSAJoFpV2bqQOvjqkkbKK45N6Ej2eOVJ VrrYL9FAz/dWMtXrjpFd4Mct70LiRekybGePsmLMQUXwdzR2AMvSF3NwzJo8nxgbp08n v8RyUFHEXQ5spadtASDc2IU05GThbSHA8MrBLlnEpvmi13JUsvUzWNo1CwMH3na0cJrv adISgidXkL26mPdiPUQWDdmYEzjIAq8V248VNG03foKj4h5/JAmQ6axeUmUbMylnF/0n K8eb/Iau1MMVUNkut+V35HpWiclnfOW/XAX//T5+wUFrtJ8XuFhBQyvDGuXLxkrYbvs4 3OfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YjKR+xLP; 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 bo17si10545289ejb.573.2020.06.22.19.56.41; Mon, 22 Jun 2020 19:57:03 -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=YjKR+xLP; 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 S1732246AbgFWCw2 (ORCPT + 99 others); Mon, 22 Jun 2020 22:52:28 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:46933 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731999AbgFWCvr (ORCPT ); Mon, 22 Jun 2020 22:51:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592880706; 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=wItOOFxGoX9Yxy2T8076N6nMJmnVQApKKEzZUpOJV/A=; b=YjKR+xLPScUNDNtu3QTm1IbdDcuNZ5kLh8osYq7H0H3bq5D3EjqkfW1AFCLRAuRYj7LH/j TyNo5p1EvINfeT2zJ4P/MC8dfdneifYDnuvEjxt+GD2BOkt6aDae01Vu8aD4YbTWnMJOt7 HzQpb09lc0hfqLYRnNj3Dz/i3ukuvqQ= 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-451-IKRKNpSxMJyEL-9nTh0cCA-1; Mon, 22 Jun 2020 22:51:42 -0400 X-MC-Unique: IKRKNpSxMJyEL-9nTh0cCA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2315EBFC1; Tue, 23 Jun 2020 02:51:41 +0000 (UTC) Received: from [10.72.12.144] (ovpn-12-144.pek2.redhat.com [10.72.12.144]) by smtp.corp.redhat.com (Postfix) with ESMTP id D2B9819D71; Tue, 23 Jun 2020 02:51:35 +0000 (UTC) Subject: Re: [PATCH RFC v8 02/11] vhost: use batched get_vq_desc version To: "Michael S. Tsirkin" Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, eperezma@redhat.com References: <20200611113404.17810-1-mst@redhat.com> <20200611113404.17810-3-mst@redhat.com> <0332b0cf-cf00-9216-042c-e870efa33626@redhat.com> <20200622115946-mutt-send-email-mst@kernel.org> From: Jason Wang Message-ID: Date: Tue, 23 Jun 2020 10:51:34 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200622115946-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/6/23 上午12:00, Michael S. Tsirkin wrote: > On Wed, Jun 17, 2020 at 11:19:26AM +0800, Jason Wang wrote: >> On 2020/6/11 下午7:34, Michael S. Tsirkin wrote: >>> static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) >>> { >>> kfree(vq->descs); >>> @@ -394,6 +400,9 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) >>> for (i = 0; i < dev->nvqs; ++i) { >>> vq = dev->vqs[i]; >>> vq->max_descs = dev->iov_limit; >>> + if (vhost_vq_num_batch_descs(vq) < 0) { >>> + return -EINVAL; >>> + } >> This check breaks vdpa which set iov_limit to zero. Consider iov_limit is >> meaningless to vDPA, I wonder we can skip the test when device doesn't use >> worker. >> >> Thanks > It doesn't need iovecs at all, right? > > -- MST Yes, so we may choose to bypass the iovecs as well. Thanks