Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1024100ybv; Wed, 5 Feb 2020 19:25:58 -0800 (PST) X-Google-Smtp-Source: APXvYqxXK9wOeVH3yBznYFfLORsWjxLxDXb5oeic/WggDkdvQkB7PHWb/0ER0rwTXmT8bpuK+Exc X-Received: by 2002:aca:d985:: with SMTP id q127mr5310752oig.132.1580959557994; Wed, 05 Feb 2020 19:25:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580959557; cv=none; d=google.com; s=arc-20160816; b=gKNDvgPPX2J1WrQyUkbAjplTQXIbEakocGVRl0L42Zld0eadciVqyIVhTkG6uRRj+e 8h0stPJeoaTH9o1YFGl0v6b4ynjByVb2ZMJrcPjUwEGrqyC6iCox0rCaCCEfNlPnk6Dw /N2VkTzgBx7nx0ax0v7vzJoKfi2HilDZG8QVuf07Qob/fkyawmQK420W6iH4vL+u51t4 KhFcr61WfWs6J+JS92ALjzWNSy8+UlvPNY6p18EczjOGYmjnTQnuIx8piORyvjQ4/ptm 0afx8jg2wDh1VvYvfgXFaQIBuLvB5268f6nE7YwuUv/3Sr2iP9JPqVnZYKeXDCsKZCnp qowQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=d8RFDTT3NX+3mBxAzVQdJoVb+6QwDhg+64Xl05rEh+w=; b=H4kim02Bi/17fEnKqxdZPJnxGvhJMHskkn793INL+Aa7jPuPEwPaMSL2UJsfK+eBUU 2Qqvfen4cEnwxog+02H9LjI96kt6gn1TUBqpQtP+B3uNEUNJ3yIujhDeKNAhvCSaydvg Mc+Budhlfss8Wt+lbKO6k2vDOCKATGtYZplLWkMVtihUiIibkEhNmHbNe5YedYsj1Ndb enR9A2DW0ZB9Sjd7Or1SIrhyqTkxObimNzfTE/3Hq6TodBm3oVvgagHjvhMlMspVSaP+ ibg04AuROLtVn7IUGf7RowcKHs3X6MZxRLkTjI79s+zMI+9NZEWX1f/YAsmC7VnWm2pc 3FCQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c7si1133245otf.87.2020.02.05.19.25.46; Wed, 05 Feb 2020 19:25:57 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727825AbgBFDVg (ORCPT + 99 others); Wed, 5 Feb 2020 22:21:36 -0500 Received: from mga09.intel.com ([134.134.136.24]:30365 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727474AbgBFDVg (ORCPT ); Wed, 5 Feb 2020 22:21:36 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Feb 2020 19:21:35 -0800 X-IronPort-AV: E=Sophos;i="5.70,408,1574150400"; d="scan'208";a="224871203" Received: from lingshan-mobl5.ccr.corp.intel.com (HELO [10.249.175.127]) ([10.249.175.127]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 05 Feb 2020 19:21:30 -0800 Subject: Re: [PATCH] vhost: introduce vDPA based backend To: Jason Wang , "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> <55b050d6-b31d-f8a2-2a15-0fc68896d47f@redhat.com> From: Zhu Lingshan Message-ID: <4b1753eb-b281-17e0-6636-849ac20cbe50@linux.intel.com> Date: Thu, 6 Feb 2020 11:21:27 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <55b050d6-b31d-f8a2-2a15-0fc68896d47f@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/6/2020 11:11 AM, Jason Wang wrote: > > On 2020/2/5 下午9: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 >>>>> device ? >>>>> Devices that needs the IOMMU will call iommu APIs from inside the >>>>> driver callback. >>>> Technically, this can work. But if it can be done by vhost-vpda it >>>> will 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) doesn't want to deal with DMA stuffs in their driver. > > Anyway since the DMA bus operations is optional, driver may still > choose to do DMA by itself if they want even if it requires platform > IOMMU to work. > > Thanks > Many Thanks if this could be done. The parent device has DMA capabilities and dma ops implemented, we hope can make use of it, as discussed in the vdpa thread.