CV-Bowen opened a new pull request, #20977:
URL: https://github.com/apache/nuttx/pull/20977
## Summary
Add the device side of virtio-can (device ID 36). The driver finds the
local SocketCAN interface named in the device config space, opens a raw
CAN socket on it, and bridges the three virtqueues: frames queued by the
peer on the tx queue are sent on the local bus, frames received locally
are returned on the rx queue, and the control queue carries the
interface queue state. CAN FD frames are supported when the peer
negotiated the feature.
It also adds `vhost_get_vq_buffers_lock()`, the locked variant of
`vhost_get_vq_buffers()`.
## Impact
New, off by default: `CONFIG_DRIVERS_VHOST_CAN` (`depends on NET_CAN`,
selects `DRIVERS_VHOST`). Adds `vhost_get_vq_buffers_lock()` to
`include/nuttx/vhost/vhost.h`, which needs
`CONFIG_NETDEV_IFINDEX` like the rest of the driver.
## 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_NET_CAN`,
`CONFIG_NETDEV_IFINDEX`, `CONFIG_DRIVERS_VHOST_CAN` and CAN support in
the net stack builds without warnings. No in-tree transport creates a
device-role `VIRTIO_ID_CAN` 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 9e3001de6e9 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]