Skip to content

misc: nnpi: New PCIe driver for Intel's NNP-I pcie device

Guy Zadicario lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest15 patches 4 repliesIn review
  2. v115 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- Removed email disclaimer added to the end of each patch.
- Small fix to Kconfig requested by Randy
- Removed from this cover letter the long Intel internal pre-review change log of this patchset.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15misc: nnpi: Document NNP-I's driver overviewDocumentation/misc-devices/index.rst Documentation/misc-devices/intel-nnpi.rst+238 -00 replies
2/15misc: nnpi: Initialize NNP-I framework and PCIe modulesMAINTAINERS drivers/misc/Kconfig drivers/misc/Makefile +7 more+680 -00 replies
3/15misc: nnpi: Manage and schedule messages to devicedrivers/misc/intel-nnpi/Makefile drivers/misc/intel-nnpi/device.c drivers/misc/intel-nnpi/device.h +3 more+655 -10 replies
4/15misc: nnpi: Define host/card ipc protocoldrivers/misc/intel-nnpi/ipc_include/ipc_protocol.h+337 -00 replies
5/15misc: nnpi: Manage host memory resourcesDocumentation/ABI/testing/sysfs-driver-intel_nnpi drivers/misc/intel-nnpi/Makefile drivers/misc/intel-nnpi/hostres.c +1 more+800 -10 replies
6/15misc: nnpi: Allow usermode to manage host resourcesMAINTAINERS drivers/misc/intel-nnpi/Makefile drivers/misc/intel-nnpi/device.c +5 more+734 -11 reply
7/15misc: nnpi: Disallow host memory resource access if no NNP-I devices existdrivers/misc/intel-nnpi/device.c drivers/misc/intel-nnpi/device.h drivers/misc/intel-nnpi/host_chardev.c+14 -00 replies
8/15misc: nnpi: Boot NNP-I devicedrivers/misc/intel-nnpi/Makefile drivers/misc/intel-nnpi/bootimage.c drivers/misc/intel-nnpi/bootimage.h +3 more+675 -10 replies
9/15misc: nnpi: Process device response messagesdrivers/misc/intel-nnpi/device.c drivers/misc/intel-nnpi/device.h drivers/misc/intel-nnpi/nnp_pcie.c+149 -00 replies
10/15misc: nnpi: Query and verify device protocoldrivers/misc/intel-nnpi/device.c drivers/misc/intel-nnpi/device.h+162 -00 replies
11/15misc: nnpi: Create comm channel from app to devicedrivers/misc/intel-nnpi/Makefile drivers/misc/intel-nnpi/cmd_chan.c drivers/misc/intel-nnpi/cmd_chan.h +3 more+516 -50 replies
12/15misc: nnpi: Route device response messagesdrivers/misc/intel-nnpi/cmd_chan.h drivers/misc/intel-nnpi/device.c drivers/misc/intel-nnpi/device.h +1 more+310 -00 replies
13/15misc: nnpi: Expose command channel file interfacedrivers/misc/intel-nnpi/cmd_chan.c drivers/misc/intel-nnpi/cmd_chan.h drivers/misc/intel-nnpi/device.c+454 -10 replies
14/15misc: nnpi: Create command channel from userspacedrivers/misc/intel-nnpi/Makefile drivers/misc/intel-nnpi/cmd_chan.c drivers/misc/intel-nnpi/cmd_chan.h +5 more+478 -20 replies
15/15misc: nnpi: Map host resources to device channeldrivers/misc/intel-nnpi/cmd_chan.c drivers/misc/intel-nnpi/cmd_chan.h drivers/misc/intel-nnpi/device.c +2 more+748 -20 replies

Reviews trailers per patch

All 15 patches have a Reviewed-by or Acked-by.

PatchAlexander Shishkin
1/15R-b
2/15R-b
3/15R-b
4/15R-b
5/15R-b
6/15R-b
7/15R-b
8/15R-b
9/15R-b
10/15R-b
11/15R-b
12/15R-b
13/15R-b
14/15R-b
15/15R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/15] misc: nnpi: New PCIe driver for Intel's NNP-I pcie device

Hi,

The following series is a driver for a new PCIe device from Intel named NNP-I (Nirvana Neural Processor for Inference). NNP-I is a PCIe connected compute device used for acceleration of AI deep learning inference applications in the data-center.

The reason that this driver should be in the kernel is that it aims to serve multiple users and user-space applications which might share the same NNP-I card. Workloads from multiple applications can be processed simultanously by the NNP-I card if enough compute resources exist.

Overview of the NNP-I device, driver structure and ABIs used in the driver is in patch#1, which adds the info as a document as it might be a useful info for anyone trying to understand the driver even past review.

In order to ease the review process, there will be multiple series for the entire driver code. This is the first series, and it implements everything necessary to initialize the NNP-I device and allow a user-space inference application to use it. Other features, which are mostly related to maintenance, device status visibility and error-handling, will be submitted on the next stage.

A basic user-space library and test application which illustrates the flow of an NNP-I inference application can be found here: https://github.com/IntelAI/nnpi-host
(This series is enough for the test application to run)

This patchset has gone through internal review inside Intel, the summary of the change log from the internal review follows.

I would appreciate any feedback, questions or comments to this series.

Changes in v2:
- Removed email disclaimer added to the end of each patch.
- Small fix to Kconfig requested by Randy
- Removed from this cover letter the long Intel internal pre-review change log of this patchset.

Link to v1 cover letter: https://lwn.net/Articles/856037/

Guy Zadicario (15):
misc: nnpi: Document NNP-I's driver overview
misc: nnpi: Initialize NNP-I framework and PCIe modules
misc: nnpi: Manage and schedule messages to device
misc: nnpi: Define host/card ipc protocol
misc: nnpi: Manage host memory resources
misc: nnpi: Allow usermode to manage host resources
misc: nnpi: Disallow host memory resource access if no NNP-I devices
exist
misc: nnpi: Boot NNP-I device
misc: nnpi: Process device response messages
misc: nnpi: Query and verify device protocol
misc: nnpi: Create comm channel from app to device
misc: nnpi: Route device response messages
misc: nnpi: Expose command channel file interface
misc: nnpi: Create command channel from userspace
misc: nnpi: Map host resources to device channel

 Documentation/ABI/testing/sysfs-driver-intel_nnpi  |    5 +
 Documentation/misc-devices/index.rst               |    1 +
 Documentation/misc-devices/intel-nnpi.rst          |  237 +++++
 MAINTAINERS                                        |    6 +
 drivers/misc/Kconfig                               |    1 +
 drivers/misc/Makefile                              |    1 +
 drivers/misc/intel-nnpi/Kconfig                    |   18 +
 drivers/misc/intel-nnpi/Makefile                   |   13 +
 drivers/misc/intel-nnpi/bootimage.c                |  246 +++++
 drivers/misc/intel-nnpi/bootimage.h                |   43 +
 drivers/misc/intel-nnpi/cmd_chan.c                 |  790 ++++++++++++++
 drivers/misc/intel-nnpi/cmd_chan.h                 |  134 +++
 drivers/misc/intel-nnpi/device.c                   | 1081 ++++++++++++++++++++
 drivers/misc/intel-nnpi/device.h                   |  182 ++++
 drivers/misc/intel-nnpi/device_chardev.c           |  789 ++++++++++++++
 drivers/misc/intel-nnpi/device_chardev.h           |   14 +
 drivers/misc/intel-nnpi/host_chardev.c             |  353 +++++++
 drivers/misc/intel-nnpi/host_chardev.h             |   12 +
 drivers/misc/intel-nnpi/hostres.c                  |  627 ++++++++++++
 drivers/misc/intel-nnpi/hostres.h                  |  167 +++
 .../misc/intel-nnpi/ipc_include/ipc_c2h_events.h   |  198 ++++
 drivers/misc/intel-nnpi/ipc_include/ipc_protocol.h |  340 ++++++
 .../misc/intel-nnpi/ipc_include/nnp_boot_defs.h    |   71 ++
 drivers/misc/intel-nnpi/ipc_include/nnp_elbi.h     |   91 ++
 drivers/misc/intel-nnpi/msg_scheduler.c            |  319 ++++++
 drivers/misc/intel-nnpi/msg_scheduler.h            |  153 +++
 drivers/misc/intel-nnpi/nnp_pcie.c                 |  530 ++++++++++
 drivers/misc/intel-nnpi/nnp_user.c                 |  131 +++
 drivers/misc/intel-nnpi/nnp_user.h                 |   79 ++
 include/uapi/misc/intel_nnpi.h                     |  304 ++++++
 30 files changed, 6936 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-driver-intel_nnpi
 create mode 100644 Documentation/misc-devices/intel-nnpi.rst
 create mode 100644 drivers/misc/intel-nnpi/Kconfig
 create mode 100644 drivers/misc/intel-nnpi/Makefile
 create mode 100644 drivers/misc/intel-nnpi/bootimage.c
 create mode 100644 drivers/misc/intel-nnpi/bootimage.h
 create mode 100644 drivers/misc/intel-nnpi/cmd_chan.c
 create mode 100644 drivers/misc/intel-nnpi/cmd_chan.h
 create mode 100644 drivers/misc/intel-nnpi/device.c
 create mode 100644 drivers/misc/intel-nnpi/device.h
 create mode 100644 drivers/misc/intel-nnpi/device_chardev.c
 create mode 100644 drivers/misc/intel-nnpi/device_chardev.h
 create mode 100644 drivers/misc/intel-nnpi/host_chardev.c
 create mode 100644 drivers/misc/intel-nnpi/host_chardev.h
 create mode 100644 drivers/misc/intel-nnpi/hostres.c
 create mode 100644 drivers/misc/intel-nnpi/hostres.h
 create mode 100644 drivers/misc/intel-nnpi/ipc_include/ipc_c2h_events.h
 create mode 100644 drivers/misc/intel-nnpi/ipc_include/ipc_protocol.h
 create mode 100644 drivers/misc/intel-nnpi/ipc_include/nnp_boot_defs.h
 create mode 100644 drivers/misc/intel-nnpi/ipc_include/nnp_elbi.h
 create mode 100644 drivers/misc/intel-nnpi/msg_scheduler.c
 create mode 100644 drivers/misc/intel-nnpi/msg_scheduler.h
 create mode 100644 drivers/misc/intel-nnpi/nnp_pcie.c
 create mode 100644 drivers/misc/intel-nnpi/nnp_user.c
 create mode 100644 drivers/misc/intel-nnpi/nnp_user.h
 create mode 100644 include/uapi/misc/intel_nnpi.h
Signature · 1 line
1.8.3.1