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: <CANXvt5qjgVKccRcsARSkDF+boVkVi7h=AMHC+iWyOfp4dJ-_tQ@mail.gmail.com>
Date:   Tue, 7 Feb 2023 19:56:02 +0900
From:   Shunsuke Mie <mie@...l.co.jp>
To:     Frank Li <frank.li@....com>
Cc:     "Michael S. Tsirkin" <mst@...hat.com>,
        Lorenzo Pieralisi <lpieralisi@...nel.org>,
        Krzysztof Wilczyński <kw@...ux.com>,
        Manivannan Sadhasivam <mani@...nel.org>,
        Kishon Vijay Abraham I <kishon@...nel.org>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Jason Wang <jasowang@...hat.com>, Jon Mason <jdmason@...zu.us>,
        Ren Zhijie <renzhijie2@...wei.com>,
        Takanari Hayama <taki@...l.co.jp>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
        "virtualization@...ts.linux-foundation.org" 
        <virtualization@...ts.linux-foundation.org>
Subject: Re: [EXT] Re: [RFC PATCH 4/4] PCI: endpoint: function: Add EP
 function driver to provide virtio net device

2023年2月4日(土) 7:15 Frank Li <frank.li@....com>:
>
> >
> > Caution: EXT Email
> >
> > On Fri, Feb 03, 2023 at 07:04:18PM +0900, Shunsuke Mie wrote:
> > > Add a new endpoint(EP) function driver to provide virtio-net device. This
> > > function not only shows virtio-net device for PCIe host system, but also
> > > provides virtio-net device to EP side(local) system. Virtualy those network
> > > devices are connected, so we can use to communicate over IP like a simple
> > > NIC.
> > >
> > > Architecture overview is following:
> > >
> > > to Host       |                       to Endpoint
> > > network stack |                 network stack
> > >       |       |                       |
> > > +-----------+ |       +-----------+   +-----------+
> > > |virtio-net | |       |virtio-net |   |virtio-net |
> > > |driver     | |       |EP function|---|driver     |
> > > +-----------+ |       +-----------+   +-----------+
> > >       |       |             |
> > > +-----------+ | +-----------+
> > > |PCIeC      | | |PCIeC      |
> > > |Rootcomplex|-|-|Endpoint   |
> > > +-----------+ | +-----------+
> > >   Host side   |          Endpoint side
> > >
> > > This driver uses PCIe EP framework to show virtio-net (pci) device Host
> > > side, and generate virtual virtio-net device and register to EP side.
> > > A communication date
> >
> > data?
> >
> > > is diractly
> >
> > directly?
> >
> > > transported between virtqueue level
> > > with each other using PCIe embedded DMA controller.
> > >
> > > by a limitation of the hardware and Linux EP framework, this function
> > > follows a virtio legacy specification.
> >
> > what exactly is the limitation and why does it force legacy?
> >
> > > This function driver has beed tested on S4 Rcar (r8a779fa-spider) board but
> > > just use the PCIe EP framework and depends on the PCIe EDMA.
> > >
> > > Signed-off-by: Shunsuke Mie <mie@...l.co.jp>
> > > Signed-off-by: Takanari Hayama <taki@...l.co.jp>
> > > ---
> > >  drivers/pci/endpoint/functions/Kconfig        |  12 +
> > >  drivers/pci/endpoint/functions/Makefile       |   1 +
> > >  .../pci/endpoint/functions/pci-epf-vnet-ep.c  | 343 ++++++++++
>
> It is actually that not related vnet. Just virtio.
> I think pci-epf-virtio.c is better.
Yes, it have to be.
> > >  .../pci/endpoint/functions/pci-epf-vnet-rc.c  | 635 ++++++++++++++++++
>
> It is epf driver. rc is quite confused.
> Maybe you can combine pci-epf-vnet-ep.c and pci-epf-vnet-rc.c to one file.
I agree. Try to combine them
> > >  drivers/pci/endpoint/functions/pci-epf-vnet.c | 387 +++++++++++
>
> This file setup dma transfer according virtio-ring.
> How about pci-epf-virtio-dma.c ?
I attempt to rearrange the location of code and filenames.
> > > +
> > > +     epf_vnet_rc_set_config16(vnet, VIRTIO_PCI_ISR,
> > VIRTIO_PCI_ISR_QUEUE);
> > > +     /*
> > > +      * Initialize the queue notify and selector to outside of the appropriate
> > > +      * virtqueue index. It is used to detect change with polling. There is no
> > > +      * other ways to detect host side driver updateing those values
> > > +      */
>
> I am try to use gic-its or other msi controller as doorbell.
> https://lore.kernel.org/imx/20221125192729.1722913-1-Frank.Li@nxp.com/T/#u
>
> but it may need update host side pci virtio driver.
Thanks, is it possible to use  MSI-X as well? The virtio spec
indicates to use legacy irq or
MSI-X only.
> > > +     epf_vnet_rc_set_config16(vnet, VIRTIO_PCI_QUEUE_NOTIFY,
> > default_qindex);
> > > +     epf_vnet_rc_set_config16(vnet, VIRTIO_PCI_QUEUE_SEL,
> > default_qindex);
> > > +     /* This pfn is also set to 0 for the polling as well */
> > > +     epf_vnet_rc_set_config16(vnet, VIRTIO_PCI_QUEUE_PFN, 0);
> > > +
> > --
> > > 2.25.1
>
Best,
Shunsuke.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ