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=-13.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 843CAC433E9 for ; Wed, 27 Jan 2021 09:03:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A0B320723 for ; Wed, 27 Jan 2021 09:03:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234803AbhA0JCr (ORCPT ); Wed, 27 Jan 2021 04:02:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234293AbhA0JAc (ORCPT ); Wed, 27 Jan 2021 04:00:32 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A50B2C061756 for ; Wed, 27 Jan 2021 00:59:51 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id a14so1468412edu.7 for ; Wed, 27 Jan 2021 00:59:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Rw8yUZegb4yxEqGgwbp3Nqb3zTKD2qO65+bJx8qvjDQ=; b=rxoSgpUALgCJbFIFKiPhxXAPyX8odUJ6YF7W7K1OO80Lqa2/eyBBguWA1Cmx2+9qIi eDM4GyvWFQh8BJv9awijipeIMNCIzJoavvmrAu1KgXpoN0nZMbhTYPuQfSK6Yn0OJ5HD YX9GTbpMFtzEZx+vVNCedpruNziRt2sNYtmU2nolnVylIuF15e5FX0mg1LHYVAJCUY1A ZQD0ydpwb8flTReZClu2d5oNuj8bQrC6yJSUYgycf6iDIfSuVOqmqWNFauWpcV+qjbuu xaHa6DmRFnrnrommb8x9U7p/NRCX6JnzK+IQFIYqJxmC8mLicgfXrj23FFCT0OmewJjk VxxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Rw8yUZegb4yxEqGgwbp3Nqb3zTKD2qO65+bJx8qvjDQ=; b=UF5iDsPo7VnQK/uaL++4pbzdGLc6fxqE9/UUTns6gvrYDQI3bE7M9byBSn45CXWB/T lCKLA+fphSrpLFHT5WXhWHMZo+mgPS7yoGScBnn5w4+46m0IFlpEL0P7+Juns2Gk1hcN L5Yz5RJqwKwPurCBVju/S6B06yjAsbOTe6gYSgu49KeRhtxdPbTGWh0smzYWH5sfsOeK AB675K2quOFTtIzddDtMmwkkkvwE63WpZIsdhscLGB9DA0pB9MkRYSfSe0+dvu5M8xbu Co57peIVQYgNuy+elkkFvINntUmdsy+zPf6himuvnjs4cudl3ragB6hsw6e1U8zlLbsJ 6i8w== X-Gm-Message-State: AOAM530NaqdVab24ZhVe+J9pPsQsREptftfeazt3VHjagzY+zs1wvG0S giYeDs+8hAXSrgLzNGVn6+bUrR4O6F+bMYhsvjTA X-Google-Smtp-Source: ABdhPJx51mihWsWUedzTQ87/wxlPosUbhcgbkadydrgOhjI8COenRfD2+yCv8E4CENKpyt9SeWNbKozPfxnYbMhHWss= X-Received: by 2002:a05:6402:228a:: with SMTP id cw10mr7789120edb.195.1611737990371; Wed, 27 Jan 2021 00:59:50 -0800 (PST) MIME-Version: 1.0 References: <20210119045920.447-1-xieyongji@bytedance.com> <20210119050756.600-1-xieyongji@bytedance.com> <20210119050756.600-2-xieyongji@bytedance.com> <1f419a24-cd53-bd73-5b8a-8ab5d976a490@redhat.com> In-Reply-To: <1f419a24-cd53-bd73-5b8a-8ab5d976a490@redhat.com> From: Yongji Xie Date: Wed, 27 Jan 2021 16:59:39 +0800 Message-ID: Subject: Re: Re: [RFC v3 08/11] vduse: Introduce VDUSE - vDPA Device in Userspace To: Jason Wang Cc: "Michael S. Tsirkin" , Stefan Hajnoczi , sgarzare@redhat.com, Parav Pandit , Bob Liu , Christoph Hellwig , Randy Dunlap , Matthew Wilcox , viro@zeniv.linux.org.uk, axboe@kernel.dk, bcrl@kvack.org, Jonathan Corbet , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, kvm@vger.kernel.org, linux-aio@kvack.org, linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Tue, Jan 26, 2021 at 4:19 PM Jason Wang wrote: > > > On 2021/1/19 =E4=B8=8B=E5=8D=881:07, Xie Yongji wrote: > > This VDUSE driver enables implementing vDPA devices in userspace. > > Both control path and data path of vDPA devices will be able to > > be handled in userspace. > > > > 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, VDUSE_IOTLB_GET_FD ioctl will be used to get > > the file descriptors referring to vDPA device's iova regions. Then > > userspace can use mmap() to access those iova regions. Besides, > > the eventfd mechanism is used to trigger interrupt callbacks and > > receive virtqueue kicks in userspace. > > > > Signed-off-by: Xie Yongji > > --- > > Documentation/driver-api/vduse.rst | 85 ++ > > Documentation/userspace-api/ioctl/ioctl-number.rst | 1 + > > drivers/vdpa/Kconfig | 7 + > > drivers/vdpa/Makefile | 1 + > > drivers/vdpa/vdpa_user/Makefile | 5 + > > drivers/vdpa/vdpa_user/eventfd.c | 221 ++++ > > drivers/vdpa/vdpa_user/eventfd.h | 48 + > > drivers/vdpa/vdpa_user/iova_domain.c | 426 +++++++ > > drivers/vdpa/vdpa_user/iova_domain.h | 68 ++ > > drivers/vdpa/vdpa_user/vduse.h | 62 + > > drivers/vdpa/vdpa_user/vduse_dev.c | 1217 +++++++++++= +++++++++ > > include/uapi/linux/vdpa.h | 1 + > > include/uapi/linux/vduse.h | 125 ++ > > 13 files changed, 2267 insertions(+) > > create mode 100644 Documentation/driver-api/vduse.rst > > create mode 100644 drivers/vdpa/vdpa_user/Makefile > > create mode 100644 drivers/vdpa/vdpa_user/eventfd.c > > create mode 100644 drivers/vdpa/vdpa_user/eventfd.h > > create mode 100644 drivers/vdpa/vdpa_user/iova_domain.c > > create mode 100644 drivers/vdpa/vdpa_user/iova_domain.h > > create mode 100644 drivers/vdpa/vdpa_user/vduse.h > > create mode 100644 drivers/vdpa/vdpa_user/vduse_dev.c > > create mode 100644 include/uapi/linux/vduse.h > > > Btw, if you could split this into three parts: > > 1) iova domain > 2) vduse device > 3) doc > > It would be more easier for the reviewers. > Make sense to me. Will do it in v4. Thanks, Yongji