Re: [RFC v1 PATCH 3/3] driver: update all the code that use soc_device_match
On Mon, Apr 19, 2021 at 12:27:22PM +0800, Alice Guo (OSS) wrote: > From: Alice Guo > > Update all the code that use soc_device_match because add support for > soc_device_match returning -EPROBE_DEFER. > > Signed-off-by: Alice Guo > --- > drivers/bus/ti-sysc.c | 2 +- > drivers/clk/renesas/r8a7795-cpg-mssr.c| 4 +++- > drivers/clk/renesas/rcar-gen2-cpg.c | 2 +- > drivers/clk/renesas/rcar-gen3-cpg.c | 2 +- > drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c | 7 ++- > drivers/dma/ti/k3-psil.c | 3 +++ > drivers/dma/ti/k3-udma.c | 2 +- > drivers/gpu/drm/bridge/nwl-dsi.c | 2 +- > drivers/gpu/drm/meson/meson_drv.c | 4 +++- > drivers/gpu/drm/omapdrm/dss/dispc.c | 2 +- > drivers/gpu/drm/omapdrm/dss/dpi.c | 4 +++- > drivers/gpu/drm/omapdrm/dss/dsi.c | 3 +++ > drivers/gpu/drm/omapdrm/dss/dss.c | 3 +++ > drivers/gpu/drm/omapdrm/dss/hdmi4_core.c | 3 +++ > drivers/gpu/drm/omapdrm/dss/venc.c| 4 +++- > drivers/gpu/drm/omapdrm/omap_drv.c| 3 +++ > drivers/gpu/drm/rcar-du/rcar_du_crtc.c| 4 +++- > drivers/gpu/drm/rcar-du/rcar_lvds.c | 2 +- > drivers/gpu/drm/tidss/tidss_dispc.c | 4 +++- > drivers/iommu/ipmmu-vmsa.c| 7 +-- > drivers/media/platform/rcar-vin/rcar-core.c | 2 +- > drivers/media/platform/rcar-vin/rcar-csi2.c | 2 +- > drivers/media/platform/vsp1/vsp1_uif.c| 4 +++- > drivers/mmc/host/renesas_sdhi_core.c | 2 +- > drivers/mmc/host/renesas_sdhi_internal_dmac.c | 2 +- > drivers/mmc/host/sdhci-of-esdhc.c | 21 ++- > drivers/mmc/host/sdhci-omap.c | 2 +- > drivers/mmc/host/sdhci_am654.c| 2 +- > drivers/net/ethernet/renesas/ravb_main.c | 4 +++- > drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 +- > drivers/net/ethernet/ti/cpsw.c| 2 +- > drivers/net/ethernet/ti/cpsw_new.c| 2 +- > drivers/phy/ti/phy-omap-usb2.c| 4 +++- > drivers/pinctrl/renesas/core.c| 2 +- > drivers/pinctrl/renesas/pfc-r8a7790.c | 5 - > drivers/pinctrl/renesas/pfc-r8a7794.c | 5 - > drivers/soc/fsl/dpio/dpio-driver.c| 13 > drivers/soc/renesas/r8a774c0-sysc.c | 5 - > drivers/soc/renesas/r8a7795-sysc.c| 2 +- > drivers/soc/renesas/r8a77990-sysc.c | 5 - > drivers/soc/ti/k3-ringacc.c | 2 +- > drivers/staging/mt7621-pci/pci-mt7621.c | 2 +- > drivers/thermal/rcar_gen3_thermal.c | 4 +++- > drivers/thermal/ti-soc-thermal/ti-bandgap.c | 10 +++-- > drivers/usb/gadget/udc/renesas_usb3.c | 2 +- > drivers/usb/host/ehci-platform.c | 4 +++- > drivers/usb/host/xhci-rcar.c | 2 +- > drivers/watchdog/renesas_wdt.c| 2 +- > 48 files changed, 131 insertions(+), 52 deletions(-) > > diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c > index 5fae60f8c135..00c59aa217c1 100644 > --- a/drivers/bus/ti-sysc.c > +++ b/drivers/bus/ti-sysc.c > @@ -2909,7 +2909,7 @@ static int sysc_init_soc(struct sysc *ddata) > } > > match = soc_device_match(sysc_soc_feat_match); > - if (!match) > + if (!match || IS_ERR(match)) > return 0; > > if (match->data) > diff --git a/drivers/clk/renesas/r8a7795-cpg-mssr.c > b/drivers/clk/renesas/r8a7795-cpg-mssr.c > index c32d2c678046..90a18336a4c3 100644 > --- a/drivers/clk/renesas/r8a7795-cpg-mssr.c > +++ b/drivers/clk/renesas/r8a7795-cpg-mssr.c > @@ -439,6 +439,7 @@ static const unsigned int r8a7795es2_mod_nullify[] > __initconst = { > > static int __init r8a7795_cpg_mssr_init(struct device *dev) > { > + const struct soc_device_attribute *match; > const struct rcar_gen3_cpg_pll_config *cpg_pll_config; > u32 cpg_mode; > int error; > @@ -453,7 +454,8 @@ static int __init r8a7795_cpg_mssr_init(struct device > *dev) > return -EINVAL; > } > > - if (soc_device_match(r8a7795es1)) { > + match = soc_device_match(r8a7795es1); > + if (!IS_ERR(match) && match) { "if (!IS_ERR_OR_NULL(match))" in all places. Thanks
Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce
On Tue, Nov 20, 2018 at 11:07:02AM +0800, Kenneth Lee wrote: > On Mon, Nov 19, 2018 at 11:49:54AM -0700, Jason Gunthorpe wrote: > > Date: Mon, 19 Nov 2018 11:49:54 -0700 > > From: Jason Gunthorpe > > To: Kenneth Lee > > CC: Leon Romanovsky , Kenneth Lee , > > Tim Sell , linux-...@vger.kernel.org, Alexander > > Shishkin , Zaibo Xu > > , zhangfei@foxmail.com, linux...@huawei.com, > > haojian.zhu...@linaro.org, Christoph Lameter , Hao Fang > > , Gavin Schenk , RDMA mailing > > list , Zhou Wang , > > Doug Ledford , Uwe Kleine-König > > , David Kershner > > , Johan Hovold , Cyrille > > Pitchen , Sagar Dharia > > , Jens Axboe , > > guodong...@linaro.org, linux-netdev , Randy Dunlap > > , linux-ker...@vger.kernel.org, Vinod Koul > > , linux-crypto@vger.kernel.org, Philippe Ombredanne > > , Sanyog Kale , "David S. > > Miller" , linux-accelerat...@lists.ozlabs.org > > Subject: Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce > > User-Agent: Mutt/1.9.4 (2018-02-28) > > Message-ID: <20181119184954.gb4...@ziepe.ca> > > > > On Mon, Nov 19, 2018 at 05:14:05PM +0800, Kenneth Lee wrote: > > > > > If the hardware cannot share page table with the CPU, we then need to have > > > some way to change the device page table. This is what happen in ODP. It > > > invalidates the page table in device upon mmu_notifier call back. But > > > this cannot > > > solve the COW problem: if the user process A share a page P with device, > > > and A > > > forks a new process B, and it continue to write to the page. By COW, the > > > process B will keep the page P, while A will get a new page P'. But you > > > have > > > no way to let the device know it should use P' rather than P. > > > > Is this true? I thought mmu_notifiers covered all these cases. > > > > The mm_notifier for A should fire if B causes the physical address of > > A's pages to change via COW. > > > > And this causes the device page tables to re-synchronize. > > I don't see such code. The current do_cow_fault() implemenation has nothing to > do with mm_notifer. > > > > > > In WarpDrive/uacce, we make this simple. If you support IOMMU and it > > > support > > > SVM/SVA. Everything will be fine just like ODP implicit mode. And you > > > don't need > > > to write any code for that. Because it has been done by IOMMU framework. > > > If it > > > > Looks like the IOMMU code uses mmu_notifier, so it is identical to > > IB's ODP. The only difference is that IB tends to have the IOMMU page > > table in the device, not in the CPU. > > > > The only case I know if that is different is the new-fangled CAPI > > stuff where the IOMMU can directly use the CPU's page table and the > > IOMMU page table (in device or CPU) is eliminated. > > > > Yes. We are not focusing on the current implementation. As mentioned in the > cover letter. We are expecting Jean Philips' SVA patch: > git://linux-arm.org/linux-jpb. > > > Anyhow, I don't think a single instance of hardware should justify an > > entire new subsystem. Subsystems are hard to make and without multiple > > hardware examples there is no way to expect that it would cover any > > future use cases. > > Yes. That's our first expectation. We can keep it with our driver. But because > there is no user driver support for any accelerator in mainline kernel. Even > the > well known QuickAssit has to be maintained out of tree. So we try to see if > people is interested in working together to solve the problem. > > > > > If all your driver needs is to mmap some PCI bar space, route > > interrupts and do DMA mapping then mediated VFIO is probably a good > > choice. > > Yes. That is what is done in our RFCv1/v2. But we accepted Jerome's opinion > and > try not to add complexity to the mm subsystem. > > > > > If it needs to do a bunch of other stuff, not related to PCI bar > > space, interrupts and DMA mapping (ie special code for compression, > > crypto, AI, whatever) then you should probably do what Jerome said and > > make a drivers/char/hisillicon_foo_bar.c that exposes just what your > > hardware does. > > Yes. If no other accelerator driver writer is interested. That is the > expectation:) > > But we really like to have a public solution here. Consider this scenario: > > You create some connections (queues) to NIC, RSA, and AI engine. Then you got > data direct from t
Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce
On Mon, Nov 19, 2018 at 01:42:16PM -0500, Jerome Glisse wrote: > On Mon, Nov 19, 2018 at 11:27:52AM -0700, Jason Gunthorpe wrote: > > On Mon, Nov 19, 2018 at 11:48:54AM -0500, Jerome Glisse wrote: > > > > > Just to comment on this, any infiniband driver which use umem and do > > > not have ODP (here ODP for me means listening to mmu notifier so all > > > infiniband driver except mlx5) will be affected by same issue AFAICT. > > > > > > AFAICT there is no special thing happening after fork() inside any of > > > those driver. So if parent create a umem mr before fork() and program > > > hardware with it then after fork() the parent might start using new > > > page for the umem range while the old memory is use by the child. The > > > reverse is also true (parent using old memory and child new memory) > > > bottom line you can not predict which memory the child or the parent > > > will use for the range after fork(). > > > > > > So no matter what you consider the child or the parent, what the hw > > > will use for the mr is unlikely to match what the CPU use for the > > > same virtual address. In other word: > > > > > > Before fork: > > > CPU parent: virtual addr ptr1 -> physical address = 0xCAFE > > > HARDWARE: virtual addr ptr1 -> physical address = 0xCAFE > > > > > > Case 1: > > > CPU parent: virtual addr ptr1 -> physical address = 0xCAFE > > > CPU child: virtual addr ptr1 -> physical address = 0xDEAD > > > HARDWARE: virtual addr ptr1 -> physical address = 0xCAFE > > > > > > Case 2: > > > CPU parent: virtual addr ptr1 -> physical address = 0xBEEF > > > CPU child: virtual addr ptr1 -> physical address = 0xCAFE > > > HARDWARE: virtual addr ptr1 -> physical address = 0xCAFE > > > > IIRC this is solved in IB by automatically calling > > madvise(MADV_DONTFORK) before creating the MR. > > > > MADV_DONTFORK > > .. This is useful to prevent copy-on-write semantics from changing the > > physical location of a page if the parent writes to it after a > > fork(2) .. > > This would work around the issue but this is not transparent ie > range marked with DONTFORK no longer behave as expected from the > application point of view. > > Also it relies on userspace doing the right thing (which is not > something i usualy trust :)). The good thing that we didn't see anyone who succeeded to run IB stack without our user space, which does right thing under the hood :). > > Cheers, > Jérôme signature.asc Description: PGP signature
Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce
On Mon, Nov 19, 2018 at 05:19:10PM +0800, Kenneth Lee wrote: > On Mon, Nov 19, 2018 at 05:14:05PM +0800, Kenneth Lee wrote: > > Date: Mon, 19 Nov 2018 17:14:05 +0800 > > From: Kenneth Lee > > To: Leon Romanovsky > > CC: Tim Sell , linux-...@vger.kernel.org, > > Alexander Shishkin , Zaibo Xu > > , zhangfei@foxmail.com, linux...@huawei.com, > > haojian.zhu...@linaro.org, Christoph Lameter , Hao Fang > > , Gavin Schenk , RDMA mailing > > list , Vinod Koul , Jason > > Gunthorpe , Doug Ledford , Uwe > > Kleine-König , David Kershner > > , Kenneth Lee , Johan > > Hovold , Cyrille Pitchen > > , Sagar Dharia > > , Jens Axboe , > > guodong...@linaro.org, linux-netdev , Randy Dunlap > > , linux-ker...@vger.kernel.org, Zhou Wang > > , linux-crypto@vger.kernel.org, Philippe > > Ombredanne , Sanyog Kale , > > "David S. Miller" , > > linux-accelerat...@lists.ozlabs.org > > Subject: Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce > > User-Agent: Mutt/1.5.21 (2010-09-15) > > Message-ID: <20181119091405.GE157308@Turing-Arch-b> > > > > On Thu, Nov 15, 2018 at 04:54:55PM +0200, Leon Romanovsky wrote: > > > Date: Thu, 15 Nov 2018 16:54:55 +0200 > > > From: Leon Romanovsky > > > To: Kenneth Lee > > > CC: Kenneth Lee , Tim Sell , > > > linux-...@vger.kernel.org, Alexander Shishkin > > > , Zaibo Xu , > > > zhangfei@foxmail.com, linux...@huawei.com, haojian.zhu...@linaro.org, > > > Christoph Lameter , Hao Fang , > > > Gavin > > > Schenk , RDMA mailing list > > > , Zhou Wang , Jason > > > Gunthorpe , Doug Ledford , Uwe > > > Kleine-König , David Kershner > > > , Johan Hovold , Cyrille > > > Pitchen , Sagar Dharia > > > , Jens Axboe , > > > guodong...@linaro.org, linux-netdev , Randy > > > Dunlap > > > , linux-ker...@vger.kernel.org, Vinod Koul > > > , linux-crypto@vger.kernel.org, Philippe Ombredanne > > > , Sanyog Kale , "David S. > > > Miller" , linux-accelerat...@lists.ozlabs.org > > > Subject: Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce > > > User-Agent: Mutt/1.10.1 (2018-07-13) > > > Message-ID: <20181115145455.gn3...@mtr-leonro.mtl.com> > > > > > > On Thu, Nov 15, 2018 at 04:51:09PM +0800, Kenneth Lee wrote: > > > > On Wed, Nov 14, 2018 at 06:00:17PM +0200, Leon Romanovsky wrote: > > > > > Date: Wed, 14 Nov 2018 18:00:17 +0200 > > > > > From: Leon Romanovsky > > > > > To: Kenneth Lee > > > > > CC: Tim Sell , linux-...@vger.kernel.org, > > > > > Alexander Shishkin , Zaibo Xu > > > > > , zhangfei@foxmail.com, linux...@huawei.com, > > > > > haojian.zhu...@linaro.org, Christoph Lameter , Hao > > > > > Fang > > > > > , Gavin Schenk , RDMA > > > > > mailing > > > > > list , Zhou Wang > > > > > , > > > > > Jason Gunthorpe , Doug Ledford , > > > > > Uwe > > > > > Kleine-König , David Kershner > > > > > , Johan Hovold , Cyrille > > > > > Pitchen , Sagar Dharia > > > > > , Jens Axboe , > > > > > guodong...@linaro.org, linux-netdev , Randy > > > > > Dunlap > > > > > , linux-ker...@vger.kernel.org, Vinod Koul > > > > > , linux-crypto@vger.kernel.org, Philippe Ombredanne > > > > > , Sanyog Kale , > > > > > Kenneth Lee > > > > > , "David S. Miller" , > > > > > linux-accelerat...@lists.ozlabs.org > > > > > Subject: Re: [RFCv3 PATCH 1/6] uacce: Add documents for > > > > > WarpDrive/uacce > > > > > User-Agent: Mutt/1.10.1 (2018-07-13) > > > > > Message-ID: <20181114160017.gi3...@mtr-leonro.mtl.com> > > > > > > > > > > On Wed, Nov 14, 2018 at 10:58:09AM +0800, Kenneth Lee wrote: > > > > > > > > > > > > 在 2018/11/13 上午8:23, Leon Romanovsky 写道: > > > > > > > On Mon, Nov 12, 2018 at 03:58:02PM +0800, Kenneth Lee wrote: > > > > > > > > From: Kenneth Lee > > > > > > > > > > > > > > > > WarpDrive is a general accelerator framework for the user > > > > > > > > application to > > > > > > > > access the hardware without going through the ker
Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce
On Thu, Nov 15, 2018 at 04:51:09PM +0800, Kenneth Lee wrote: > On Wed, Nov 14, 2018 at 06:00:17PM +0200, Leon Romanovsky wrote: > > Date: Wed, 14 Nov 2018 18:00:17 +0200 > > From: Leon Romanovsky > > To: Kenneth Lee > > CC: Tim Sell , linux-...@vger.kernel.org, > > Alexander Shishkin , Zaibo Xu > > , zhangfei@foxmail.com, linux...@huawei.com, > > haojian.zhu...@linaro.org, Christoph Lameter , Hao Fang > > , Gavin Schenk , RDMA mailing > > list , Zhou Wang , > > Jason Gunthorpe , Doug Ledford , Uwe > > Kleine-König , David Kershner > > , Johan Hovold , Cyrille > > Pitchen , Sagar Dharia > > , Jens Axboe , > > guodong...@linaro.org, linux-netdev , Randy Dunlap > > , linux-ker...@vger.kernel.org, Vinod Koul > > , linux-crypto@vger.kernel.org, Philippe Ombredanne > > , Sanyog Kale , Kenneth Lee > > , "David S. Miller" , > > linux-accelerat...@lists.ozlabs.org > > Subject: Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce > > User-Agent: Mutt/1.10.1 (2018-07-13) > > Message-ID: <20181114160017.gi3...@mtr-leonro.mtl.com> > > > > On Wed, Nov 14, 2018 at 10:58:09AM +0800, Kenneth Lee wrote: > > > > > > 在 2018/11/13 上午8:23, Leon Romanovsky 写道: > > > > On Mon, Nov 12, 2018 at 03:58:02PM +0800, Kenneth Lee wrote: > > > > > From: Kenneth Lee > > > > > > > > > > WarpDrive is a general accelerator framework for the user application > > > > > to > > > > > access the hardware without going through the kernel in data path. > > > > > > > > > > The kernel component to provide kernel facility to driver for expose > > > > > the > > > > > user interface is called uacce. It a short name for > > > > > "Unified/User-space-access-intended Accelerator Framework". > > > > > > > > > > This patch add document to explain how it works. > > > > + RDMA and netdev folks > > > > > > > > Sorry, to be late in the game, I don't see other patches, but from > > > > the description below it seems like you are reinventing RDMA verbs > > > > model. I have hard time to see the differences in the proposed > > > > framework to already implemented in drivers/infiniband/* for the kernel > > > > space and for the https://github.com/linux-rdma/rdma-core/ for the user > > > > space parts. > > > > > > Thanks Leon, > > > > > > Yes, we tried to solve similar problem in RDMA. We also learned a lot from > > > the exist code of RDMA. But we we have to make a new one because we cannot > > > register accelerators such as AI operation, encryption or compression to > > > the > > > RDMA framework:) > > > > Assuming that you did everything right and still failed to use RDMA > > framework, you was supposed to fix it and not to reinvent new exactly > > same one. It is how we develop kernel, by reusing existing code. > > Yes, but we don't force other system such as NIC or GPU into RDMA, do we? You don't introduce new NIC or GPU, but proposing another interface to directly access HW memory and bypass kernel for the data path. This is whole idea of RDMA and this is why it is already present in the kernel. Various hardware devices are supported in our stack allow a ton of crazy stuff, including GPUs interconnections and NIC functionalities. > > I assume you would not agree to register a zip accelerator to infiniband? :) "infiniband" name in the "drivers/infiniband/" is legacy one and the current code supports IB, RoCE, iWARP and OmniPath as a transport layers. For a lone time, we wanted to rename that folder to be "drivers/rdma", but didn't find enough brave men/women to do it, due to backport mess for such move. The addition of zip accelerator to RDMA is possible and depends on how you will model such new functionality - new driver, or maybe new ULP. > > Further, I don't think it is wise to break an exist system (RDMA) to fulfill a > totally new scenario. The better choice is to let them run in parallel for > some > time and try to merge them accordingly. Awesome, so please run your code out-of-tree for now and once you are ready for submission let's try to merge it. > > > > > > > > > Another problem we tried to address is the way to pin the memory for dma > > > operation. The RDMA way to pin the memory cannot avoid the page lost due > > > to > > > copy-on-write operation during the memory is used by the device. T
Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce
On Wed, Nov 14, 2018 at 10:58:09AM +0800, Kenneth Lee wrote: > > 在 2018/11/13 上午8:23, Leon Romanovsky 写道: > > On Mon, Nov 12, 2018 at 03:58:02PM +0800, Kenneth Lee wrote: > > > From: Kenneth Lee > > > > > > WarpDrive is a general accelerator framework for the user application to > > > access the hardware without going through the kernel in data path. > > > > > > The kernel component to provide kernel facility to driver for expose the > > > user interface is called uacce. It a short name for > > > "Unified/User-space-access-intended Accelerator Framework". > > > > > > This patch add document to explain how it works. > > + RDMA and netdev folks > > > > Sorry, to be late in the game, I don't see other patches, but from > > the description below it seems like you are reinventing RDMA verbs > > model. I have hard time to see the differences in the proposed > > framework to already implemented in drivers/infiniband/* for the kernel > > space and for the https://github.com/linux-rdma/rdma-core/ for the user > > space parts. > > Thanks Leon, > > Yes, we tried to solve similar problem in RDMA. We also learned a lot from > the exist code of RDMA. But we we have to make a new one because we cannot > register accelerators such as AI operation, encryption or compression to the > RDMA framework:) Assuming that you did everything right and still failed to use RDMA framework, you was supposed to fix it and not to reinvent new exactly same one. It is how we develop kernel, by reusing existing code. > > Another problem we tried to address is the way to pin the memory for dma > operation. The RDMA way to pin the memory cannot avoid the page lost due to > copy-on-write operation during the memory is used by the device. This may > not be important to RDMA library. But it is important to accelerator. Such support exists in drivers/infiniband/ from late 2014 and it is called ODP (on demand paging). > > Hope this can help the understanding. Yes, it helped me a lot. Now, I'm more than before convinced that this whole patchset shouldn't exist in the first place. To be clear, NAK. Thanks > > Cheers > > > > > Hard NAK from RDMA side. > > > > Thanks > > > > > Signed-off-by: Kenneth Lee > > > --- > > > Documentation/warpdrive/warpdrive.rst | 260 +++ > > > Documentation/warpdrive/wd-arch.svg | 764 > > > Documentation/warpdrive/wd.svg | 526 ++ > > > Documentation/warpdrive/wd_q_addr_space.svg | 359 + > > > 4 files changed, 1909 insertions(+) > > > create mode 100644 Documentation/warpdrive/warpdrive.rst > > > create mode 100644 Documentation/warpdrive/wd-arch.svg > > > create mode 100644 Documentation/warpdrive/wd.svg > > > create mode 100644 Documentation/warpdrive/wd_q_addr_space.svg > > > > > > diff --git a/Documentation/warpdrive/warpdrive.rst > > > b/Documentation/warpdrive/warpdrive.rst > > > new file mode 100644 > > > index ..ef84d3a2d462 > > > --- /dev/null > > > +++ b/Documentation/warpdrive/warpdrive.rst > > > @@ -0,0 +1,260 @@ > > > +Introduction of WarpDrive > > > += > > > + > > > +*WarpDrive* is a general accelerator framework for the user application > > > to > > > +access the hardware without going through the kernel in data path. > > > + > > > +It can be used as the quick channel for accelerators, network adaptors or > > > +other hardware for application in user space. > > > + > > > +This may make some implementation simpler. E.g. you can reuse most of > > > the > > > +*netdev* driver in kernel and just share some ring buffer to the user > > > space > > > +driver for *DPDK* [4] or *ODP* [5]. Or you can combine the RSA > > > accelerator with > > > +the *netdev* in the user space as a https reversed proxy, etc. > > > + > > > +*WarpDrive* takes the hardware accelerator as a heterogeneous processor > > > which > > > +can share particular load from the CPU: > > > + > > > +.. image:: wd.svg > > > +:alt: WarpDrive Concept > > > + > > > +The virtual concept, queue, is used to manage the requests sent to the > > > +accelerator. The application send requests to the queue by writing to > > > some > > > +particular address, while the hardware takes the requests directly from > > > the > > &g
Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce
On Mon, Nov 12, 2018 at 03:58:02PM +0800, Kenneth Lee wrote: > From: Kenneth Lee > > WarpDrive is a general accelerator framework for the user application to > access the hardware without going through the kernel in data path. > > The kernel component to provide kernel facility to driver for expose the > user interface is called uacce. It a short name for > "Unified/User-space-access-intended Accelerator Framework". > > This patch add document to explain how it works. + RDMA and netdev folks Sorry, to be late in the game, I don't see other patches, but from the description below it seems like you are reinventing RDMA verbs model. I have hard time to see the differences in the proposed framework to already implemented in drivers/infiniband/* for the kernel space and for the https://github.com/linux-rdma/rdma-core/ for the user space parts. Hard NAK from RDMA side. Thanks > > Signed-off-by: Kenneth Lee > --- > Documentation/warpdrive/warpdrive.rst | 260 +++ > Documentation/warpdrive/wd-arch.svg | 764 > Documentation/warpdrive/wd.svg | 526 ++ > Documentation/warpdrive/wd_q_addr_space.svg | 359 + > 4 files changed, 1909 insertions(+) > create mode 100644 Documentation/warpdrive/warpdrive.rst > create mode 100644 Documentation/warpdrive/wd-arch.svg > create mode 100644 Documentation/warpdrive/wd.svg > create mode 100644 Documentation/warpdrive/wd_q_addr_space.svg > > diff --git a/Documentation/warpdrive/warpdrive.rst > b/Documentation/warpdrive/warpdrive.rst > new file mode 100644 > index ..ef84d3a2d462 > --- /dev/null > +++ b/Documentation/warpdrive/warpdrive.rst > @@ -0,0 +1,260 @@ > +Introduction of WarpDrive > += > + > +*WarpDrive* is a general accelerator framework for the user application to > +access the hardware without going through the kernel in data path. > + > +It can be used as the quick channel for accelerators, network adaptors or > +other hardware for application in user space. > + > +This may make some implementation simpler. E.g. you can reuse most of the > +*netdev* driver in kernel and just share some ring buffer to the user space > +driver for *DPDK* [4] or *ODP* [5]. Or you can combine the RSA accelerator > with > +the *netdev* in the user space as a https reversed proxy, etc. > + > +*WarpDrive* takes the hardware accelerator as a heterogeneous processor which > +can share particular load from the CPU: > + > +.. image:: wd.svg > +:alt: WarpDrive Concept > + > +The virtual concept, queue, is used to manage the requests sent to the > +accelerator. The application send requests to the queue by writing to some > +particular address, while the hardware takes the requests directly from the > +address and send feedback accordingly. > + > +The format of the queue may differ from hardware to hardware. But the > +application need not to make any system call for the communication. > + > +*WarpDrive* tries to create a shared virtual address space for all involved > +accelerators. Within this space, the requests sent to queue can refer to any > +virtual address, which will be valid to the application and all involved > +accelerators. > + > +The name *WarpDrive* is simply a cool and general name meaning the framework > +makes the application faster. It includes general user library, kernel > +management module and drivers for the hardware. In kernel, the management > +module is called *uacce*, meaning "Unified/User-space-access-intended > +Accelerator Framework". > + > + > +How does it work > + > + > +*WarpDrive* uses *mmap* and *IOMMU* to play the trick. > + > +*Uacce* creates a chrdev for the device registered to it. A "queue" will be > +created when the chrdev is opened. The application access the queue by mmap > +different address region of the queue file. > + > +The following figure demonstrated the queue file address space: > + > +.. image:: wd_q_addr_space.svg > +:alt: WarpDrive Queue Address Space > + > +The first region of the space, device region, is used for the application to > +write request or read answer to or from the hardware. > + > +Normally, there can be three types of device regions mmio and memory regions. > +It is recommended to use common memory for request/answer descriptors and use > +the mmio space for device notification, such as doorbell. But of course, this > +is all up to the interface designer. > + > +There can be two types of device memory regions, kernel-only and user-shared. > +This will be explained in the "kernel APIs" section. > + > +The Static Share Virtual Memory region is necessary only when the device > IOMMU > +does not support "Share Virtual Memory". This will be explained after the > +*IOMMU* idea. > + > + > +Architecture > + > + > +The full *WarpDrive* architecture is represented in the following class > +diagram: > + > +.. image:: wd-arch.svg > +:alt: WarpDrive Architecture > + >
Re: export pcie_flr and remove copies of it in drivers V2
On Wed, Apr 19, 2017 at 08:37:37AM +0300, Leon Romanovsky wrote: > On Tue, Apr 18, 2017 at 01:36:12PM -0500, Bjorn Helgaas wrote: > > On Fri, Apr 14, 2017 at 09:11:24PM +0200, Christoph Hellwig wrote: > > > Hi all, > > > > > > this exports the PCI layer pcie_flr helper, and removes various opencoded > > > copies of it. > > > > > > Changes since V1: > > > - rebase on top of the pci/virtualization branch > > > - fixed the probe case in __pci_dev_reset > > > - added ACKs from Bjorn > > > > Applied the first three patches: > > > > bc13871ef35a PCI: Export pcie_flr() > > e641c375d414 PCI: Call pcie_flr() from reset_intel_82599_sfp_virtfn() > > 40e0901ea4bf PCI: Call pcie_flr() from reset_chelsio_generic_dev() > > > > Bjorn, > > How do you suggest to proceed with other patches? They should be applied > to your tree either, because they depend on "bc13871ef35a PCI: Export > pcie_flr()". I finally caught the old emails and found the answer by myself. http://marc.info/?l=linux-rdma&m=149218545228343&w=2 Thanks > > Thanks > > > > to pci/virtualization for v4.12, thanks! signature.asc Description: PGP signature
Re: export pcie_flr and remove copies of it in drivers V2
On Tue, Apr 18, 2017 at 01:36:12PM -0500, Bjorn Helgaas wrote: > On Fri, Apr 14, 2017 at 09:11:24PM +0200, Christoph Hellwig wrote: > > Hi all, > > > > this exports the PCI layer pcie_flr helper, and removes various opencoded > > copies of it. > > > > Changes since V1: > > - rebase on top of the pci/virtualization branch > > - fixed the probe case in __pci_dev_reset > > - added ACKs from Bjorn > > Applied the first three patches: > > bc13871ef35a PCI: Export pcie_flr() > e641c375d414 PCI: Call pcie_flr() from reset_intel_82599_sfp_virtfn() > 40e0901ea4bf PCI: Call pcie_flr() from reset_chelsio_generic_dev() > Bjorn, How do you suggest to proceed with other patches? They should be applied to your tree either, because they depend on "bc13871ef35a PCI: Export pcie_flr()". Thanks > to pci/virtualization for v4.12, thanks! signature.asc Description: PGP signature