Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp175915ybt; Tue, 16 Jun 2020 20:32:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUTogXQmm4dUudHDqjO+/qDwVwjilewtr2rqZfLeZdPuMgF4MRcreSfqSadsRsNQe07teU X-Received: by 2002:a17:907:a84:: with SMTP id by4mr5896509ejc.440.1592364759802; Tue, 16 Jun 2020 20:32:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592364759; cv=none; d=google.com; s=arc-20160816; b=bmBW10N4nO+kIT+L2a/9TUVKcZIoig7C5A1xsZ+lge/Ih8tnvGQSSpvrOUNva0rvpM N/txmBFz4s6r3RfYVJuAXH26wDnA9TvryjH1gONsaIT5TzyFmvf6jWim3SVTOgOnSVQQ /kXZR8DfyNqH9mfM5n7t/5tqG+R7Fdi6h1IR+d1lARkVhH4UCcR9xRKj+vhQGSwBN8Ze uywSPFemUOLfb7DhVlvSPskvJO59LK4FAK7RDIl0jbh/JxmBd5liW6FTo0/nFD8zn+Xz h2qJbrBFdbG30SbzFHXhfvnUShmyV++bJ7tE7drSBJVSabw4RZvgCMFHVQXdbR8ZdaUv kovQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=N+42FNXKIBA3SLmmXlWtUDtUR9h03h5BkA4akBDJ4BI=; b=UQFY6h64MOXv63Lhh2+ScXc4QgFNkReLarJfita/8RPWDzszysVgfXj7W243Z72pe0 RXf5Z4X2DeMSujDxX43LljTcA+meOnCA7Zk57LwhaiIYtO0jRWXJv5jIZvwPo9/5hBV8 ml6fCWTV2SkPZ5XbHsJQGwVT8cQzrN++yaRE94oz8TKTOMbKdv7d5d4sZ/f35B8FYYc2 vsV21g3yk7nJf6+QWi1tHJynLGYjGwBzl7jqfnL9+sZ4duDy3S8k6+X5n7vBHZzPNbqo LCB/ogIznoZF9++C+inIX8z4ZzrzDbKaib6/qWmjEtbgtNKF4zEjGdKykmuC5cuYArTC 428w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eyYy5OkS; 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 j14si12002688edy.342.2020.06.16.20.32.17; Tue, 16 Jun 2020 20:32:39 -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=eyYy5OkS; 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 S1726762AbgFQDaX (ORCPT + 99 others); Tue, 16 Jun 2020 23:30:23 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:55627 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726703AbgFQDaW (ORCPT ); Tue, 16 Jun 2020 23:30:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592364621; 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=N+42FNXKIBA3SLmmXlWtUDtUR9h03h5BkA4akBDJ4BI=; b=eyYy5OkSER9A66xyZP4KRUMUg2VnaToBV/GDY6K0Q4YRAB54r1hyXezepPaA9bwwtl7FoD USVKS/Ryq80D4ZKi7+YK687ntdE+ZZtaE/Gismix43piG9CW+qPG2LxsfMtzmKBryCduXE /m0L2MF7xOD89S7pfCZmswiOpo0jSXQ= 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-243-_Fs2v4dOOqel8S6cuann0w-1; Tue, 16 Jun 2020 23:30:20 -0400 X-MC-Unique: _Fs2v4dOOqel8S6cuann0w-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 14D2380F5E0; Wed, 17 Jun 2020 03:30:18 +0000 (UTC) Received: from jason-ThinkPad-X1-Carbon-6th.redhat.com (ovpn-13-217.pek2.redhat.com [10.72.13.217]) by smtp.corp.redhat.com (Postfix) with ESMTP id 90CD45C1D4; Wed, 17 Jun 2020 03:30:04 +0000 (UTC) From: Jason Wang To: mst@redhat.com, jasowang@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 Subject: [PATCH 2/4] vdpa_sim: implement get_iova_range bus operation Date: Wed, 17 Jun 2020 11:29:45 +0800 Message-Id: <20200617032947.6371-3-jasowang@redhat.com> In-Reply-To: <20200617032947.6371-1-jasowang@redhat.com> References: <20200617032947.6371-1-jasowang@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch implements get_iova_range method for vdpa_sim. Since vdpa_sim is a software device, simply advertise a [0ULL, ~0ULL] range. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index c7334cc65bb2..b3a6dc5b9984 100644 --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c @@ -524,6 +524,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; + + range.start = 0ULL; + range.end = ~0ULL; + + return range; +} + static int vdpasim_set_map(struct vdpa_device *vdpa, struct vhost_iotlb *iotlb) { @@ -597,6 +607,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, .set_map = vdpasim_set_map, .dma_map = vdpasim_dma_map, .dma_unmap = vdpasim_dma_unmap, -- 2.20.1