Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1023204ybv; Wed, 5 Feb 2020 19:24:44 -0800 (PST) X-Google-Smtp-Source: APXvYqzZL+hrRA0Y+OpiSw7O7yrAnyQ9btF7s+T66FAi7cUsjTRfuPeEaxG57NdXX5tLNHmZnhGc X-Received: by 2002:a05:6808:658:: with SMTP id z24mr5669253oih.91.1580959484024; Wed, 05 Feb 2020 19:24:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580959484; cv=none; d=google.com; s=arc-20160816; b=eAgQuOolzEoUyPWJbBEZRRRAUdmKJs/ljMytvXXMCJyHtLo4vtcmekIaCm3U8c3JmM cPpgWqakmIec2NimA5XHQ/t5hMTNTsZLrHALQwtIXH7acATHr3WsFcOTPO8n2IGEcxKu L9F16fFjKOPFwwCUrOcUmAMAvuFsxvI345PlNu31AavTZNWLzoJTZSoL1xBTzCCWroDz JjALJPrzD4ao43wursDA+ek9py8Q4SXaBiI97f32GyL7R3oqV6yKrBBkEyfJcgGvLVJe 1v8J17GC/N7djyBa2jMU+MGGlCze1erRtnlf+OJxdG/ctW4fMsD03wgagXdxtUQTkx83 5pDQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=RspSNO+p1yr02wpcehjk1h3AeZBEyxIwLa/kF1BxhEY=; b=HLXsgsDNt4izPaTXQTeryCh28cDuvTsOgkwzYrTn6dXS6z7QLizN0YlVNo9ZwhWcG9 AS+w4VyJzzxf8stwYKhuRohRosZJj6t0CnLAz2XGDlBHIqh4Bb46HvORbDH/jeBTcxhN HrsFKFFkYFa1OD6V8u47eUdok6ZIO1o2cIuDpHj3vy5ZwKJoFcykHAR4iq7tFSYOCAig Sx0tyHGJqqSxDHzCwwzsc9Z/LsSK6p0GGqEh67iOxubev/6OWQr+gC14NUXB6Avish16 PE5ddzuNE5cH95aBcHjVsfjgR4/L12yfpjY1N0ggSew8mdNvWWxwk3C13wpPD7cW8jpW +p5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Tzu/fv1+"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id i15si1173742otk.120.2020.02.05.19.24.32; Wed, 05 Feb 2020 19:24:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Tzu/fv1+"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727920AbgBFDMN (ORCPT + 99 others); Wed, 5 Feb 2020 22:12:13 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:30806 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727912AbgBFDMN (ORCPT ); Wed, 5 Feb 2020 22:12:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580958732; 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=RspSNO+p1yr02wpcehjk1h3AeZBEyxIwLa/kF1BxhEY=; b=Tzu/fv1+x57PPEYYLKMdcqmju0mpoP7/vTvkoKseGP3HEPZfXPa6OPdgaFqvEuNWxp2i1J rTS2hH0KS9B/cnzajxOAcikwiBJnieqsB4Lu1Hlqlx95vWMoYKAVIApXWQTnnT8JxX+AOU P6L9SYGk/bzTklPNYE4Wen+Xtfd9TbU= 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-251-IABUdiBpNvaQmA4HuVYVBQ-1; Wed, 05 Feb 2020 22:12:10 -0500 X-MC-Unique: IABUdiBpNvaQmA4HuVYVBQ-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 4495D8018A5; Thu, 6 Feb 2020 03:12:07 +0000 (UTC) Received: from [10.72.13.85] (ovpn-13-85.pek2.redhat.com [10.72.13.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2AAA85C1B2; Thu, 6 Feb 2020 03:11:53 +0000 (UTC) Subject: Re: [PATCH] vhost: introduce vDPA based backend To: "Michael S. Tsirkin" , Jason Gunthorpe Cc: Shahaf Shuler , Tiwei Bie , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "netdev@vger.kernel.org" , "rob.miller@broadcom.com" , "haotian.wang@sifive.com" , "eperezma@redhat.com" , "lulu@redhat.com" , Parav Pandit , "rdunlap@infradead.org" , "hch@infradead.org" , Jiri Pirko , "hanand@xilinx.com" , "mhabets@solarflare.com" , "maxime.coquelin@redhat.com" , "lingshan.zhu@intel.com" , "dan.daly@intel.com" , "cunming.liang@intel.com" , "zhihong.wang@intel.com" References: <20200131033651.103534-1-tiwei.bie@intel.com> <7aab2892-bb19-a06a-a6d3-9c28bc4c3400@redhat.com> <20200205020247.GA368700@___> <112858a4-1a01-f4d7-e41a-1afaaa1cad45@redhat.com> <20200205125648.GV23346@mellanox.com> <20200205081210-mutt-send-email-mst@kernel.org> From: Jason Wang Message-ID: <55b050d6-b31d-f8a2-2a15-0fc68896d47f@redhat.com> Date: Thu, 6 Feb 2020 11:11:52 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20200205081210-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/2/5 =E4=B8=8B=E5=8D=889:14, Michael S. Tsirkin wrote: > On Wed, Feb 05, 2020 at 08:56:48AM -0400, Jason Gunthorpe wrote: >> On Wed, Feb 05, 2020 at 03:50:14PM +0800, Jason Wang wrote: >>>> Would it be better for the map/umnap logic to happen inside each dev= ice ? >>>> Devices that needs the IOMMU will call iommu APIs from inside the dr= iver callback. >>> Technically, this can work. But if it can be done by vhost-vpda it wi= ll make >>> the vDPA driver more compact and easier to be implemented. >> Generally speaking, in the kernel, it is normal to not hoist code of >> out drivers into subsystems until 2-3 drivers are duplicating that >> code. It helps ensure the right design is used >> >> Jason > That's up to the sybsystem maintainer really, as there's also some > intuition involved in guessing a specific API is widely useful. > In-kernel APIs are flexible, if we find something isn't needed we just > drop it. > If I understand correctly. At least Intel (Ling Shan) and Brodcom (Rob)=20 doesn't want to deal with DMA stuffs in their driver. Anyway since the DMA bus operations is optional, driver may still choose=20 to do DMA by itself if they want even if it requires platform IOMMU to wo= rk. Thanks