Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp171190ybt; Tue, 16 Jun 2020 20:22:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMYjF1w9/Hiq6YZsP6lFuP99Ojh0ZWWj57W/YbvC260t86G5wJU9mrZx0lk9ft1Sm1SBUq X-Received: by 2002:a17:906:4d04:: with SMTP id r4mr5458670eju.317.1592364120941; Tue, 16 Jun 2020 20:22:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592364120; cv=none; d=google.com; s=arc-20160816; b=C/e06Rst5m1spOilXHNSpf98kR/MqKuAtAOxj725tzmZYhBFJfUvAP7WENqBLGvchp CyLN/++DXXG5r5JXRQ0D9DaXCN99dil0cgDldi+IAEqnSCBH0xcZ4Uqp22XpMTseAiCT oixNoy6+QbiGQhilhfl9jwJf7dEWRIS+uz8tykBCKosrn6sHtWUuSzvnJTUpnOSwFapn sYluyrhoD5mCZo6KBy6pdERjrigzc+bhQozSoQ1Xbf7a1PwSiyRcVWac3FjOKY4RCyQV RwqYTebs22UAdxE+l49O7I4Tr5Ys0NSGxIBkddD9MsmdJetIgP47aRvSoL676YEg7ogE C84g== 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=mq/stawXjx0dcB0y1QUsFlRW19BEay/7Pm1Vse2Y1ZY=; b=lwpKXVeJL1sGg5KO1OTR4rFtkjeRL+p+/HWuO4yVHA6yEmNS78VXeQUNugmWQnFqGg Qu2AteaYL5wcxL1Uqi5yrA5Nl4z481lGVvaaQRu8Vi9awFNG3GK9xcyhgt5kMd45upBn j5+Jig0HHuJtiqlScXdY/tREX2smIam5WhKOTpUHRV+z6nHcZISMpbKDvLC3WOfI0cj/ lthe6tWZ42GYkkBk9qAv3wEDPWt54aYYs2JsqmVI/nj++qMSLGEzWH9c3z2SoIcYAAOl POshf94D8OExNncwfmW5HLZU6dyihle3wyyCRwBS+ty2R1NysH3bM0xIh3KBOcGAhPYw xRtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=g6BI0oo0; 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 b27si11936489ejq.568.2020.06.16.20.21.38; Tue, 16 Jun 2020 20:22:00 -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=g6BI0oo0; 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 S1726738AbgFQDTh (ORCPT + 99 others); Tue, 16 Jun 2020 23:19:37 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:50891 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726497AbgFQDTg (ORCPT ); Tue, 16 Jun 2020 23:19:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592363975; 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=mq/stawXjx0dcB0y1QUsFlRW19BEay/7Pm1Vse2Y1ZY=; b=g6BI0oo00Bt7qVf6Rbv5ZTwJdYCiQ46PyGzqOjAPQ+Fu9/t/PFWJ+eCk8OznU9piF+p/Ri ycXWTuwOcWPQAmP+FyMHFJNKMM/8FY23r1Vmox5wF+CHSriKnaag2dyZTdWGJMHuDRTk87 ag2fa+dhgDqxCXdKWp4srBsM8pa791s= 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-514-xkJ2Kb9hMbC8iI2CXnx6hw-1; Tue, 16 Jun 2020 23:19:33 -0400 X-MC-Unique: xkJ2Kb9hMbC8iI2CXnx6hw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A81C910059A6; Wed, 17 Jun 2020 03:19:32 +0000 (UTC) Received: from [10.72.13.217] (ovpn-13-217.pek2.redhat.com [10.72.13.217]) by smtp.corp.redhat.com (Postfix) with ESMTP id D49205D9D3; Wed, 17 Jun 2020 03:19:27 +0000 (UTC) Subject: Re: [PATCH RFC v8 02/11] vhost: use batched get_vq_desc version To: "Michael S. Tsirkin" , linux-kernel@vger.kernel.org Cc: 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> From: Jason Wang Message-ID: <0332b0cf-cf00-9216-042c-e870efa33626@redhat.com> Date: Wed, 17 Jun 2020 11:19:26 +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: <20200611113404.17810-3-mst@redhat.com> 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.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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