Skip to content

feat(net): add RTL8111/8168 and RTL8125 Ethernet drivers - #8

Merged
Leonmmcoset merged 2 commits into
mainfrom
feature/realtek-network
Nov 12, 2026
Merged

Leonmmcoset merged 2 commits into
mainfrom
feature/realtek-network

Conversation

@VasilyZa

@VasilyZa VasilyZa commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

改动

增加原生 r8169 网卡驱动,扩大 ReliefNT 的 Realtek PCIe 有线网卡覆盖。

  • 支持 RTL8111/8168 已登记的 B、C、CP、D、DP、E、E-VL、F、G、GU、H、EP、FP MAC XID,以及 RTL8125 A、B、D-1、D-2。未知 XID 返回 -ENODEV。
  • 接入现有单 eth0 provider,使用单队列轮询、MTU 1500、64 位 DMA 和经典收发描述符。包含 PHY 初始化、链路读取、帧校验、失败回滚和安全卸载。
  • CONFIG_R8169 默认内置,支持 m 生成 r8169.ko,提供 8168、8125 的 PCI 模块别名。
  • 按目录接入原生 Kbuild,增加驱动宿主测试和驱动说明。
  • 保留 OpenBSD ISC、BSD-4-Clause 代码声明与 Realtek 固件分发许可,将许可和 NOTICE 纳入版本化模块载荷。

已合入当前 main 的 336e2bc,包括移除旧内核诊断模式的改动。分支头为 8abccff468ddd2501c6be76d114f229b03f64cba。

验证

在合并后的源码上完成以下检查。

  • python3 tools/test_r8169.py 通过,ASan/UBSan 覆盖已登记 MAC 路径、DMA 环边界、错误帧、资源失败、卸载重试,以及真实 I/O 和延时对象。
  • tools/test_install_bundle.py、tools/test_module_layout.py、tools/test_test_ownership.py 通过。
  • 原生 make 的 CONFIG_R8169=y 内核构建、模块安装通过。
  • 原生 make 的 CONFIG_R8169=m 内核、模块及完整 install 通过。
  • ReliefOS 当前主仓工具成功校验并 staging 真实安装包,确认模块、两个 PCI 别名和五份许可文件完整。
  • QEMU 内置配置启动通过。模块配置通过两个 PCI 别名和模块名完成三次加载、卸载,既有 e1000 的 IPv4、IPv6 ping 通过。两次来宾正常关机,退出码为零。
  • git diff --check origin/main...HEAD 通过。

验证边界

  • QEMU 使用 e1000 网卡。当前 QEMU 缺少 RTL8168、RTL8125 设备模型,实体 Realtek 的初始化、PHY 协商、收发、吞吐和微秒时序仍待对应硬件验证。
  • 短延时精度依赖现有内核启动时钟。当前网络 provider 仅提供单 eth0、单队列轮询。
  • VMware 验证未完成。
  • 前次完整宿主测试运行中发现既有 EEVDF 夹具的 struct task 大小及偏移静态断言失败,已记录。全套测试未完成,本次复跑了上述定向检查。

ReliefOS 集成

对应的主仓 gitlink 更新与打包验证见关联 PR。ReliefOS #76

Add revision-specific MAC and PHY initialization, embedded RTL8125 firmware,
64-bit coherent DMA rings, copper autonegotiation, bounded error handling
and owner-managed shutdown for the supported Realtek PCIe controllers.

Integrate CONFIG_R8169 as default built-in or r8169.ko with PCI aliases.
Retain the OpenBSD BSD-4-Clause and ISC notices and the Realtek firmware
permission, including them in the versioned kernel installation payload.

Validate built-in and module builds, ASan/UBSan hardware-boundary and I/O
timing tests, and QEMU boot/module cycles with e1000 IPv4/IPv6 regression.
The full host suite was interrupted and an existing EEVDF fixture layout
assertion failure remains recorded. Physical Realtek PHY, traffic,
throughput and timing validation and VMware validation remain pending.
@Leonmmcoset
Leonmmcoset merged commit 044ce9b into main Nov 12, 2026
2 checks passed
@Leonmmcoset
Leonmmcoset deleted the feature/realtek-network branch November 12, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants