From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59941C433E0 for ; Thu, 24 Dec 2020 02:26:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 13FBB22571 for ; Thu, 24 Dec 2020 02:26:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728785AbgLXC00 (ORCPT ); Wed, 23 Dec 2020 21:26:26 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:32550 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728707AbgLXC00 (ORCPT ); Wed, 23 Dec 2020 21:26:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608776699; 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=JdMJ8HnlG5riluBKSxMPivzDGvzPYrwD7jfW+dFij+4=; b=MssOKCuMveF3r3K5h9JFVQdW7TOg/Ohcb2eNNDPfuzyfx95nCpuzPGeAsYKOiTD4SiVjGD j847a025MBNffLxQ4DaYXMkzHHS/oRsK7QZQXgGeHBA4LPWYYewQ8p5ML8sy/2Vi1mP2vD J9x3IdRZVPInWVNQlUGkBzxd6mGqGVY= 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-407-z5fT8538NHm7DeP68XxA3w-1; Wed, 23 Dec 2020 21:24:58 -0500 X-MC-Unique: z5fT8538NHm7DeP68XxA3w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 85A081005D4F; Thu, 24 Dec 2020 02:24:55 +0000 (UTC) Received: from [10.72.13.109] (ovpn-13-109.pek2.redhat.com [10.72.13.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4130D60C04; Thu, 24 Dec 2020 02:24:31 +0000 (UTC) Subject: Re: [RFC v2 00/13] Introduce VDUSE - vDPA Device in Userspace To: Yongji Xie Cc: "Michael S. Tsirkin" , Stefan Hajnoczi , sgarzare@redhat.com, Parav Pandit , akpm@linux-foundation.org, Randy Dunlap , Matthew Wilcox , viro@zeniv.linux.org.uk, axboe@kernel.dk, bcrl@kvack.org, corbet@lwn.net, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, kvm@vger.kernel.org, linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org References: <20201222145221.711-1-xieyongji@bytedance.com> From: Jason Wang Message-ID: <6e81f56a-0f95-248c-e88f-4190ca7f49a2@redhat.com> Date: Thu, 24 Dec 2020 10:24:29 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 2020/12/23 下午6:59, Yongji Xie wrote: > On Wed, Dec 23, 2020 at 2:38 PM Jason Wang wrote: >> >> On 2020/12/22 下午10:52, Xie Yongji wrote: >>> This series introduces a framework, which can be used to implement >>> vDPA Devices in a userspace program. The work consist of two parts: >>> control path forwarding and data path offloading. >>> >>> In the control path, the VDUSE driver will make use of message >>> mechnism to forward the config operation from vdpa bus driver >>> to userspace. Userspace can use read()/write() to receive/reply >>> those control messages. >>> >>> In the data path, the core is mapping dma buffer into VDUSE >>> daemon's address space, which can be implemented in different ways >>> depending on the vdpa bus to which the vDPA device is attached. >>> >>> In virtio-vdpa case, we implements a MMU-based on-chip IOMMU driver with >>> bounce-buffering mechanism to achieve that. >> >> Rethink about the bounce buffer stuffs. I wonder instead of using kernel >> pages with mmap(), how about just use userspace pages like what vhost did? >> >> It means we need a worker to do bouncing but we don't need to care about >> annoying stuffs like page reclaiming? >> > Now the I/O bouncing is done in the streaming DMA mapping routines > which can be called from interrupt context. If we put this into a > kworker, that means we need to synchronize with a kworker in an > interrupt context. I think it can't work. We just need to make sure the buffer is ready before the user is trying to access them. But I admit it would be tricky (require shadow virtqueue etc) which is probably not a good idea. Thanks > > Thanks, > Yongji >