CV-Bowen opened a new pull request, #20962:
URL: https://github.com/apache/nuttx/pull/20962
## Summary
Add the device side of virtio-blk. The frontend's block requests are
served from a local block device or file whose path the driver reads
from the device config space (`struct vhost_blk_config_s`), on a
dedicated kernel thread.
IN and OUT requests seek to `req->sector` and read or write the data
buffer; FLUSH issues `BIOC_FLUSH` when `VIRTIO_BLK_F_FLUSH` was
negotiated. The result is written to the status byte of the last
descriptor. It uses the protocol definitions that #20895 moved to
`include/nuttx/virtio/virtio-blk.h`.
## Impact
New, off by default: `CONFIG_DRIVERS_VHOST_BLK` (selects
`DRIVERS_VHOST`), with `_PRIORITY` and `_STACKSIZE`. Adds
`struct vhost_blk_config_s` to `include/nuttx/virtio/virtio-blk.h`.
Nothing changes unless it is enabled.
## 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
Build only: `qemu-armv8a:rpserver` with `CONFIG_DRIVERS_VHOST_BLK=y`
builds without warnings. No in-tree transport creates a device-role
`VIRTIO_ID_BLOCK` vdev yet, so the backend is not exercised at run time
here; the rpmsg baseline below only shows nothing else regressed.
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 a1ac9b4206a apps ea8addeaf
- 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]