From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id E1C85193D1; Mon, 01 Sep 2025 20:13:07 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 5DE18193A2; Mon, 01 Sep 2025 20:13:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 Received: from mail.cyberchaos.dev (mail.cyberchaos.dev [195.39.247.168]) by atuin.qyliss.net (Postfix) with ESMTPS id 8F8D21939B for ; Mon, 01 Sep 2025 20:13:04 +0000 (UTC) From: Yureka Lilian DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cyberchaos.dev; s=mail; t=1756757583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q5FJqzmD1AFcmMbAwmpWDbXGlY9iOu2QCnD9YaKqLCM=; b=ZWyizkOKVJy1kECabgAotr5uaFwgvfU5wNb8gl5vCpj+MWS30v/+l+iR851RdwHymeLVRg Ka+9oId9TV7Z0IpPHbKsRhwZTIya0Y8USCQ3p4qAdiXCBHdi6tkPdH9wjIlWaOyBVORqJ5 /nMJsrdZ2AJM/yMbfWSSFuslN/YTxIY= To: devel@spectrum-os.org Subject: [DO_NOT_APPLY v3 3/3] docs/architecture: add paragraph about networking Date: Mon, 1 Sep 2025 22:12:41 +0200 Message-ID: <20250901201248.19794-4-yureka@cyberchaos.dev> In-Reply-To: <20250901201248.19794-1-yureka@cyberchaos.dev> References: <20250901201248.19794-1-yureka@cyberchaos.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: P2RBQ32LDK4NFX6DTFVNNJBUJ523QDJB X-Message-ID-Hash: P2RBQ32LDK4NFX6DTFVNNJBUJ523QDJB X-MailFrom: yureka@cyberchaos.dev X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Yureka Lilian X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --- Documentation/about/architecture.adoc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Documentation/about/architecture.adoc b/Documentation/about/architecture.adoc index e32ab27..2b86616 100644 --- a/Documentation/about/architecture.adoc +++ b/Documentation/about/architecture.adoc @@ -68,3 +68,23 @@ nix-build img/live --no-out-link | xargs -o nix-tree See the https://diode.zone/w/8DBDQ6HQUe5UUdLkpDuL35[video] of Spectrum live image interactive analysis with nix-tree. + +== Networking + +The net-vm's purpose is running the Linux drivers for any physical +interfaces on the spectrum system. + +A net-vm (there could be multiple, one per IOMMU-group) will load the +xdp-forwarder XDP programs on the passed-through physical interfaces as well +as the downstream virtio interface going into the router (recognized by +its special MAC address) using mdev events. + +The net-vm needs to multiplex between the physical interfaces, as there +might be several interfaces in the same IOMMU-group. + +For this, the xdp-forwarder applies a +VLAN tag corresponding to the interface id, and redirects the packets to +the router interface (identified by the router_iface bpf map). +In the other direction the XDP program loaded on the router interface +removes one layer of VLAN tagging, and redirects the packets to the +interface read from the VLAN tag. -- 2.50.1