mirror of
https://github.com/apache/nuttx.git
synced 2026-10-03 04:07:55 +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>
44 lines
1.3 KiB
Text
44 lines
1.3 KiB
Text
############################################################################
|
|
# drivers/vhost/Make.defs
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
# this work for additional information regarding copyright ownership. The
|
|
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
# "License"); you may not use this file except in compliance with the
|
|
# License. You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
#
|
|
############################################################################
|
|
|
|
# Include vhost support
|
|
|
|
ifeq ($(CONFIG_DRIVERS_VHOST),y)
|
|
CSRCS += vhost.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_DRIVERS_VHOST_RNG),y)
|
|
CSRCS += vhost-rng.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_DRIVERS_VHOST_NET),y)
|
|
CSRCS += vhost-net.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_DRIVERS_VHOST_RPMSG),y)
|
|
CSRCS += vhost-rpmsg.c
|
|
endif
|
|
|
|
# Include build support
|
|
|
|
DEPPATH += --dep-path vhost
|
|
VPATH += :vhost
|