Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp10320743pxu; Tue, 29 Dec 2020 22:27:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxU0AiLD8M6YNijY36zjBlfO9+wj5uFw6NQrGoVEbrBen6ZFUxp7HF3vWDQVW3XcHWnANup X-Received: by 2002:a05:6402:94c:: with SMTP id h12mr49318153edz.268.1609309649658; Tue, 29 Dec 2020 22:27:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609309649; cv=none; d=google.com; s=arc-20160816; b=wLVcDfBOeClIhercExzkZgBeKomb3bdabsmk39MLaO268dlxbLnX+sV7R5AzqTl0MD YQuV2g3smPM7uSS4oYvBlkHy9G0NROa32Nuxh914WRBThxU97BnN6gW7cf/N1d/1HpN7 7XupUV0lpq1yFoQM5W6sorsPhDcbkX+qIpiW4V2LzmxZ1gNnSgacsp3PiUFfL0GvkkYg uELxw0zCJT3B2E9vrqGGyAUvKaRoTguYoAeaPUf256M+ipCwgtLi1fvMhJqnU0p9688E r63Rb4ZdAF6XV/699KktYqWG9JQViRnndTw3m8wDg+ZlShvN9QO8gJ4n/hquj8/s1vgG zdbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=zMOHRQRlmmzuXmXJwYwsntjIgSSrZq/XW9h6GVg/eWI=; b=ieoGU7HBiULAkMAQkIOLdELVx68KpgB5SaF1psbJWsto/A1IxjDaaGCKcZmBOmh6kE 9LNpTwQiewndy+YtAdxxh+C/Xm9wYdZXs01dlFOBESv7wWfSgckFrkmbZ3j0ZK3jIEi6 vKYrrETMYTzdXXo7YcKuIHvxsC2q/HR3OCOrXK07dulkLpO0vWEP7m7xcHHkNKU0ZTAI 7+yM7IzWOB6vfP/iJV43YjM3sJ+3t1Ydbv/ay5Vamtz2NxnX7iML+4Tu4ngqqdUzq/AG KvnE+pjulRv4SNXwKHvMwjKmed4IQ0TJIHr0RLVsQlVOaybE4L+yLwniCHh08igmcub1 6pUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bNxiez54; 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 s18si19457214eji.157.2020.12.29.22.27.07; Tue, 29 Dec 2020 22:27:29 -0800 (PST) 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=bNxiez54; 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 S1726462AbgL3GYo (ORCPT + 99 others); Wed, 30 Dec 2020 01:24:44 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:59844 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726161AbgL3GYn (ORCPT ); Wed, 30 Dec 2020 01:24:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609309397; 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=zMOHRQRlmmzuXmXJwYwsntjIgSSrZq/XW9h6GVg/eWI=; b=bNxiez54pDzDEXZtFvmDlrL8+SijXP5Oi89Xw/IbrsnbBsASwV3DE3X+7NEp8awblFtUYX 72nd1aZG1FXCcyIYrf0x5BnmRYQxN291Kbt4P2altPAZrX78Rgl5T3q/2xmpAOETq3XS17 Nq3cn5pFZrCqFFQCNl8wrIounRXEfUA= 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-489-EQtmwsDoOMSTdZvFTvX8SQ-1; Wed, 30 Dec 2020 01:23:15 -0500 X-MC-Unique: EQtmwsDoOMSTdZvFTvX8SQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1CF0015720; Wed, 30 Dec 2020 06:23:14 +0000 (UTC) Received: from [10.72.13.30] (ovpn-13-30.pek2.redhat.com [10.72.13.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 50A6271C8B; Wed, 30 Dec 2020 06:23:03 +0000 (UTC) Subject: Re: [PATCH 11/21] vhost-vdpa: introduce asid based IOTLB To: Eli Cohen Cc: mst@redhat.com, eperezma@redhat.com, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lulu@redhat.com, eli@mellanox.com, lingshan.zhu@intel.com, rob.miller@broadcom.com, stefanha@redhat.com, sgarzare@redhat.com References: <20201216064818.48239-1-jasowang@redhat.com> <20201216064818.48239-12-jasowang@redhat.com> <20201229114110.GC195479@mtl-vdi-166.wap.labs.mlnx> From: Jason Wang Message-ID: <02c7a7ea-3765-3ff8-0742-0520d6cc4ca5@redhat.com> Date: Wed, 30 Dec 2020 14:23:01 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201229114110.GC195479@mtl-vdi-166.wap.labs.mlnx> 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.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/12/29 下午7:41, Eli Cohen wrote: > On Wed, Dec 16, 2020 at 02:48:08PM +0800, Jason Wang wrote: >> This patch converts the vhost-vDPA device to support multiple IOTLBs >> tagged via ASID via hlist. This will be used for supporting multiple >> address spaces in the following patches. >> >> Signed-off-by: Jason Wang >> --- >> drivers/vhost/vdpa.c | 106 ++++++++++++++++++++++++++++++++----------- >> 1 file changed, 80 insertions(+), 26 deletions(-) >> >> diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c >> index feb6a58df22d..060d5b5b7e64 100644 >> --- a/drivers/vhost/vdpa.c >> +++ b/drivers/vhost/vdpa.c >> @@ -33,13 +33,21 @@ enum { >> >> #define VHOST_VDPA_DEV_MAX (1U << MINORBITS) >> >> +#define VHOST_VDPA_IOTLB_BUCKETS 16 >> + >> +struct vhost_vdpa_as { >> + struct hlist_node hash_link; >> + struct vhost_iotlb iotlb; >> + u32 id; >> +}; >> + >> struct vhost_vdpa { >> struct vhost_dev vdev; >> struct iommu_domain *domain; >> struct vhost_virtqueue *vqs; >> struct completion completion; >> struct vdpa_device *vdpa; >> - struct vhost_iotlb *iotlb; >> + struct hlist_head as[VHOST_VDPA_IOTLB_BUCKETS]; >> struct device dev; >> struct cdev cdev; >> atomic_t opened; >> @@ -49,12 +57,64 @@ struct vhost_vdpa { >> struct eventfd_ctx *config_ctx; >> int in_batch; >> struct vdpa_iova_range range; >> + int used_as; > This is not really used. Not in this patch and later removed. Right, will remove this. Thanks