mirror of
https://github.com/apache/nuttx.git
synced 2026-10-03 12:18:06 +00:00
Implements the device end of virtio-net, so a peer running the stock virtio-net driver sees this side as a network card, and registers a netdev lowerhalf. Ring layout follows the peer's numbering: vq[0] is its RX queue, which we fill to transmit, and vq[1] its TX queue, which we harvest. No features are negotiated, so every frame carries the zeroed legacy virtio_net_hdr. Peer buffers are reached by raw 64-bit address through an arch-provided translation window -- the AM67 RAT, identity mapping elsewhere -- splitting copies that straddle it. Also gives DRIVERS_VHOST a prompt; it was promptless and so unselectable without a driver forcing it. Verified on t3-gem-o1 against an unmodified Linux virtio_net: eth0 registers, ifup brings it to RUNNING, and the peer pings it 5/5 at 0.27 ms and 60/60 with 0% loss. Assisted-by: Claude Code:claude-fable-5 Signed-off-by: Ulaş Sertan Kemeç <sertan.usk@gmail.com>
52 lines
1.4 KiB
Text
52 lines
1.4 KiB
Text
#
|
|
# For a description of the syntax of this configuration file,
|
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
|
#
|
|
|
|
config ARCH_HAVE_VHOST_IOMAP
|
|
bool
|
|
default n
|
|
|
|
config DRIVERS_VHOST
|
|
bool "Virtual Host (device-role virtio) support"
|
|
select OPENAMP
|
|
select SCHED_WORKQUEUE
|
|
default n
|
|
---help---
|
|
Framework for implementing the DEVICE side of virtio links
|
|
(the peer's driver uses us as the device, e.g. a remoteproc
|
|
master like Linux). rptun registers device-role vdevs from the
|
|
resource table through this bus; without it such vdevs are
|
|
rejected with -ENODEV.
|
|
|
|
config DRIVERS_VHOST_RNG
|
|
bool "Virtual Host Rng Device Support"
|
|
default n
|
|
select DRIVERS_VHOST
|
|
|
|
config DRIVERS_VHOST_NET
|
|
bool "Virtual Host Network Device Support"
|
|
default n
|
|
depends on NETDEVICES
|
|
select DRIVERS_VHOST
|
|
---help---
|
|
Device-role virtio-net: expose this side as a network card to a
|
|
peer processor running a standard virtio-net driver (e.g. Linux
|
|
via remoteproc), providing a NuttX ethN interface.
|
|
|
|
config DRIVERS_VHOST_NET_MACADDR
|
|
hex "vhost-net MAC address"
|
|
default 0x025433000001
|
|
depends on DRIVERS_VHOST_NET
|
|
---help---
|
|
No virtio-net features are negotiated on this link, so there is
|
|
no MAC config space to read; this fixed, software-assigned,
|
|
locally administered address is presented to the network stack
|
|
instead.
|
|
|
|
config DRIVERS_VHOST_RPMSG
|
|
bool "Virtual Host Rpmsg Device Support"
|
|
default n
|
|
select RPMSG_VIRTIO
|
|
select DRIVERS_VHOST
|
|
|