CV-Bowen opened a new pull request, #18259:
URL: https://github.com/apache/nuttx/pull/18259

   ## Summary
   
   This PR adds comprehensive documentation for RPMsg diagnostic tools and 
introduces priority support for RPMsg endpoints.
   
   ### Changes Overview
   
   | Commit | Description |
   |--------|-------------|
   | `549fa726e1c` | Change virtqueue dump log level to emergency |
   | `7890d5a534c` | Add rpmsg_ping documentation |
   | `97d1d0ef455` | Add priority support for rpmsg endpoint |
   | `455026a7a93` | Add rpmsg dump documentation |
   
   ## Motivation
   
   1. **Documentation Gap**: The RPMsg subsystem lacked documentation for its 
diagnostic tools (`rpmsg ping` and `rpmsg dump`), making it difficult for 
developers to troubleshoot inter-processor communication issues.
   
   2. **Debugging Visibility**: The virtqueue dump logs were using 
`METAL_LOG_DEBUG` level, which could be filtered out in production builds, 
making debugging difficult when issues occur.
   
   3. **Priority Support**: Different RPMsg endpoints may have different 
importance levels. Adding priority support allows for future scheduling 
optimizations and better resource management.
   
   ## Changes
   
   ### 1. Documentation: RPMsg Ping (`rpmsg_ping.rst`)
   
   Added comprehensive documentation for the RPMsg Ping diagnostic tool:
   - Command syntax and parameters explanation
   - Usage examples with sample output
   - Architecture workflow diagram showing the complete ping process
   - Best practices for latency and throughput testing
   
   ### 2. Documentation: RPMsg Dump (`rpmsg_dump.rst`)
   
   Added detailed documentation for the RPMsg Dump command:
   - Output format description (CPU info, endpoint list, virtqueue dump, buffer 
states)
   - Field-by-field explanation of dump output
   - Common debugging use cases:
     - TX buffer timeout issues
     - Communication failures
     - Buffer leak detection
   
   ### 3. OpenAMP Patch: Virtqueue Dump Log Level
   
   Changed `virtqueue_dump()` log level from `METAL_LOG_DEBUG` to 
`METAL_LOG_EMERGENCY` to ensure dump information is always visible when 
debugging issues.
   
   ### 4. OpenAMP Patch: RPMsg Endpoint Priority
   
   Added priority field to `struct rpmsg_endpoint`:
   - Priority constants: `RPMSG_PRIO_MIN` (0), `RPMSG_PRIO_DEFAULT` (127), 
`RPMSG_PRIO_MAX` (255)
   - `RPMSG_PRIO_RT` alias for real-time priority
   - Auto-initialization to default priority in `rpmsg_register_endpoint()`
   
   ## Files Changed
   
   ```
   Documentation/components/drivers/special/rpmsg/index.rst            |   2 +
   Documentation/components/drivers/special/rpmsg/rpmsg_dump.rst       | 199 +++
   Documentation/components/drivers/special/rpmsg/rpmsg_ping.rst       | 258 
++++
   openamp/0016-lib-virtio-virtqueue-change-the-virtqueue-dump-log-l.patch |  
29 +
   openamp/0017-lib-rpmsg-add-priority-support-for-rpmsg-endpoint.patch    |  
64 +
   openamp/open-amp.cmake                                              |   4 +
   openamp/open-amp.defs                                               |   2 +
   ```
   
   ## Impact
   
   - **Stability**: No impact - documentation only changes and additive API 
changes
   - **Compatibility**: Fully backward compatible - priority field defaults to 
127 if not explicitly set
   - **Documentation**: Significantly improves developer experience for RPMsg 
debugging
   - **Breaking Changes**: None
   
   ## Testing
   
   ### Build Verification
   
   ```bash
   # Configure and build for QEMU ARMv8-A
   cmake -B cmake_out/v8a_server -DBOARD_CONFIG=qemu-armv8a:v8a_server -GNinja
   cmake --build cmake_out/v8a_server
   
   cmake -B cmake_out/v8a_proxy -DBOARD_CONFIG=qemu-armv8a:v8a_proxy -GNinja
   cmake --build cmake_out/v8a_proxy
   ```
   
   ### Documentation Build
   
   ```bash
   cd Documentation
   make html
   # Verify new .rst files render correctly
   ```
   
   ### Runtime Testing (QEMU Dual-Core)
   
   **Test Environment:**
   - Host: Linux x86_64
   - Target: QEMU ARMv8-A (dual-core simulation)
   - Configuration: `qemu-armv8a:v8a_server` + `qemu-armv8a:v8a_proxy`
   
   Log
   ```c
   server> rpmsg ping all 1 1 1 1
   [    0.000000] [ 7] [ EMERG] [server] ping times: 1
   [    0.000000] [ 7] [ EMERG] [server] buffer_len: 1520, send_len: 17
   [    0.000000] [ 7] [ EMERG] [server] avg: 0 s, 16954704 ns
   [    0.000000] [ 7] [ EMERG] [server] min: 0 s, 16954704 ns
   [    0.000000] [ 7] [ EMERG] [server] max: 0 s, 16954704 ns
   [    0.000000] [ 7] [ EMERG] [server] rate: 0.008021 Mbits/sec
   [    0.000000] [ 7] [ EMERG] [server] ping times: 1
   [    0.000000] [ 7] [ EMERG] [server] buffer_len: 2024, send_len: 17
   [    0.000000] [ 7] [ EMERG] [server] avg: 0 s, 16483360 ns
   [    0.000000] [ 7] [ EMERG] [server] min: 0 s, 16483360 ns
   [    0.000000] [ 7] [ EMERG] [server] max: 0 s, 16483360 ns
   [    0.000000] [ 7] [ EMERG] [server] rate: 0.008250 Mbits/sec
   server> 
   server> 
   server> rpmsg dump all
   [    0.000000] [ 7] [ EMERG] [server] Local: server Remote: proxy Headrx 8
   [    0.000000] [ 7] [ EMERG] [server] Dump rpmsg info between cpu (master: 
yes)server <==> proxy:
   [    0.000000] [ 7] [ EMERG] [server] rpmsg vq RX:
   [    0.000000] [ 7] [ EMERG] [server] VQ: rx_vq - size=8; free=0; queued=0; 
desc_head_idx=32768; available_idx=0; avail.idx=16; used_cons_idx=8; used.idx1
   [    0.000000] [ 7] [ EMERG] [server] rpmsg vq TX:
   [    0.000000] [ 7] [ EMERG] [server] VQ: tx_vq - size=8; free=5; queued=0; 
desc_head_idx=3; available_idx=0; avail.idx=6; used_cons_idx=3; used.idx=6; a0
   [    0.000000] [ 7] [ EMERG] [server]   rpmsg ept list:
   [    0.000000] [ 7] [ EMERG] [server]     ept NS
   [    0.000000] [ 7] [ EMERG] [server]     ept rpmsg-sensor
   [    0.000000] [ 7] [ EMERG] [server]     ept rpmsg-ping
   [    0.000000] [ 7] [ EMERG] [server]     ept rpmsg-syslog
   [    0.000000] [ 7] [ EMERG] [server]   rpmsg buffer list:
   [    0.000000] [ 7] [ EMERG] [server]     RX buffer, total 8, pending 0
   [    0.000000] [ 7] [ EMERG] [server]     TX buffer, total 8, pending 0
   [    0.000000] [ 7] [ EMERG] [server] Remote: proxy2 state: 1
   [    0.000000] [ 7] [ EMERG] [server] ept NS
   [    0.000000] [ 7] [ EMERG] [server] ept rpmsg-sensor
   [    0.000000] [ 7] [ EMERG] [server] ept rpmsg-ping
   [    0.000000] [ 7] [ EMERG] [server] rpmsg_port queue RX: {used: 0, avail: 
8}
   [    0.000000] [ 7] [ EMERG] [server] rpmsg buffer list:
   [    0.000000] [ 7] [ EMERG] [server] rpmsg_port queue TX: {used: 0, avail: 
8}
   [    0.000000] [ 7] [ EMERG] [server] rpmsg buffer list:
   [    0.000000] [ 7] [ ALERT] [server] sched_dumpstack: backtrace| 5: 
0x00000000402a8500 0x00000000402aa1c4 0x000000004029bf78 0x000000004028ca54 
0x0000004
   [    0.000000] [ 7] [ ALERT] [server] sched_dumpstack: backtrace| 5: 
0x00000000402ace74
   [    0.000000] [ 7] [ ALERT] [server] sched_dumpstack: backtrace| 6: 
0x00000000402a8920 0x00000000402f59a4 0x00000000402bbcb0 0x00000000402bce4c 
0x0000004
   server> uname -a
   NuttX server 12.10.0 455026a7a93-dirty Jan 29 2026 16:27:05 arm64 qemu-armv8a
   server> 
   ```
   


-- 
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]

Reply via email to