Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipc: Base icmsg implementation on added packed buffer #64624

Merged

Conversation

eobalski
Copy link
Collaborator

Simplify the implementation of the icmsg based backends by replacing use of spsc_pbuf with newly added pbuf.
Note that at the begging when the icmsg backend was introduced it was written around similar memory access layer as pbuf (#43544).
This change is a step back to what was the initial idea behind icmsg - to be as simplest as possible.

By this change no-copy API is no longer possible, but this trade off is intentional.
icmsg using pbuf is meant to be used for use cases where relatively small amount of data is send.
Because of that complexity of no-copy is not a huge benefit.

In comparison to initial commit adding icmsg backend, the pbuf implementation is written with security awareness. For example reader does not rely on rd_idx received from the writer, and vice versa.

@zephyrbot zephyrbot added area: Samples Samples area: Devicetree Binding PR modifies or adds a Device Tree binding labels Oct 31, 2023
@eobalski eobalski added area: IPC Inter-Process Communication and removed area: Samples Samples area: Devicetree Binding PR modifies or adds a Device Tree binding labels Oct 31, 2023
@zephyrbot zephyrbot added area: Samples Samples area: Devicetree Binding PR modifies or adds a Device Tree binding labels Oct 31, 2023
dts/bindings/ipc/zephyr,ipc-icmsg.yaml Outdated Show resolved Hide resolved
include/zephyr/ipc/pbuf.h Outdated Show resolved Hide resolved
include/zephyr/ipc/pbuf.h Outdated Show resolved Hide resolved
include/zephyr/ipc/pbuf.h Outdated Show resolved Hide resolved
@eobalski eobalski force-pushed the NCSDK-22744/ipc_pbuf branch 7 times, most recently from 1f126af to 722ee81 Compare November 6, 2023 11:53
Emil Obalski added 4 commits November 7, 2023 13:40
Remove nocopy feature from icmsg_me backend.
The backend is not meant to be used to send big
data chunks thus no-copy feature is removed.
If one wants to use no-copy it is recommended
to use icmsg_me only for control messages while
allocator will shall be written seperately.

Signed-off-by: Emil Obalski <Emil.Obalski@nordicsemi.no>
This adds implementation of secure packed buffer.
Secure packed buffer is added with intention to be used
in icmsg backed backends.

Signed-off-by: Emil Obalski <Emil.Obalski@nordicsemi.no>
Add unit tests for packed buffer.

Signed-off-by: Emil Obalski <Emil.Obalski@nordicsemi.no>
Replace spsc_pbuf with pbuf implementation dedicated to
be used by IcMsg based backends.
The pbuf is written on top of simple read/write semantics
with minimal footprint and code complexity

Signed-off-by: Emil Obalski <Emil.Obalski@nordicsemi.no>
@eobalski eobalski mentioned this pull request Nov 8, 2023
9 tasks
@fabiobaltieri fabiobaltieri merged commit eb4fc3f into zephyrproject-rtos:main Nov 9, 2023
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Devicetree Binding PR modifies or adds a Device Tree binding area: IPC Inter-Process Communication area: Samples Samples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants