On Tue, 18 Apr 2023 22:10:03 -0700, Christoph Hellwig
wrote:
> On Tue, Apr 18, 2023 at 02:18:52PM +0800, Xuan Zhuo wrote:
> > Sorry, rethink about this, I think we maybe misunderstand something.
> >
> > First of all, let me give you a brief introduce of virtio device and pci
> > device.
> > If
On Tue, Apr 18, 2023 at 02:18:52PM +0800, Xuan Zhuo wrote:
> Sorry, rethink about this, I think we maybe misunderstand something.
>
> First of all, let me give you a brief introduce of virtio device and pci
> device.
> If I make mistake, please point out.
>
>
> First, when one virtio pci
On Tue, 11 Apr 2023 05:16:19 -0700, Christoph Hellwig
wrote:
> On Tue, Apr 11, 2023 at 03:23:43PM +0800, Xuan Zhuo wrote:
> > > If a direct map or not is used is a decision done by the platform code,
> > > often based on firmware tables. You can't just override that.
> >
> >
> > Can Virtio
On Wed, Apr 12, 2023 at 10:03:46AM +0800, Xuan Zhuo wrote:
> We discusses this question last at [1]. We planned to pass one device to xsk.
> Then xsk can use the DMA API on this device. The device can be one hw
> device(such as PCI, mmio) or virtio device. If it is one hw device, no
> problem.
Here, this has cc the maintainers of AF_XDP.
For on the same page, I summarize it.
We discusses this question last at [1]. We planned to pass one device to xsk.
Then xsk can use the DMA API on this device. The device can be one hw
device(such as PCI, mmio) or virtio device. If it is one hw
On Tue, Apr 11, 2023 at 03:12:13PM +0800, Xuan Zhuo wrote:
>
> Hi Jason
>
> Can we force virtio core to use dma api without VIRTIO_F_ACCESS_PLATFORM?
So in your last mail you asked for it to be the other way around?
But, no you can't do this either unless you control the platform as
in the Xen
On Tue, Apr 11, 2023 at 03:23:43PM +0800, Xuan Zhuo wrote:
> > If a direct map or not is used is a decision done by the platform code,
> > often based on firmware tables. You can't just override that.
>
>
> Can Virtio Device set its own dma_ops? It is a device on the virtual bus. It
> sets its
On Tue, Apr 11, 2023 at 3:21 PM Xuan Zhuo wrote:
>
>
> Hi Jason
>
> Can we force virtio core to use dma api without VIRTIO_F_ACCESS_PLATFORM?
>
>
I don't think so. Without ACCESS_PLATFORM it's not DMA, so DMA API
should be avoided. And we have several software devices for virtio
now.
I'd
On Tue, Apr 11, 2023 at 12:54:46PM +0800, Jason Wang wrote:
> On Tue, Apr 11, 2023 at 12:10 PM Christoph Hellwig wrote:
> >
> > On Tue, Apr 11, 2023 at 11:56:47AM +0800, Jason Wang wrote:
> > > > The DMA device for virtio_pci is the underlying PCI device, always.
> > > > !VIRTIO_F_ACCESS_PLATFORM
On Mon, 10 Apr 2023 23:45:33 -0700, Christoph Hellwig
wrote:
> On Tue, Apr 11, 2023 at 02:33:29PM +0800, Xuan Zhuo wrote:
> > Do you mean my idea is wrong, right?
> >
> > Can you explain it? Why can't we support a device that uses only dirct map?
>
> If a direct map or not is used is a decision
Hi Jason
Can we force virtio core to use dma api without VIRTIO_F_ACCESS_PLATFORM?
Thanks.
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
On Tue, 11 Apr 2023 14:51:29 +0800, Xuan Zhuo
wrote:
> On Mon, 10 Apr 2023 23:46:56 -0700, Christoph Hellwig
> wrote:
> > On Tue, Apr 11, 2023 at 02:28:00PM +0800, Xuan Zhuo wrote:
> > > > That is just completely broken, virtio or not. Highlevel code like
> > > > sockets must never do dma
On Mon, 10 Apr 2023 23:46:56 -0700, Christoph Hellwig
wrote:
> On Tue, Apr 11, 2023 at 02:28:00PM +0800, Xuan Zhuo wrote:
> > > That is just completely broken, virtio or not. Highlevel code like
> > > sockets must never do dma mappings themselves.
> >
> > AF_XDP provides some API for net
On Tue, Apr 11, 2023 at 02:28:00PM +0800, Xuan Zhuo wrote:
> > That is just completely broken, virtio or not. Highlevel code like
> > sockets must never do dma mappings themselves.
>
> AF_XDP provides some API for net driver. This API will do dma map or dma sync.
>
> cc AF_XDP maintainers.
So
On Tue, Apr 11, 2023 at 02:33:29PM +0800, Xuan Zhuo wrote:
> Do you mean my idea is wrong, right?
>
> Can you explain it? Why can't we support a device that uses only dirct map?
If a direct map or not is used is a decision done by the platform code,
often based on firmware tables. You can't
On Mon, 10 Apr 2023 23:30:29 -0700, Christoph Hellwig
wrote:
> > > Can you please explain what you're even trying to do?
> >
> > I want to force a device use direct dma map.
>
> You fundamentally can't do that. It can't work.
Do you mean my idea is wrong, right?
Can you explain it? Why can't
On Mon, 10 Apr 2023 23:20:59 -0700, Christoph Hellwig
wrote:
> On Tue, Apr 11, 2023 at 02:11:17PM +0800, Xuan Zhuo wrote:
> > NO, all dma maping is done inside xdp socket. That is done
> > when setup.
>
> That is just completely broken, virtio or not. Highlevel code like
> sockets must never do
> > Can you please explain what you're even trying to do?
>
> I want to force a device use direct dma map.
You fundamentally can't do that. It can't work.
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
On Mon, 10 Apr 2023 20:26:20 -0700, Christoph Hellwig
wrote:
> On Tue, Apr 11, 2023 at 09:56:19AM +0800, Xuan Zhuo wrote:
> > Do you mean we should not change the dma_ops from the outside of the core
> > kernel/dma/?
>
> Basically, yes. That plus probing for the IOMMU drivers.
>
> > How about
On Tue, Apr 11, 2023 at 02:11:17PM +0800, Xuan Zhuo wrote:
> NO, all dma maping is done inside xdp socket. That is done
> when setup.
That is just completely broken, virtio or not. Highlevel code like
sockets must never do dma mappings themselves.
___
On Tue, 11 Apr 2023 11:56:47 +0800, Jason Wang wrote:
> On Tue, Apr 11, 2023 at 11:31 AM Christoph Hellwig wrote:
> >
> > On Tue, Apr 11, 2023 at 10:09:40AM +0800, Jason Wang wrote:
> > > We want to support AF_XDP for virtio-net. It means AF_XDP needs to
> > > know the dma device to perform DMA
On Tue, Apr 11, 2023 at 1:14 PM Christoph Hellwig wrote:
>
> On Tue, Apr 11, 2023 at 12:54:46PM +0800, Jason Wang wrote:
> > Ok, just to clarify, I meant there could be a case where the virtqueue
> > is emulated by software, in this case we need check whether the
> > virtqueue has a dma device or
On Tue, Apr 11, 2023 at 12:54:46PM +0800, Jason Wang wrote:
> Ok, just to clarify, I meant there could be a case where the virtqueue
> is emulated by software, in this case we need check whether the
> virtqueue has a dma device or not in vring_use_dma_api(). If not we
> need return false.
Well,
On Tue, Apr 11, 2023 at 12:10 PM Christoph Hellwig wrote:
>
> On Tue, Apr 11, 2023 at 11:56:47AM +0800, Jason Wang wrote:
> > > The DMA device for virtio_pci is the underlying PCI device, always.
> > > !VIRTIO_F_ACCESS_PLATFORM means there is no dma device at all. Because
> > > of all these
On Tue, Apr 11, 2023 at 11:56:47AM +0800, Jason Wang wrote:
> > The DMA device for virtio_pci is the underlying PCI device, always.
> > !VIRTIO_F_ACCESS_PLATFORM means there is no dma device at all. Because
> > of all these things you can't just expose a pointer to the dma_device
> > as that is
On Tue, Apr 11, 2023 at 11:31 AM Christoph Hellwig wrote:
>
> On Tue, Apr 11, 2023 at 10:09:40AM +0800, Jason Wang wrote:
> > We want to support AF_XDP for virtio-net. It means AF_XDP needs to
> > know the dma device to perform DMA mapping. So we introduce a helper
> > to expose the dma dev of
On Tue, Apr 11, 2023 at 10:09:40AM +0800, Jason Wang wrote:
> We want to support AF_XDP for virtio-net. It means AF_XDP needs to
> know the dma device to perform DMA mapping. So we introduce a helper
> to expose the dma dev of the virtio device.
The whole virtio architecture is based around the
On Tue, Apr 11, 2023 at 09:56:19AM +0800, Xuan Zhuo wrote:
> Do you mean we should not change the dma_ops from the outside of the core
> kernel/dma/?
Basically, yes. That plus probing for the IOMMU drivers.
> How about adding one new "dma_direct" to struct devive?
Why would we?
Can you please
On Tue, Apr 11, 2023 at 10:01 AM Xuan Zhuo wrote:
>
> On Mon, 10 Apr 2023 08:27:14 -0700, Christoph Hellwig
> wrote:
> > On Mon, Apr 10, 2023 at 01:14:13PM +0800, Jason Wang wrote:
> > > > But rethink, this is unreliable. Some platforms have returned their own
> > > > ops,
> > > > including
On Mon, 10 Apr 2023 08:27:14 -0700, Christoph Hellwig
wrote:
> On Mon, Apr 10, 2023 at 01:14:13PM +0800, Jason Wang wrote:
> > > But rethink, this is unreliable. Some platforms have returned their own
> > > ops,
> > > including X86.
> > >
> > > Because the priority of dev->dma_ops is higher
On Mon, Apr 10, 2023 at 01:14:13PM +0800, Jason Wang wrote:
> > But rethink, this is unreliable. Some platforms have returned their own ops,
> > including X86.
> >
> > Because the priority of dev->dma_ops is higher than get_arch_dma_ops(), we
> > should not let dev->dma_ops be null. We should
On Mon, 10 Apr 2023 02:40:58 -0400, "Michael S. Tsirkin"
wrote:
> On Mon, Apr 10, 2023 at 02:03:37PM +0800, Xuan Zhuo wrote:
> > On Mon, 10 Apr 2023 13:14:13 +0800, Jason Wang wrote:
> > > On Mon, Apr 10, 2023 at 11:48 AM Xuan Zhuo
> > > wrote:
> > > >
> > > > On Fri, 7 Apr 2023 07:02:34
On Mon, Apr 10, 2023 at 02:03:37PM +0800, Xuan Zhuo wrote:
> On Mon, 10 Apr 2023 13:14:13 +0800, Jason Wang wrote:
> > On Mon, Apr 10, 2023 at 11:48 AM Xuan Zhuo
> > wrote:
> > >
> > > On Fri, 7 Apr 2023 07:02:34 -0400, "Michael S. Tsirkin"
> > > wrote:
> > > > On Thu, Apr 06, 2023 at
On Mon, 10 Apr 2023 13:14:13 +0800, Jason Wang wrote:
> On Mon, Apr 10, 2023 at 11:48 AM Xuan Zhuo wrote:
> >
> > On Fri, 7 Apr 2023 07:02:34 -0400, "Michael S. Tsirkin"
> > wrote:
> > > On Thu, Apr 06, 2023 at 10:20:09AM -0700, Guenter Roeck wrote:
> > > > Hi,
> > > >
> > > > On Mon, Mar 27,
On Mon, Apr 10, 2023 at 11:48 AM Xuan Zhuo wrote:
>
> On Fri, 7 Apr 2023 07:02:34 -0400, "Michael S. Tsirkin"
> wrote:
> > On Thu, Apr 06, 2023 at 10:20:09AM -0700, Guenter Roeck wrote:
> > > Hi,
> > >
> > > On Mon, Mar 27, 2023 at 12:05:33PM +0800, Xuan Zhuo wrote:
> > > > Added
On Fri, 7 Apr 2023 07:02:34 -0400, "Michael S. Tsirkin" wrote:
> On Thu, Apr 06, 2023 at 10:20:09AM -0700, Guenter Roeck wrote:
> > Hi,
> >
> > On Mon, Mar 27, 2023 at 12:05:33PM +0800, Xuan Zhuo wrote:
> > > Added virtqueue_dma_dev() to get DMA device for virtio. Then the
> > > caller can do dma
On 4/6/23 20:17, Xuan Zhuo wrote:
On Thu, 6 Apr 2023 10:20:09 -0700, Guenter Roeck wrote:
Hi,
On Mon, Mar 27, 2023 at 12:05:33PM +0800, Xuan Zhuo wrote:
Added virtqueue_dma_dev() to get DMA device for virtio. Then the
caller can do dma operation in advance. The purpose is to keep memory
On Thu, Apr 06, 2023 at 10:20:09AM -0700, Guenter Roeck wrote:
> Hi,
>
> On Mon, Mar 27, 2023 at 12:05:33PM +0800, Xuan Zhuo wrote:
> > Added virtqueue_dma_dev() to get DMA device for virtio. Then the
> > caller can do dma operation in advance. The purpose is to keep memory
> > mapped across
On Thu, 6 Apr 2023 10:20:09 -0700, Guenter Roeck wrote:
> Hi,
>
> On Mon, Mar 27, 2023 at 12:05:33PM +0800, Xuan Zhuo wrote:
> > Added virtqueue_dma_dev() to get DMA device for virtio. Then the
> > caller can do dma operation in advance. The purpose is to keep memory
> > mapped across multiple
Hi,
On Mon, Mar 27, 2023 at 12:05:33PM +0800, Xuan Zhuo wrote:
> Added virtqueue_dma_dev() to get DMA device for virtio. Then the
> caller can do dma operation in advance. The purpose is to keep memory
> mapped across multiple add/get buf operations.
>
> Signed-off-by: Xuan Zhuo
> Acked-by:
Added virtqueue_dma_dev() to get DMA device for virtio. Then the
caller can do dma operation in advance. The purpose is to keep memory
mapped across multiple add/get buf operations.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/virtio/virtio.c | 6 ++
41 matches
Mail list logo