Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp340443pxu; Fri, 23 Oct 2020 02:03:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbp1Pn15uizpCLenhbD/GDPmCNOvassOGFR/X2hV7IjYIp3zbg3uPWLFQiA9Jpa/BrZEAN X-Received: by 2002:a17:906:394c:: with SMTP id g12mr953144eje.396.1603443822159; Fri, 23 Oct 2020 02:03:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603443822; cv=none; d=google.com; s=arc-20160816; b=gWJOpjbLNMBIhGuV2u7wI4kRaupUbQYZzgzC2zdFidoU7mOMiCqYnNeRp/a8wJd2Gm P+cqgiSD3LmR0K0UTmmtQMo/TItw0q7QKjpPYbLUOnr/oJ0IzOUNeooq4vVi4g55Hotm DTeR96oVYdnuxIYkoePpBc91R2ccNp1vOBRnwbyPIHh1zVWvOfJy532MCBwjuW4NwPCM 1SQtV3uimShh521M/yIAGE75k13f6mjSpui8U7HLbdK5b8HCLaTvoZ+0drS6xseQQpL0 BHa0I1jiZ8GblpQlDDvG1vnwYn4jEz1t1O65paL06OZtd+pAGdmyStGdK9J3H4I7oU7i EgDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SLiwxv/22iGCcdvl9AAdgeJKpXrOBQqld4y3h6tdebI=; b=QamupoCqi0iIxopKXJQNGkLnEblVwsMVoxh/ZlN9dXBUWPy7KYVq6KgEIVlC47sOv8 KcRLgRCl2k/+WEnIVCa801rdtacTa4DTyALJOy5qwxJczuODxaDMD83y9q+aNS3wFFqr GeMKnjbZDHt4bLQsAwsFX/HYKIZV3SZkA8oBFX9WtB4ScsRGoKFoxnP+t0abR4rzjkbe PGilZd35Nezh5GI3c3DLh8DeAaWxqa6ksKuZ/qxDBlM8PzxGuJOitf6LqgiYj/SZBUE/ aAn7PSHpjU3erfMbvJ2bFbX6n0p1eWIZ85rMv2ZG+vrS5Xlx3CFv1nUN4uNb8W2+8TK+ nu2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UrLgiv15; 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 l14si412718ejg.242.2020.10.23.02.03.18; Fri, 23 Oct 2020 02:03:42 -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=UrLgiv15; 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 S461019AbgJWJBV (ORCPT + 99 others); Fri, 23 Oct 2020 05:01:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:51294 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S461015AbgJWJBU (ORCPT ); Fri, 23 Oct 2020 05:01:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603443679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SLiwxv/22iGCcdvl9AAdgeJKpXrOBQqld4y3h6tdebI=; b=UrLgiv15DnWn3vMvQotJVPI0hFdfMWjU6HgxOBTus5QBLnPq27bvaOmrWrEwdwE24InuFH K3s+sOPxS7V2AbH0HAb1PKJEUGFyQOcHGJRvyCQvSjKoJzossojuOBL94QfDu6MjS2hzQG 6Y3ulxaO2sa0RUAFZqVD/GWxLgNRO2E= 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-96-XpJaC8BDMymu96E7IzaFPw-1; Fri, 23 Oct 2020 05:01:17 -0400 X-MC-Unique: XpJaC8BDMymu96E7IzaFPw-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 CFD5F804B78; Fri, 23 Oct 2020 09:01:15 +0000 (UTC) Received: from jason-ThinkPad-X1-Carbon-6th.redhat.com (ovpn-13-85.pek2.redhat.com [10.72.13.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 852B65B4A1; Fri, 23 Oct 2020 09:01:07 +0000 (UTC) From: Jason Wang To: mst@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Cc: rob.miller@broadcom.com, lingshan.zhu@intel.com, eperezma@redhat.com, lulu@redhat.com, shahafs@mellanox.com, hanand@xilinx.com, mhabets@solarflare.com, gdawar@xilinx.com, saugatm@xilinx.com, vmireyno@marvell.com, zhangweining@ruijie.com.cn, eli@mellanox.com, Jason Wang Subject: [PATCH V4 3/3] vdpa_sim: implement get_iova_range() Date: Fri, 23 Oct 2020 17:00:43 +0800 Message-Id: <20201023090043.14430-4-jasowang@redhat.com> In-Reply-To: <20201023090043.14430-1-jasowang@redhat.com> References: <20201023090043.14430-1-jasowang@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This implements a sample get_iova_range() for the simulator which advertise [0, ULLONG_MAX] as the valid range. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index 62d640327145..ff6c9fd8d879 100644 --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c @@ -574,6 +574,16 @@ static u32 vdpasim_get_generation(struct vdpa_device *vdpa) return vdpasim->generation; } +static struct vdpa_iova_range vdpasim_get_iova_range(struct vdpa_device *vdpa) +{ + struct vdpa_iova_range range = { + .first = 0ULL, + .last = ULLONG_MAX, + }; + + return range; +} + static int vdpasim_set_map(struct vdpa_device *vdpa, struct vhost_iotlb *iotlb) { @@ -657,6 +667,7 @@ static const struct vdpa_config_ops vdpasim_net_config_ops = { .get_config = vdpasim_get_config, .set_config = vdpasim_set_config, .get_generation = vdpasim_get_generation, + .get_iova_range = vdpasim_get_iova_range, .dma_map = vdpasim_dma_map, .dma_unmap = vdpasim_dma_unmap, .free = vdpasim_free, @@ -683,6 +694,7 @@ static const struct vdpa_config_ops vdpasim_net_batch_config_ops = { .get_config = vdpasim_get_config, .set_config = vdpasim_set_config, .get_generation = vdpasim_get_generation, + .get_iova_range = vdpasim_get_iova_range, .set_map = vdpasim_set_map, .free = vdpasim_free, }; -- 2.20.1