linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Zhang, Tianfei" <tianfei.zhang@intel.com>
To: "Wu, Hao" <hao.wu@intel.com>, "trix@redhat.com" <trix@redhat.com>,
	"mdf@kernel.org" <mdf@kernel.org>,
	"Xu, Yilun" <yilun.xu@intel.com>,
	"linux-fpga@vger.kernel.org" <linux-fpga@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "corbet@lwn.net" <corbet@lwn.net>
Subject: RE: [PATCH v1 1/7] Documentation: fpga: dfl: add description of IOFS
Date: Mon, 21 Feb 2022 07:39:35 +0000	[thread overview]
Message-ID: <BN9PR11MB54830141CECE8076A7EBB1D9E33A9@BN9PR11MB5483.namprd11.prod.outlook.com> (raw)
In-Reply-To: <DM6PR11MB381933DF77F512D7E70539EF85359@DM6PR11MB3819.namprd11.prod.outlook.com>



> -----Original Message-----
> From: Wu, Hao <hao.wu@intel.com>
> Sent: Wednesday, February 16, 2022 11:35 AM
> To: Zhang, Tianfei <tianfei.zhang@intel.com>; trix@redhat.com;
> mdf@kernel.org; Xu, Yilun <yilun.xu@intel.com>; linux-fpga@vger.kernel.org;
> linux-doc@vger.kernel.org; linux-kernel@vger.kernel.org
> Cc: corbet@lwn.net
> Subject: Re: [PATCH v1 1/7] Documentation: fpga: dfl: add description of IOFS
> 
> > Subject: [PATCH v1 1/7] Documentation: fpga: dfl: add description of
> > IOFS
> >
> > From: Tianfei Zhang <tianfei.zhang@intel.com>
> >
> > This patch adds description about IOFS support for DFL.
> >
> > Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
> > ---
> >  Documentation/fpga/dfl.rst | 99
> > +++++++++++++++++++++++++++++++++++++-
> >  1 file changed, 97 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/fpga/dfl.rst b/Documentation/fpga/dfl.rst
> > index ef9eec71f6f3..6f9eae1c1697 100644
> > --- a/Documentation/fpga/dfl.rst
> > +++ b/Documentation/fpga/dfl.rst
> > @@ -58,7 +58,10 @@ interface to FPGA, e.g. the FPGA Management Engine
> > (FME) and Port (more
> >  descriptions on FME and Port in later sections).
> >
> >  Accelerated Function Unit (AFU) represents an FPGA programmable
> > region and -always connects to a FIU (e.g. a Port) as its child as illustrated
> above.
> > +always connects to a FIU (e.g. a Port) as its child as illustrated
> > +above, but on IOFS design, it introducing Port Gasket which contains
> > +AFUs. For DFL
> > perspective,
> > +the Next_AFU pointer on FIU feature header can point to NULL so the
> > +AFU is
> > not
> > +connects to a FIU(more descriptions on IOFS in later section).
> >
> >  Private Features represent sub features of the FIU and AFU. They
> > could be  various function blocks with different IDs, but all private
> > features which @@ -134,6 +137,9 @@ reconfigurable region containing an
> > AFU. It controls the communication from SW  to the accelerator and
> > exposes features such as reset and debug. Each FPGA  device may have
> > more than one port, but always one AFU per port.
> >
> > +On IOFS, it introducing a new hardware unit, Port Gasket, which
> > +contains all the PR specific modules and regions (more descriptions on IOFS in
> later section).
> 
> What's the different between the PORT we have now for DFH, and the new one
> in IOFS?

From DFL perspective , the PORT concept is identical between IOFS and old card like N3000 card.
The major different is that the IOFS introducing a new hardware concept: Port Gasket, which include the PR slot, 
Port control, Port user clock control and Port errors.
> 
> > +
> >
> >  AFU
> >  ===
> > @@ -143,6 +149,9 @@ used for accelerator-specific control registers.
> >  User-space applications can acquire exclusive access to an AFU
> > attached to a  port by using open() on the port device node and release it using
> close().
> >
> > +On IOFS, the AFU is embedded in a Port Gasket. The AFU resource can
> > +expose
> > via
> > +VFs with SRIOV support (more descriptions on IOFS in later section).
> > +
> >  The following functions are exposed through ioctls:
> >
> >  - Get driver API version (DFL_FPGA_GET_API_VERSION) @@ -284,7 +293,8
> > @@ FME is always accessed through the physical function (PF).
> >
> >  Ports (and related AFUs) are accessed via PF by default, but could be
> > exposed  through virtual function (VF) devices via PCIe SRIOV. Each VF
> > only contains
> > -1 Port and 1 AFU for isolation. Users could assign individual VFs
> > (accelerators)
> > +1 Port (On IOFS design, the VF is designs without Port) and 1 AFU for
> isolation.
> > +Users could assign individual VFs (accelerators)
> >  created via PCIe SRIOV interface, to virtual machines.
> >
> >  The driver organization in virtualization case is illustrated below:
> > @@ -389,6 +399,91 @@ The device nodes used for ioctl() or mmap() can
> > be referenced through::
> >  	/sys/class/fpga_region/<regionX>/<dfl-fme.n>/dev
> >  	/sys/class/fpga_region/<regionX>/<dfl-port.n>/dev
> >
> > +Intel Open FPGA stack
> > +=====================
> > +Intel Open FPGA stack aka IOFS, Intel's version of a common core set
> > +of RTL to allow customers to easily interface to logic and IP on the FPGA.
> > +IOFS leverage the DFL for the implementation of the FPGA RTL design.
> > +
> > +IOFS designs allow for the arrangement of software interfaces across
> > +multiple PCIe endpoints. Some of these interfaces may be PFs defined
> > +in the static
> > region
> > +that connect to interfaces in an IP that is loaded via Partial
> > +Reconfiguration
> > (PR).
> > +And some of these interfaces may be VFs defined in the PR region that
> > +can be reconfigured by the end-user. Furthermore, these PFs/VFs may
> > +also be
> > arranged
> > +using a DFL such that features may be discovered and accessed in user
> > +space (with the aid of a generic kernel driver like vfio-pci). The
> > +diagram below depicts an example design with two PFs and two VFs. In
> > +this example, PF1 implements
> > its
> > +MMIO space such that it is compatible with the VirtIO framework. The
> > +other
> > functions,
> > +VF0 and VF1, leverage VFIO to export the MMIO space to an application
> > +or a
> > hypervisor.
> 
> So PORT will never be exposed to VM in IOFS design, is my understanding
> correct?

On IOFS, there are many methods to access the AFU for virtualization and non-virtualization usage.
1. Legacy Model. This is used for N3000 and N5000 card.
In this model the entire AFU region is a unit of PR, and there is a Port device connected to this AFU.
In this model, the follow of exposing to VM is the same we have in N3000 and N5000 card.
The major follow is:
* release the port device.
* configure the SRIOV
* assign the VF to VM
* put the port device back to PF after finished access in VM
2. Micro-Personas in AFU. 
IOFS intruding new model for PR and AFU access.
Micro-Personas allow the RTL developer to designate their own AFU-defined PR regions. 
In this model, each PR slot has a dedicate  Port device, the follow of exposing to VM is the same we have in N3000 and N5000 card.
3. Multiple VFs per PR slot.
In this method, we can instance multiple VFs over SRIOV for one PR slot, and access the AFU resource by different VFs in virtualization usage.
 In this case, the Port device would not connected to AFU/PR slot, so we don't need to release the Port device.
before we assign the VF to VM.

Which model will deploy in IOFS product depends on the RTL developer.

> 
> > +
> > +     +-----------------+  +--------------+  +-------------+  +------------+
> > +     | FPGA Managerment|  |   VirtIO     |  |  User App   |  | Virtual    |
> 
> s/Managerment/Management/

Thanks, I will fix it on next version.

> 
> > +     |      App        |  |     App      |  |             |  | Machine    |
> > +     +--------+--------+  +------+-------+  +------+------+  +-----+------+
> > +              |                  |                 |               |
> > +              |                  |                 |               |
> > +     +--------+--------+  +------+-------+  +------+------+        |
> > +     |     DFL Driver  |  |VirtIO driver |  |    VFIO     |        |
> > +     +--------+--------+  +------+-------+  +------+------+        |
> > +              |                  |                 |               |
> > +              |                  |                 |               |
> > +     +--------+--------+  +------+-------+  +------+------+   +----+------+
> > +     |     PF0         |  |     PF1      |  |   PF0_VF0   |   |  PF0_VF1  |
> > +     +-----------------+  +--------------+  +-------------+   +-----------+
> > +
> > +On IOFS, it introducing some enhancements compared with original DFL
> design.
> > +1. It introducing Port Gasket in PF0 which is responsible for FPGA
> > +management, like FME and Port management. The Port Gasket contains
> > +all the PR specific
> > modules
> 
> So in IOFS, in PF0, we always have FME and PORT DFH, is my understanding
> correct?

Yes.

> Then why we need patch #3?

This is for " Multiple VFs per PR slot" model, in this model, the Port device would not connected to AFU (the BarID of Port device should be set to invalid),
so we just can access PR slot/AFU resource via VFs.

> 
> Another question is in IOFS, do we need to support multiple PR regions/Ports?
> If that is the case, how should we know which VFs belongs to PORT1 or PORT2?
> 
> > +and logic, e.g., PR slot reset/freeze control, user clock, remote STP etc.
> > +Architecturally, a Port Gasket can have multiple PR slots where user
> > +workload
> > can
> > +be programmed into.
> > +2. To expend the scalable of FPGA, it can support multiple FPs in
> > +static region
> 
> s/FPs/PFs/

I will fix on next version.

> 
> > +which contain some static functions like VirtIO, diagnostic test, and
> > +access over VFIO or assigned to VMs easily. Those PFs will not have a
> > +Port Unit which
> > without
> > +PR region (AFU) connected to those PFs, and the end-user cannot
> > +partial
> > reconfigurate
> 
> s/reconfigurate/reconfigure/

I will fix on next version.

> 
> > +those PFs.
> > +3. In our previous DFL design, it can only create one VF based in an
> > +AFU. To
> > raise
> > +the efficiency usage of AFU, it can create more than one VFs in an
> > +AFU via PCIe SRIOV, so those VFs share the PR region and resource.
> > +
> > +There is one reference architecture design for IOFS as illustrated below:
> > +
> > +                              +----------------------+
> > +                              |   PF/VF mux/demux    |
> > +                              +--+--+-----+------+-+-+
> > +                                 |  |     |      | |
> > +        +------------------------+  |     |      | |
> > +  PF0   |                 +---------+   +-+      | |
> > +    +---+---+             |         +---+----+   | |
> > +    |  DFH  |             |         |   DFH  |   | |
> > +    +-------+       +-----+----+    +--------+   | |
> > +    |  FME  |       |  VirtIO  |    |  Test  |   | |
> > +    +-------+       +----------+    +--------+   | |
> > +    | Port  |            PF1            PF2      | |
> > +    +---+---+                                    | |
> > +        |                             +----------+ |
> > +        |                             |           ++
> > +        |                             |           |
> > +        |                             | PF0_VF0   | PF0_VF1
> > +        |           +-----------------+-----------+------------+
> > +        |           |           +-----+-----------+--------+   |
> > +        |           |           |     |           |        |   |
> > +        |           | +------+  |  +--+ -+     +--+---+    |   |
> > +        |           | | CSR  |  |  | DFH |     |  DFH |    |   |
> > +        +-----------+ +------+  |  +-----+     +------+    |   |
> > +                    |           |  | DEV |     |  DEV |    |   |
> > +                    |           |  +-----+     +------+    |   |
> > +                    |           |            PR Slot       |   |
> > +                    |           +--------------------------+   |
> > +                    | Port Gasket                              |
> > +                    +------------------------------------------+
> > +
> > +Here are the major changes about DFL structures on IOFS
> > +implementation
> > design:
> > +1. The Port Gasket connects to FIU Port in DFL, but the Next_AFU
> > +pointer in FIU feature header can point to NULL so that it is no AFU
> > +connects to a FIU Port.
> > +2. The VF which include in PR region can start with AFU feature
> > +header without a FIU Port feature header.
> 
> What about PF2 in static region? Which type of DFH will be used?

An IP designer may choose to add more than one PF for interfacing with IP on the FPGA.
If at least one PF implements a DFL with management features such as an FME or PR, then
the device can be managed using the IOFS software stack. For example, a design may include
FME and PR on PF0 and the actual workload interfaces on PF1. If a workload 
implements virtio-net backend and interface, the IOFS software stack will only bind to and
communicate with IOFS features/interfaces found in the DFL on PF0. The second PF, PF1, 
will bind with virtio-net driver presenting itself as a network interface to the OS.
So the IOFS providing the diversity for IP designer.

> 
> Thanks
> Hao
> 
> >
> >  Performance Counters
> >  ====================
> > --
> > 2.17.1


  reply	other threads:[~2022-02-21  7:39 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-14 11:26 [PATCH v1 0/7] Add Intel OFS support for DFL driver Tianfei zhang
2022-02-14 11:26 ` [PATCH v1 1/7] Documentation: fpga: dfl: add description of IOFS Tianfei zhang
2022-02-14 12:18   ` Akira Yokosawa
2022-02-14 17:56     ` Randy Dunlap
2022-02-14 23:27       ` Zhang, Tianfei
2022-02-15 14:32   ` Tom Rix
2022-02-16  3:34   ` Wu, Hao
2022-02-21  7:39     ` Zhang, Tianfei [this message]
2022-02-14 11:26 ` [PATCH v1 2/7] fpga: dfl: check feature type before parse irq info Tianfei zhang
2022-02-15 14:49   ` Tom Rix
2022-02-17  2:38     ` Xu Yilun
2022-02-21  7:54       ` Zhang, Tianfei
2022-02-18  6:53     ` Zhang, Tianfei
2022-02-18 14:29       ` Tom Rix
2022-02-21 12:05         ` Zhang, Tianfei
2022-02-16  3:35   ` Wu, Hao
2022-02-21  7:41     ` Zhang, Tianfei
2022-02-14 11:26 ` [PATCH v1 3/7] fpga: dfl: Allow for ports with no local bar space Tianfei zhang
2022-02-15 15:05   ` Tom Rix
2022-02-18  7:31     ` Zhang, Tianfei
2022-02-18 14:49       ` Tom Rix
2022-02-21 17:22         ` matthew.gerlach
2022-02-21 17:51           ` Tom Rix
2022-02-22  9:07             ` Zhang, Tianfei
2022-02-16  3:38   ` Wu, Hao
2022-02-21  7:48     ` Zhang, Tianfei
2022-02-14 11:26 ` [PATCH v1 4/7] fpga: dfl: fix VF creation when ports have no local BAR space Tianfei zhang
2022-02-15 15:50   ` Tom Rix
2022-02-18  8:14     ` Zhang, Tianfei
2022-02-18 14:55       ` Tom Rix
2022-02-14 11:26 ` [PATCH v1 5/7] drivers: fpga: dfl: handle empty port list Tianfei zhang
2022-02-15 15:55   ` Tom Rix
2022-02-18  8:24     ` Zhang, Tianfei
2022-02-14 11:26 ` [PATCH v1 6/7] fpga: dfl: Handle dfl's starting with AFU Tianfei zhang
2022-02-15 16:09   ` Tom Rix
2022-02-14 11:26 ` [PATCH v1 7/7] fpga: dfl: pci: Add generic OFS PCI PID Tianfei zhang
2022-02-15 16:16   ` Tom Rix
2022-02-18  9:03     ` Zhang, Tianfei
2022-02-18 15:27       ` Tom Rix
2022-02-21 17:50         ` matthew.gerlach
2022-02-21 18:09           ` Tom Rix
2022-02-22  3:11             ` Zhang, Tianfei
2022-02-22 16:11               ` Tom Rix
2022-02-23  1:48                 ` Zhang, Tianfei
2022-02-24 17:54                 ` matthew.gerlach
2022-02-28 10:57                   ` Wu, Hao
2022-03-01  0:25                     ` matthew.gerlach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BN9PR11MB54830141CECE8076A7EBB1D9E33A9@BN9PR11MB5483.namprd11.prod.outlook.com \
    --to=tianfei.zhang@intel.com \
    --cc=corbet@lwn.net \
    --cc=hao.wu@intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mdf@kernel.org \
    --cc=trix@redhat.com \
    --cc=yilun.xu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).