Repository navigation
nshlib: add a ping subcommand to the virtio and vhost commands - #4112
Merged
Merged
Conversation
xiaoxiang781216
approved these changes
Nov 23, 2026
GUIDINGLI
approved these changes
Nov 24, 2026
Add "virtio ping <name> <times> <len> <period(ms)>" (and the same for vhost), which runs a ping measurement through VIRTIOIOC_PING on /dev/virtio, or VHOSTIOC_PING on /dev/vhost, and leaves the result in syslog. Raise the maximum argument count of both commands to 6, so the framework passes the extra arguments to the handler. Signed-off-by: wangyongrong <wangyongrong@xiaomi.com> Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
CV-Bowen
force-pushed
the
up/P127-virtio-ping
branch
from
November 24, 2026 13:04
563dd50 to
cc63376
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a
pingsubcommand to the nshvirtioandvhostcommands:It fills a
struct virtio_ping_sand issuesVIRTIOIOC_PINGon/dev/virtio(orVHOSTIOC_PINGon/dev/vhost); the kernel prints theresult to syslog.
<name>is the ping instance name shown byvirtio dump/vhost dump, orall. The maximum argument count of bothcommands goes from 3 to 6 so the extra arguments reach the handler.
Depends on apache/nuttx#22167 (merged; the virtio ping device and
VIRTIOIOC_PING) and apache/nuttx#22236 (the vhost side andVHOSTIOC_PING).Impact
nsh
virtio/vhostonly.dumpbehaves as before; the help textgains the ping usage.
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
Built and used together with apache/nuttx#22167 and apache/nuttx#22236 on
qemu-armv8a:rpserver + qemu-armv8a:rpproxy (rptun over ivshmem, with a
test-only ping vdev in the resource table) and on sim:rpserver +
sim:rpproxy. See that PR for the measurements.
virtio dump all/vhost dump allunchanged (baseline cases below).No regression in rpmsg: sim:rpserver/rpproxy and qemu-armv8a:rpserver/rpproxy boot and pass the fixed rpmsg cases (dump, ping, rpmsgfs; 15/15). No regression in virtio: qemu-armv8a:netnsh boot and pass the fixed virtio cases (rng, blk on mmio and pci, net, 9p; 24/24). qemu-armv8a was built with LIBC_ENVPATH and BINFMT_CHECKEXEC disabled, which current master needs for nxinit to start nsh there; unrelated to this change.