lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1681784379.909136-2-xuanzhuo@linux.alibaba.com>
Date:   Tue, 18 Apr 2023 10:19:39 +0800
From:   Xuan Zhuo <xuanzhuo@...ux.alibaba.com>
To:     Jakub Kicinski <kuba@...nel.org>
Cc:     Christoph Hellwig <hch@...radead.org>, netdev@...r.kernel.org,
        Björn Töpel <bjorn@...nel.org>,
        Magnus Karlsson <magnus.karlsson@...el.com>,
        Maciej Fijalkowski <maciej.fijalkowski@...el.com>,
        Jonathan Lemon <jonathan.lemon@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Paolo Abeni <pabeni@...hat.com>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Jesper Dangaard Brouer <hawk@...nel.org>,
        John Fastabend <john.fastabend@...il.com>, bpf@...r.kernel.org,
        virtualization@...ts.linux-foundation.org,
        "Michael S. Tsirkin" <mst@...hat.com>,
        Guenter Roeck <linux@...ck-us.net>,
        Gerd Hoffmann <kraxel@...hat.com>,
        Jason Wang <jasowang@...hat.com>
Subject: Re: [PATCH net-next] xsk: introduce xsk_dma_ops

On Mon, 17 Apr 2023 18:19:50 -0700, Jakub Kicinski <kuba@...nel.org> wrote:
> On Tue, 18 Apr 2023 09:07:30 +0800 Jason Wang wrote:
> > > > Would you mind explaining this a bit more to folks like me who are not
> > > > familiar with VirtIO?  DMA API is supposed to hide the DMA mapping
> > > > details from the stack, why is it not sufficient here.
> >
> > The reason is that legacy virtio device don't use DMA(vring_use_dma_api()).
> >
> > The AF_XDP assumes DMA for netdev doesn't work in this case. We need a
> > way to make it work.
>
> Can we not push this down to be bus level? virtio has its own bus it
> can plug in whatever magic it wants into dma ops.

It is actually not possible.

[1] https://lore.kernel.org/virtualization/ZDUCDeYLqAwQVJe7@infradead.org/

>
> Doesn't have to be super fast for af_xdp's sake - for af_xdp dma mapping
> is on the control path. You can keep using the if (vring_use_dma_api())
> elsewhere for now if there is a perf concern.

Sorry, I don't particularly understand this passage.

Now, the question is if vring_use_dma_api() is false, then we cannot use DMA
API in AF_XDP.

The good news is that except for some of sync's operations, they are in the
control path. I think it is very small effect on performance. Because in most
case the sync is unnecessary.


>
> Otherwise it really seems like we're bubbling up a virtio hack into
> generic code :(

Can we understand the purpose of this matter to back the DMA operation to the
driver? Although I don't know if there are other drivers with similar
requirements.

Thanks.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ