Re: [PATCH vhost v7 00/11] virtio core prepares for AF_XDP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 25, 2023 at 04:21:53PM +0800, Xuan Zhuo wrote:
> On Tue, 25 Apr 2023 04:13:09 -0400, "Michael S. Tsirkin" <mst@xxxxxxxxxx> wrote:
> > On Tue, Apr 25, 2023 at 04:05:03PM +0800, Xuan Zhuo wrote:
> > > On Tue, 25 Apr 2023 03:51:47 -0400, "Michael S. Tsirkin" <mst@xxxxxxxxxx> wrote:
> > > > On Tue, Apr 25, 2023 at 03:36:02PM +0800, Xuan Zhuo wrote:
> > > > > ## About DMA APIs
> > > > >
> > > > > Now, virtio may can not work with DMA APIs when virtio features do not have
> > > > > VIRTIO_F_ACCESS_PLATFORM.
> > > > >
> > > > > 1. I tried to let DMA APIs return phy address by virtio-device. But DMA APIs just
> > > > >    work with the "real" devices.
> > > > > 2. I tried to let xsk support callballs to get phy address from virtio-net
> > > > >    driver as the dma address. But the maintainers of xsk may want to use dma-buf
> > > > >    to replace the DMA APIs. I think that may be a larger effort. We will wait
> > > > >    too long.
> > > > >
> > > > > So rethinking this, firstly, we can support premapped-dma only for devices with
> > > > > VIRTIO_F_ACCESS_PLATFORM. In the case of af-xdp, if the users want to use it,
> > > > > they have to update the device to support VIRTIO_F_RING_RESET, and they can also
> > > > > enable the device's VIRTIO_F_ACCESS_PLATFORM feature by the way.
> > > >
> > > > I don't understand this last sentence. If you think ring
> > > > reset can change device features then the answer is no, it can't.
> > >
> > >
> > > Sorry, I should remove "by the way".
> > >
> > >
> > > >
> > > > If you are saying device has to set VIRTIO_F_ACCESS_PLATFORM to
> > > > benefit from this work, that's fine at least as a first approach.
> > > > Note that setting VIRTIO_F_ACCESS_PLATFORM breaks old guests
> > > > (it's a secirity boundary), e.g. it is not available for
> > > > transitional devices.
> > > > So to support transitional devices, we might want to find another way to
> > > > address this down the road,
> > >
> > > Maybe dma-buf is a way. I'll look into it, especially some practice on xsk.
> > >
> > > > but as a first step, I agree just going with
> > > > DMA is fine.
> > >
> > >
> > > Thanks.
> >
> > Pls do make sure to disable the feature when !VIRTIO_F_ACCESS_PLATFORM
> > though.
> 
> If you refer to the implementation inside virtio-net, this feature will depend
> on the return of virtqueue_dma_dev().
> 
> But virtqueue_dma_dev() depends "use_dma_api". When xen_domain() is true and
> !VIRTIO_F_ACCESS_PLATFORM, the "use_dma_api" is true.
> 
> So what kind of situation do you mean?
> 
> Thanks.

E.g. a legacy device.

-- 
MST




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux