mbox series

[0/6] add support for CDX bus

Message ID 20230407060152.16335-1-nipun.gupta@amd.com (mailing list archive)
Headers
Series add support for CDX bus |

Message

Gupta, Nipun April 7, 2023, 6:01 a.m. UTC
  Support AMD CDX bus, for FPGA based CDX devices. The CDX
devices are memory mapped on system bus for embedded CPUs.

It uses sysfs interface and the vfio-cdx driver to discover
and initialize the CDX devices.

The patches are intended for DPDK 23.07 release, and have been sent
as an RFC as patches are yet to be merged in Linux.

Linux CDX bus patches has been added into linux next:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/cdx

VFIO patches are also submitted in upstream:
https://www.spinics.net/lists/kvm/msg310623.html

CDX is a Hardware Architecture designed for AMD FPGA devices. It
consists of mechanism for interaction between FPGA, Firmware and
the APUs (Application CPUs).
Firmware resides on RPU (Realtime CPUs) which interacts with
the FPGA program manager and the APUs. The RPU provides memory-mapped
interface (RPU if) which is used to communicate with APUs.

VFIO CDX driver provides the CDX device resources like MMIO and interrupts
to map to user-space. DPDK CDX bus uses sysfs interface and the vfio-cdx
driver to discover and initialize the CDX devices for user-space
applications.

RFC patches in DPDK were submitted at:
http://patches.dpdk.org/project/dpdk/patch/20230124140746.594066-2-nipun.gupta@amd.com/

Changes RFC->v1:
- Marked few API's as internal which were not required
  to be provided to user.

Nipun Gupta (6):
  bus/cdx: introduce cdx bus
  bus/cdx: add dma map and unmap support
  bus/cdx: add support for MSI
  bus/cdx: support plug unplug and dev iterator
  bus: enable cdx bus
  config/arm: add AMD CDX

 MAINTAINERS                            |   5 +
 config/arm/arm64_cdx_linux_gcc         |  17 +
 config/arm/meson.build                 |  14 +
 drivers/bus/cdx/cdx.c                  | 743 +++++++++++++++++++++++++
 drivers/bus/cdx/cdx.h                  |  54 ++
 drivers/bus/cdx/cdx_logs.h             |  37 ++
 drivers/bus/cdx/cdx_vfio.c             | 598 ++++++++++++++++++++
 drivers/bus/cdx/meson.build            |  13 +
 drivers/bus/cdx/rte_bus_cdx.h          | 245 ++++++++
 drivers/bus/cdx/version.map            |  21 +
 drivers/bus/meson.build                |   1 +
 lib/eal/common/eal_common_interrupts.c |  21 +
 lib/eal/common/eal_interrupts.h        |   1 +
 lib/eal/include/rte_interrupts.h       |  32 ++
 lib/eal/version.map                    |   2 +
 15 files changed, 1804 insertions(+)
 create mode 100644 config/arm/arm64_cdx_linux_gcc
 create mode 100644 drivers/bus/cdx/cdx.c
 create mode 100644 drivers/bus/cdx/cdx.h
 create mode 100644 drivers/bus/cdx/cdx_logs.h
 create mode 100644 drivers/bus/cdx/cdx_vfio.c
 create mode 100644 drivers/bus/cdx/meson.build
 create mode 100644 drivers/bus/cdx/rte_bus_cdx.h
 create mode 100644 drivers/bus/cdx/version.map
  

Comments

David Marchand April 7, 2023, 7:18 a.m. UTC | #1
Hello,

On Fri, Apr 7, 2023 at 8:02 AM Nipun Gupta <nipun.gupta@amd.com> wrote:
>
> Support AMD CDX bus, for FPGA based CDX devices. The CDX
> devices are memory mapped on system bus for embedded CPUs.
>
> It uses sysfs interface and the vfio-cdx driver to discover
> and initialize the CDX devices.
>
> The patches are intended for DPDK 23.07 release, and have been sent
> as an RFC as patches are yet to be merged in Linux.
>
> Linux CDX bus patches has been added into linux next:
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/cdx
>
> VFIO patches are also submitted in upstream:
> https://www.spinics.net/lists/kvm/msg310623.html

Hard to tell just from this link what the status is.
Has it been reviewed?
When are you expecting this to get merged?


>
> CDX is a Hardware Architecture designed for AMD FPGA devices. It
> consists of mechanism for interaction between FPGA, Firmware and
> the APUs (Application CPUs).
> Firmware resides on RPU (Realtime CPUs) which interacts with
> the FPGA program manager and the APUs. The RPU provides memory-mapped
> interface (RPU if) which is used to communicate with APUs.
>
> VFIO CDX driver provides the CDX device resources like MMIO and interrupts
> to map to user-space. DPDK CDX bus uses sysfs interface and the vfio-cdx
> driver to discover and initialize the CDX devices for user-space
> applications.
>
> RFC patches in DPDK were submitted at:
> http://patches.dpdk.org/project/dpdk/patch/20230124140746.594066-2-nipun.gupta@amd.com/
>
> Changes RFC->v1:
> - Marked few API's as internal which were not required
>   to be provided to user.

Just a quick pass on this series.

- There is an issue with the exported header rte_bus_cdx.h.
All the bus specific / driver only parts must be moved to a dedicated
bus_cdx_driver.h header (which must be listed in driver_sdk_headers).

- To whom is the rte_cdx_dump symbol intended to? Is this for use by
user applications?
If so, the rte_bus_cdx.h can be kept, to export this symbol.
But otherwise, everything in rte_bus_cdx.h can be moved to bus_cdx_driver.h.

- Please remove the rte_ prefix for static symbols in *.c.
  
Gupta, Nipun April 7, 2023, 7:29 a.m. UTC | #2
On 4/7/2023 12:48 PM, David Marchand wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> 
> 
> Hello,
> 
> On Fri, Apr 7, 2023 at 8:02 AM Nipun Gupta <nipun.gupta@amd.com> wrote:
>>
>> Support AMD CDX bus, for FPGA based CDX devices. The CDX
>> devices are memory mapped on system bus for embedded CPUs.
>>
>> It uses sysfs interface and the vfio-cdx driver to discover
>> and initialize the CDX devices.
>>
>> The patches are intended for DPDK 23.07 release, and have been sent
>> as an RFC as patches are yet to be merged in Linux.
>>
>> Linux CDX bus patches has been added into linux next:
>> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/cdx
>>
>> VFIO patches are also submitted in upstream:
>> https://www.spinics.net/lists/kvm/msg310623.html
> 
> Hard to tell just from this link what the status is.
> Has it been reviewed?
> When are you expecting this to get merged?

The CDX bus code has been merged and VFIO code is under review. Apart 
from this, we will soon have Open source Linux from AMD which has all 
the required patches for CDX in a week or so (I will provide the link 
once that is available).

> 
> 
>>
>> CDX is a Hardware Architecture designed for AMD FPGA devices. It
>> consists of mechanism for interaction between FPGA, Firmware and
>> the APUs (Application CPUs).
>> Firmware resides on RPU (Realtime CPUs) which interacts with
>> the FPGA program manager and the APUs. The RPU provides memory-mapped
>> interface (RPU if) which is used to communicate with APUs.
>>
>> VFIO CDX driver provides the CDX device resources like MMIO and interrupts
>> to map to user-space. DPDK CDX bus uses sysfs interface and the vfio-cdx
>> driver to discover and initialize the CDX devices for user-space
>> applications.
>>
>> RFC patches in DPDK were submitted at:
>> http://patches.dpdk.org/project/dpdk/patch/20230124140746.594066-2-nipun.gupta@amd.com/
>>
>> Changes RFC->v1:
>> - Marked few API's as internal which were not required
>>    to be provided to user.
> 
> Just a quick pass on this series.
> 
> - There is an issue with the exported header rte_bus_cdx.h.
> All the bus specific / driver only parts must be moved to a dedicated
> bus_cdx_driver.h header (which must be listed in driver_sdk_headers).
> 
> - To whom is the rte_cdx_dump symbol intended to? Is this for use by
> user applications?
> If so, the rte_bus_cdx.h can be kept, to export this symbol.
> But otherwise, everything in rte_bus_cdx.h can be moved to bus_cdx_driver.h.
> 
> - Please remove the rte_ prefix for static symbols in *.c.

Agree to this.

Regards,
Nipun

> 
> 
> --
> David Marchand
>
  
Gupta, Nipun April 13, 2023, 1:25 p.m. UTC | #3
> -----Original Message-----
> From: Gupta, Nipun
> Sent: Friday, April 7, 2023 1:00 PM
> To: David Marchand <david.marchand@redhat.com>
> Cc: dev@dpdk.org; thomas@monjalon.net; Yigit, Ferruh
> <Ferruh.Yigit@amd.com>; Anand, Harpreet <harpreet.anand@amd.com>;
> Agarwal, Nikhil <nikhil.agarwal@amd.com>
> Subject: Re: [PATCH 0/6] add support for CDX bus
> 
> 
> 
> On 4/7/2023 12:48 PM, David Marchand wrote:
> > Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
> >
> >
> > Hello,
> >
> > On Fri, Apr 7, 2023 at 8:02 AM Nipun Gupta <nipun.gupta@amd.com> wrote:
> >>
> >> Support AMD CDX bus, for FPGA based CDX devices. The CDX
> >> devices are memory mapped on system bus for embedded CPUs.
> >>
> >> It uses sysfs interface and the vfio-cdx driver to discover
> >> and initialize the CDX devices.
> >>
> >> The patches are intended for DPDK 23.07 release, and have been sent
> >> as an RFC as patches are yet to be merged in Linux.
> >>
> >> Linux CDX bus patches has been added into linux next:
> >> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-
> next.git/tree/drivers/cdx
> >>
> >> VFIO patches are also submitted in upstream:
> >> https://www.spinics.net/lists/kvm/msg310623.html
> >
> > Hard to tell just from this link what the status is.
> > Has it been reviewed?
> > When are you expecting this to get merged?
> 
> The CDX bus code has been merged and VFIO code is under review. Apart
> from this, we will soon have Open source Linux from AMD which has all
> the required patches for CDX in a week or so (I will provide the link
> once that is available).

The CDX bus and VFIO support is now available at Xilinx open-source tree:
https://github.com/Xilinx/linux-xlnx (drivers/cdx/ and drivers/vfio/cdx)

Regards,
Nipun