Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3417830ybl; Mon, 20 Jan 2020 23:59:11 -0800 (PST) X-Google-Smtp-Source: APXvYqyByP2ZZ0b7E/r1YPCEPPFdOjIkGSEP0VgWj2dWsM5iKmt7rhoqr3Kz51IXmzt2prNhrRlp X-Received: by 2002:aca:5144:: with SMTP id f65mr468892oib.5.1579593551312; Mon, 20 Jan 2020 23:59:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579593551; cv=none; d=google.com; s=arc-20160816; b=FThZQJwni726A7acy6BbG2F99rkOj3wFublPNxkxxs8pBWwexyID9XN9Qa5J1janXQ TKjMLRqfCSpTgyESpOsDV2Z7fYCFBbBsVX+LjNmN3a/QFk1CEH+AX0qezPZw0gsO7FwP QCCv/ceh4KFgl9g5xn7HceDs53yl6PH1ulnvEFOOO4ByLc9xQnuCLEaUpbniVYEC14v+ v5dt9nmW+Bqw4k2Za6DPZQBwdt2xiH9Q21fN+kp0nNYWWjwgbH7Z98w/2OAvCOGVktwJ LKYocFfNGmE5Xs8IHWIwx63MWG43+ilohUvIzl39n2iYodgG1cGXYKToAfi+SK3+KyfP N32g== 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=fHgdj4+QyHLUaUegzU6HDHgoygSNPCN+x1Fke+h7szM=; b=vZKHtdAwqnaas3fw0v/q3x3IVjVOFnR8Xga3+k0vcSfo1cUeFsIz9CX5CaEO3nEJ+A QrLCmEulIMA2EoMq8ZAXgBwpuegieMVhpfwuTi95i5vkznQRrNDidSIDbjRPnF2o5MxM X2tg5Z21Gyq9D9Wl90Vr1Q/66v32i7ftARvJYQix+tnY4MuGcL2/IcQICK9CUYK4AgiN slxXwRDfP01qT3RBcm1FTWxyFq0jjoYjUWVg4v1NZZpbdrSDoffECQX/rg+r+pCDELRf gSShcD7N1p5CSucTRR4PLMg8M0siE3pdkKvS3pHyGgwAajHmEwDsHgpcXqdiTOsMDl8R JQ3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FcoTTLoG; 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 m90si21289843otc.259.2020.01.20.23.58.59; Mon, 20 Jan 2020 23:59:11 -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=FcoTTLoG; 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 S1728816AbgAUH5y (ORCPT + 99 others); Tue, 21 Jan 2020 02:57:54 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:59476 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725789AbgAUH5y (ORCPT ); Tue, 21 Jan 2020 02:57:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579593472; 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=fHgdj4+QyHLUaUegzU6HDHgoygSNPCN+x1Fke+h7szM=; b=FcoTTLoGB9J5UGg299GDJZMK7IKLIf1/AiGGqvm1xb7K4gZUVsVjplczud2Ji62ohpFS4U ZI8ZT3y8phx+YqKQv7jxHp2hVUl5U2uyIFyTyUq4mv/QpjtKCa5KtNxZK+n/EBTEVru52t MlcuLvuw/zZjMyFpGeX4TkoGzTw6240= 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-367-mcFzT5QdNfSlCBvpmZk-Kg-1; Tue, 21 Jan 2020 02:57:50 -0500 X-MC-Unique: mcFzT5QdNfSlCBvpmZk-Kg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DE3871005510; Tue, 21 Jan 2020 07:57:46 +0000 (UTC) Received: from [10.72.12.103] (ovpn-12-103.pek2.redhat.com [10.72.12.103]) by smtp.corp.redhat.com (Postfix) with ESMTP id A313319C6A; Tue, 21 Jan 2020 07:57:30 +0000 (UTC) Subject: Re: [PATCH 3/5] vDPA: introduce vDPA bus To: Shahaf Shuler , "Michael S. Tsirkin" Cc: Jason Gunthorpe , Rob Miller , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , Netdev , "Bie, Tiwei" , "maxime.coquelin@redhat.com" , "Liang, Cunming" , "Wang, Zhihong" , "Wang, Xiao W" , "haotian.wang@sifive.com" , "Zhu, Lingshan" , "eperezma@redhat.com" , "lulu@redhat.com" , Parav Pandit , "Tian, Kevin" , "stefanha@redhat.com" , "rdunlap@infradead.org" , "hch@infradead.org" , Ariel Adam , "jakub.kicinski@netronome.com" , Jiri Pirko , "hanand@xilinx.com" , "mhabets@solarflare.com" References: <20200116124231.20253-4-jasowang@redhat.com> <20200117070324-mutt-send-email-mst@kernel.org> <239b042c-2d9e-0eec-a1ef-b03b7e2c5419@redhat.com> <20200120174933.GB3891@mellanox.com> <20200120162449-mutt-send-email-mst@kernel.org> <20200120165640-mutt-send-email-mst@kernel.org> From: Jason Wang Message-ID: Date: Tue, 21 Jan 2020 15:57:29 +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: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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/1/21 =E4=B8=8B=E5=8D=882:01, Shahaf Shuler wrote: > Tuesday, January 21, 2020 12:00 AM, Michael S. Tsirkin: >> Subject: Re: [PATCH 3/5] vDPA: introduce vDPA bus >> >> On Mon, Jan 20, 2020 at 09:47:18PM +0000, Shahaf Shuler wrote: >>> Monday, January 20, 2020 11:25 PM, Michael S. Tsirkin: >>>> Subject: Re: [PATCH 3/5] vDPA: introduce vDPA bus >>>> >>>> On Mon, Jan 20, 2020 at 08:51:43PM +0000, Shahaf Shuler wrote: >>>>> Monday, January 20, 2020 7:50 PM, Jason Gunthorpe: >>>>>> Subject: Re: [PATCH 3/5] vDPA: introduce vDPA bus >>>>>> >>>>>> On Mon, Jan 20, 2020 at 04:43:53PM +0800, Jason Wang wrote: >>>>>>> This is similar to the design of platform IOMMU part of >>>>>>> vhost-vdpa. We decide to send diffs to platform IOMMU there. >>>>>>> If it's ok to do that in driver, we can replace set_map with >>>>>>> incremental API >>>> like map()/unmap(). >>>>>>> Then driver need to maintain rbtree itself. >>>>>> I think we really need to see two modes, one where there is a >>>>>> fixed translation without dynamic vIOMMU driven changes and one >>>>>> that supports vIOMMU. >>>>>> >>>>>> There are different optimization goals in the drivers for these >>>>>> two configurations. >>>>> +1. >>>>> It will be best to have one API for static config (i.e. mapping >>>>> can be set only before virtio device gets active), and one API for >>>>> dynamic changes that can be set after the virtio device is active. >>>> Frankly I don't see when we'd use the static one. >>>> Memory hotplug is enabled for most guests... >>> The fact memory hotplug is enabled doesn't necessarily means there is= not >> cold-plugged memory on the hot plugged slots. >>> So your claim is majority of guests are deployed w/o any cold-plugged >> memory? >> >> Sorry for not being clear. I was merely saying that dynamic one can't = be >> optional, and static one can. So how about we start just with the dyna= mic >> one, then add the static one as a later optimization? > Since we have the use case (cold plugged memory to guest, e.g. when pop= ulated w/ hugepages) I think we should start w/ both. The static one can = be optional for drivers. > > Moreover am not yet clear about the suggested API for dynamic, can you = share the prototype you have in mind? > Also will it be : > 1. multiple add_map and then flag the driver to set > Or > 2. each add_map should be set by the driver as stand alone. For dynamic one, it looks to me that introducing add_map()/del_map() bus=20 operations is much more cleaner than reusing current set_map() one. Thanks >