Re: [PATCH vhost v6 09/10] virtio_net: set premapped mode by find_vqs()

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

 



On Sun, 7 Apr 2024 12:24:00 +0800, Jason Wang <jasowang@xxxxxxxxxx> wrote:
> On Mon, Apr 1, 2024 at 11:10 AM Xuan Zhuo <xuanzhuo@xxxxxxxxxxxxxxxxx> wrote:
> >
> > On Mon, 1 Apr 2024 09:40:07 +0800, Xuan Zhuo <xuanzhuo@xxxxxxxxxxxxxxxxx> wrote:
> > > On Fri, 29 Mar 2024 11:20:08 +0800, Jason Wang <jasowang@xxxxxxxxxx> wrote:
> > > > On Thu, Mar 28, 2024 at 4:27 PM Xuan Zhuo <xuanzhuo@xxxxxxxxxxxxxxxxx> wrote:
> > > > >
> > > > > On Thu, 28 Mar 2024 16:05:02 +0800, Jason Wang <jasowang@xxxxxxxxxx> wrote:
> > > > > > On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo <xuanzhuo@xxxxxxxxxxxxxxxxx> wrote:
> > > > > > >
> > > > > > > Now, the virtio core can set the premapped mode by find_vqs().
> > > > > > > If the premapped can be enabled, the dma array will not be
> > > > > > > allocated. So virtio-net use the api of find_vqs to enable the
> > > > > > > premapped.
> > > > > > >
> > > > > > > Judge the premapped mode by the vq->premapped instead of saving
> > > > > > > local variable.
> > > > > > >
> > > > > > > Signed-off-by: Xuan Zhuo <xuanzhuo@xxxxxxxxxxxxxxxxx>
> > > > > > > ---
> > > > > >
> > > > > > I wonder what's the reason to keep a fallback when premapped is not enabled?
> > > > >
> > > > > Rethink this.
> > > > >
> > > > > I think you are right. We can remove the fallback.
> > > > >
> > > > > Because we have the virtio dma apis that wrap all the cases.
> > > > > So I will remove the fallback from the virtio-net in next version.
> > > >
> > > > Ok.
> > > >
> > > > >
> > > > > But we still need to export the premapped to the drivers.
> > > > > Because we can enable the AF_XDP only when premapped is true.
> > > >
> > > > I may miss something but it should work like
> > > >
> > > > enable AF_XDP -> enable remapping
> > > >
> > > > So can we fail during remapping enablement?
> > >
> > >
> > > YES.
> > >
> > > Enabling the premapped mode may fail, then we must stop to enable AF_XDP.
> > >
> > > AF-XDP requires that we export the dma dev to the af-xdp.
> > > We can do that only when the virtio core works with use_dma_api.
> > > Other other side, if we support the page-pool in future, we may have the
> > > same requirement.
> >
> > Rethink this.
> >
> > Enable premapped MUST NOT fail. No care the use_dma_api is true or not, because
> > we have the DMA APIs for virtio. Then the virtio-net rx will work with
> > premapped (I will make the big mode work with premapped mode)
>
> Just to make sure we're at the same page. Rx will always work in the
> mode or pre mapping. So we can easily fail the probe if we fail to
> enable RX premapping?


NO, enabling premapped mode can not fail. So the rx will always work
in the premapping mode.


>
> >
> > AF_XDP checks the virtqueue_dma_dev() when enabling.
> >
> > But disabling premapped mode may fail, because that virtio ring need to
> > allocate memory for dma.
>
> That's kind of too tricky, what if we just allocate the memory for dma
> unconditionally?

It's ok, but we waste the memory.

Thanks.



>
> Thanks
>
> >
> > Thanks.
> >
> >
> >
> > >
> > >
> > > Thanks.
> > >
> > >
> > > >
> > > > THanks
> > > >
> > > > >
> > > > > Thanks
> > > > >
> > > > >
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > >
> > > >
> > >
> >
>





[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux