Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp499610pxu; Fri, 23 Oct 2020 06:32:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4ER1TtnBWeeIor27ting7Rv7xzKf3hbbnTzNAB9RnhYh+QvdjtqeehdiVbiqw8JF+09S+ X-Received: by 2002:a17:906:bc98:: with SMTP id lv24mr1946880ejb.536.1603459968952; Fri, 23 Oct 2020 06:32:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603459968; cv=none; d=google.com; s=arc-20160816; b=G51bJTSjAC9r3mqaXZsOWLFCmQl96Wn8mpR5SlypXoa6eFr3fkmfydw5gQhNa0AUGc wQoRoYeXePSN3o/P9s381T14a8Ee3HNxAN4X7NIlcR1VR0M+RC9leTvVNWzWwJA3VFRf ZBB3uvVk35LfOP0KElM+klRhiLXU/3oIu0BXswZ0bQH7L2eUApETVVlkggvDf8Q/XAP4 ZXpX0CRSpvbYYrGLeJoU2PSsqcnOQ0xEt0dXVMfsacPDu2l2aRem771uFF0gF8P7bf9p cwnqgACTRHlILTdp2XFt2KAiqWVasAJUCwQ+Ay7+psI9/KPYkw+HjGvaPogqf3/JOJGp U/SQ== 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=l7++xxB4k3OVNvMLJKXQqrUO4WkG+sGkqOLMB7booC9ZrzSopWXT8uzOqkSqW6gIOg QohLbdHoiDTgqycULt+S9tjdZ56qCBBf4glqgpCE+pNU+TEk5J0qdxCOid6Wu68dx7w3 lDxF/wbLVh3dnJw27ETHQdXoei9iBfWDw2Wtk0DYpzj/rxRK1uXPQqJZ9sBPoflvJgE4 CigGkmLjVfSTSMF1H4EafHpyye+hz+FDrI95KBqks+78a1PX5M8SNJ3SWujMKzYqve2g rDbe5NAIJXLO8ypw9ZA6igfkCsNQWHQVLU/2NhP1KVmPH9TyJFS/LsLfBmLvxcE2UNS1 38KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aKdqvS4r; 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 w26si758648ejk.36.2020.10.23.06.32.26; Fri, 23 Oct 2020 06:32:48 -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=aKdqvS4r; 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 S374612AbgJWCZi (ORCPT + 99 others); Thu, 22 Oct 2020 22:25:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:43121 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S374609AbgJWCZh (ORCPT ); Thu, 22 Oct 2020 22:25:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603419936; 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=aKdqvS4rPd7VtBqOfT2Bm7cxQxjgLnpyTDK1ifxHBJEqKfV5OIcnCZpCy0qt4CEyAurV9N dQeg9cu5aCX15iq+rxfZ78GtzrNXfxC+VowYw59uPH7IRI3LWB7or5ddBJjPNhuPkTL0K2 kdU8FD9DF2xujEfiWKnJVyrrTZfm7Gs= 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-185-nhhl7KPGOGyZCgguoDdHMg-1; Thu, 22 Oct 2020 22:25:32 -0400 X-MC-Unique: nhhl7KPGOGyZCgguoDdHMg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AF9A81006C9F; Fri, 23 Oct 2020 02:25:30 +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 51C2155784; Fri, 23 Oct 2020 02:25:25 +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 V3 3/3] vdpa_sim: implement get_iova_range() Date: Fri, 23 Oct 2020 10:24:54 +0800 Message-Id: <20201023022454.24402-4-jasowang@redhat.com> In-Reply-To: <20201023022454.24402-1-jasowang@redhat.com> References: <20201023022454.24402-1-jasowang@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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