CV-Bowen opened a new pull request, #21148:
URL: https://github.com/apache/nuttx/pull/21148
## Summary
Add `CONFIG_RPMSG_PORT_UART_COMPRESSION`. When enabled, the TX path
compresses the frame payload with `lzf_compress()` before byte escaping
and marks the frame with `CMD_LZF`; the RX path decompresses LZF frames
into a reserved rx queue buffer before handing them to the rpmsg port.
Payloads that do not compress are sent unchanged. Both ends of the link
must enable the option; it depends on `CONFIG_LIBC_LZF`.
## Impact
New option, default off. With it off the driver behaves as before
except that the frame command is set explicitly to 0. No API change.
## Testing
Host: Ubuntu 22.04.5 LTS x86_64, QEMU version 10.2.1, sim: cc (Ubuntu
13.1.0-8ubuntu1~22.04) 13.1.0, qemu-armv8a: aarch64-none-elf-gcc (Arm GNU
Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205
The qemu-armv8a server/proxy configurations bring up a port uart link
on /dev/ttyV0 (server2 <==> proxy2). `rpmsg ping all <n> 1024 3 0` sends
1024-byte payloads filled with one byte value over every rpmsg device;
cmd=3 makes the peer acknowledge and compare every byte, so a frame
that decompressed wrongly would be reported.
With compression on both ends (test-only defconfig addition, not part
of this PR):
```
CONFIG_LIBC_LZF=y
CONFIG_RPMSG_PORT_UART_COMPRESSION=y
```
the port uart link (`buffer_len: 2008` in the ping output) compared to
the same build without the option:
| | avg round trip | rate |
|---|---|---|
| option off | 75 ms / 81 ms (server / proxy) | 0.110 / 0.101 Mbit/s |
| option on | 35 ms / 26 ms (server / proxy) | 0.233 / 0.313 Mbit/s |
All cases, including two extra `rpmsg ping all 5 1024 3 0` runs from
each side, passed with the option on. Baseline with the option off:
Baseline (`test.sh`, cases: baseline.yaml):
- host: Ubuntu 22.04.5 LTS x86_64, QEMU version 10.2.1, sim: cc (Ubuntu
13.1.0-8ubuntu1~22.04) 13.1.0, qemu-armv8a: aarch64-none-elf-gcc (Arm GNU
Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205
- tested: nuttx f7c53a9d590 apps 1985c6667
- qemu-armv8a built with test-only overlay: disabled LIBC_ENVPATH
BINFMT_CHECKEXEC
- sim:rpserver + sim:rpproxy: PASS
- [x] `uname -a` (server)
- [x] `rpmsg dump all` (server)
- [x] `rpmsg ping all 10 1024 3 0` (server)
- [x] `uname -a` (proxy)
- [x] `rpmsg ping all 10 1024 3 0` (proxy)
- [x] `mount -t rpmsgfs -o cpu=server,fs=/proc /sp` (proxy)
- [x] `cat /sp/version` (proxy)
- [x] `rpmsg dump all` (proxy)
- qemu-armv8a:rpserver + qemu-armv8a:rpproxy: PASS
- [x] `uname -a` (server)
- [x] `uname -a` (proxy)
- [x] `rpmsg dump all` (server)
- [x] `rpmsg ping all 10 1024 3 0` (server)
- [x] `rpmsg ping all 10 1024 3 0` (proxy)
- [x] `mount -t rpmsgfs -o cpu=server,fs=/proc /sp` (proxy)
- [x] `cat /sp/version` (proxy)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]