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

   ## Summary
   
   The sim rptun resource table only carried rpmsg, cons, rng and serial, so
   the other vdevs could not be brought up between the two sim instances.
   Add the rest of what the tree already has drivers for:
   
   - `ping`, with two vrings so either side can initiate
   - `blk`, backed by the `/dev/ram8` RAM disk the peer is expected to
     create (128 sectors)
   - `gpio`, with `CONFIG_IOEXPANDER_NPINS` lines
   - `i2c`, signalling `/dev/i2c0`
   - `spi`, with one chip select, signalling `/dev/spi0`
   
   Each gets its own shmem carveout, as serial does.
   
   The table is written by whichever instance is the master and parsed by
   the other, so its layout cannot depend on which frontends a core builds:
   reserve a pair of entries for every vdev, and spell out both gpio vrings
   even when the eventq is declined, since the config follows the vring
   array.
   
   ## Impact
   
   `arch/sim` only.  A core that builds none of these frontends still maps
   the same table, and the added entries are what the peer parses before any
   driver binds; a vdev without a host-side driver just stays idle.
   
   ## 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
   
   `sim:rpserver`/`sim:rpproxy` and `qemu-armv8a:rpserver`/`qemu-armv8a:rpproxy`
   build with 0 warnings, and the rpmsg baseline (dump, ping, rpmsgfs; 15/15)
   passes on both boards.  checkpatch passes.
   
   The pair still answers on the new entries.  With `CONFIG_DRIVERS_VHOST_PING`
   on `sim:rpproxy` (the master, which writes the table) and
   `CONFIG_DRIVERS_VIRTIO_PING` on `sim:rpserver`, the slave's `virtio dump`
   lists every vdev the table now carries, ping included, and a ping series
   completes in both directions — the initiating side only returns once each
   response has been signalled back:
   
   ```
   server> virtio dump
   [server] virtio_dump:   [unknown] id=63 vdev=0xe726e3e8 driver=0x4012d060 
priv=0xe726e480
   [server] virtio_ping_dump:     ping: name=ping0 txbufs=8 rxbufs=8
   [server] VQ: virtio_ping_tx - size=8; free=8; ...
   [server] VQ: virtio_ping_rx - size=8; free=0; ...
   [server] virtio_dump:   [Block] id=2 vdev=0xe726e788 driver=0 priv=0
   [server] virtio_dump:   [GPIO] id=41 vdev=0xe726e9c8 driver=0 priv=0
   [server] virtio_dump:   [I2C Adapter] id=34 vdev=0xe726ec20 driver=0 priv=0
   [server] virtio_dump:   [unknown] id=45 vdev=0xe726ee60 driver=0 priv=0
   server> virtio ping ping0 10 1024 0
   [server] virtio_ping_run: ping device: ping0
   [server] virtio_ping_run: ping times: 10, send_len: 1024
   [server] virtio_ping_logout: avg: 0 s, 9983066 ns
   [server] virtio_ping_logout_rate: rate: 0.831007 Mbits/sec
   ```
   
   ```
   proxy> vhost ping ping0 10 1024 0      (reached from the server nsh with `cu 
/dev/ttyproxy`)
   [proxy] vhost_ping_run: ping device: ping0
   [proxy] vhost_ping_run: ping times: 10, send_len: 1024
   [proxy] virtio_ping_logout: avg: 0 s, 9994096 ns
   [proxy] virtio_ping_logout_rate: rate: 0.830090 Mbits/sec
   ```
   
   `blk`, `gpio`, `i2c` and `spi` show up with no driver bound because those
   frontends are not enabled in this configuration; nothing on the peer side
   was brought up for them here.
   


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