patches and low-level development discussion
 help / color / mirror / code / Atom feed
* [DO_NOT_APPLY 0/2] xdp-forwarder
@ 2025-08-23 22:21 Yureka Lilian
  2025-08-23 22:21 ` [DO_NOT_APPLY 1/2] integrate xdp-forwarder into net-vm Yureka Lilian
  2025-08-23 22:21 ` [DO_NOT_APPLY 2/2] temporary changes for testing Yureka Lilian
  0 siblings, 2 replies; 10+ messages in thread
From: Yureka Lilian @ 2025-08-23 22:21 UTC (permalink / raw)
  To: devel; +Cc: Yureka Lilian

Hi all,

Since this worsens the networking situation unless combined with the
userspace Router (which is to-be-done), I am formally sending this out
for comments without expecting it to be applied for now.

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
included 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 program loaded on the physical interfaces 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.

I have verified that when running a wpa_supplicant / iwd in the
interface, a WiFi interface can correctly function as a physical
interface with the XDP forwarder, assuming that the router sends
packets with the correct source MAC address.


Yureka Lilian (2):
  integrate xdp-forwarder into net-vm
  temporary changes for testing

 lib/nixpkgs.default.nix                       |   4 +-
 vm/sys/net/Makefile                           |   8 +-
 vm/sys/net/default.nix                        |  38 +++++--
 vm/sys/net/etc/fstab                          |   1 +
 vm/sys/net/etc/mdev/iface                     |  23 +---
 vm/sys/net/etc/nftables.conf                  |   8 --
 vm/sys/net/etc/s6-rc/connman/dependencies     |   4 -
 vm/sys/net/etc/s6-rc/connman/type             |   1 -
 vm/sys/net/etc/s6-rc/connman/type.license     |   2 -
 vm/sys/net/etc/s6-rc/nftables/type            |   1 -
 vm/sys/net/etc/s6-rc/nftables/type.license    |   2 -
 vm/sys/net/etc/s6-rc/nftables/up              |   6 -
 vm/sys/net/xdp-forwarder/README.md            |   9 ++
 vm/sys/net/xdp-forwarder/default.nix          |  35 ++++++
 .../xdp-forwarder/include/parsing_helpers.h   |  38 +++++++
 .../xdp-forwarder/include/rewrite_helpers.h   | 103 ++++++++++++++++++
 vm/sys/net/xdp-forwarder/load_physical        |   4 +
 vm/sys/net/xdp-forwarder/load_router          |   6 +
 vm/sys/net/xdp-forwarder/prog_physical.c      |  28 +++++
 vm/sys/net/xdp-forwarder/prog_router.c        |  34 ++++++
 vm/sys/net/xdp-forwarder/set_router_iface.c   |  31 ++++++
 21 files changed, 325 insertions(+), 61 deletions(-)
 delete mode 100644 vm/sys/net/etc/nftables.conf
 delete mode 100644 vm/sys/net/etc/s6-rc/connman/dependencies
 delete mode 100644 vm/sys/net/etc/s6-rc/connman/type
 delete mode 100644 vm/sys/net/etc/s6-rc/connman/type.license
 delete mode 100644 vm/sys/net/etc/s6-rc/nftables/type
 delete mode 100644 vm/sys/net/etc/s6-rc/nftables/type.license
 delete mode 100644 vm/sys/net/etc/s6-rc/nftables/up
 create mode 100644 vm/sys/net/xdp-forwarder/README.md
 create mode 100644 vm/sys/net/xdp-forwarder/default.nix
 create mode 100644 vm/sys/net/xdp-forwarder/include/parsing_helpers.h
 create mode 100644 vm/sys/net/xdp-forwarder/include/rewrite_helpers.h
 create mode 100755 vm/sys/net/xdp-forwarder/load_physical
 create mode 100755 vm/sys/net/xdp-forwarder/load_router
 create mode 100644 vm/sys/net/xdp-forwarder/prog_physical.c
 create mode 100644 vm/sys/net/xdp-forwarder/prog_router.c
 create mode 100644 vm/sys/net/xdp-forwarder/set_router_iface.c

-- 
2.50.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-09-01 14:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-23 22:21 [DO_NOT_APPLY 0/2] xdp-forwarder Yureka Lilian
2025-08-23 22:21 ` [DO_NOT_APPLY 1/2] integrate xdp-forwarder into net-vm Yureka Lilian
2025-08-30 10:59   ` Alyssa Ross
2025-08-31 17:10     ` Alyssa Ross
2025-08-31 18:06       ` Yureka
2025-08-31 20:50     ` Yureka
2025-09-01 13:59       ` Alyssa Ross
2025-09-01 14:04         ` Yureka
2025-09-01 14:12           ` Alyssa Ross
2025-08-23 22:21 ` [DO_NOT_APPLY 2/2] temporary changes for testing Yureka Lilian

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).