diff options
author | Mikael Olsson <mikael.olsson@arm.com> | 2023-10-30 11:10:56 +0100 |
---|---|---|
committer | Mikael Olsson <mikael.olsson@arm.com> | 2023-11-06 09:36:00 +0100 |
commit | c081e5954cd92165b139488e76bdfef1402acee6 (patch) | |
tree | 32bc237c124e21f12287150cba040c87c8e8b7e3 /README.md | |
parent | 9c999fdd40c0bf2ae420f6f3bfe013dc6baa73c1 (diff) | |
download | ethos-u-linux-driver-stack-c081e5954cd92165b139488e76bdfef1402acee6.tar.gz |
Change create network UAPI to take a user buffer
To not allow the buffer for a network instance to be changed after
creation, the create network UAPI will now take the network model data
as a user buffer. The content of the user buffer is copied into an
internally allocated DMA buffer that cannot be accessed by the user.
This breaks the current API so the Linux kernel NPU driver version and
the driver library version have been given major version bumps. All the
tests, documentation and other applications affected by the changes have
been updated accordingly.
Change-Id: I25c785d75a24794c3db632e4abe5cfbb1c7ac190
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -219,7 +219,7 @@ dispatching inferences to the Ethos-U kernel driver. As the component diagram below illustrates the network is separated from the inference, allowing multiple inferences to share the same network. The buffer -class is used to store any data. +class is used to store IFM and OFM data. ![Driver library](docs/driver_library_component.svg "Driver library component diagram") @@ -232,9 +232,9 @@ The `Device` class opens a file descriptor to the device node `/dev/ethosu<nr>`. This file descriptor is used to issue IOCTL request to kernel space to create buffers and networks. -The `Network` class uses the `Device` object to create a new network object. The -network model is stored in a `Buffer` that the network parses to discover the -dimensions of the network model. +The `Network` class uses the `Device` object to create a new network object. +The network model is provided in a user buffer that is copied into an internal +buffer and parsed to discover the dimensions of the network model. The `Inference` class uses the `Network` object to create an inference. The array of IFM `Buffers` need to be populated with data before the inference @@ -259,13 +259,11 @@ for reading and/or writing. ## Network Creating a network assumes that the device node has already been opened, and -that a buffer has been allocated and populated with the network model. +that a user buffer populated with the network model is available. A new network is created by issuing an IOCTL command on the device node file -descriptor. A file descriptor to a buffer - containing the network model - is -passed in the IOCTL data. The network class increases the reference count on the -buffer, preventing the buffer from being freed before the network object has -been destructed. +descriptor. A pointer to the user buffer - containing the network model - and +its size is passed in the IOCTL data. ![Create network](docs/kernel_network.svg "Create network") |