fix:重构网络模块并补上文档#237
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request implements a major re-architecture of the network module, introducing a NetworkStack facade to centralize protocol stack operations and decoupling device drivers from interface management. Key changes include the addition of an explicit LoopbackNetDevice, refactored network syscalls using standardized error codes, and extensive documentation updates. Feedback highlights concerns regarding the broad suppression of compiler warnings in main.rs and build.rs, as well as opportunities to resolve implementation coupling between socket.rs and stack.rs and to encapsulate global state within the NetworkStack structure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ Feature / 新功能
🚀 描述 (Description)
本次拉取请求在
new-main上落实网络模块重构,主要改进如下:NetworkStack门面,将 smoltcp socket set、active interface runtime、loopback link 和 poll 推进统一放到os/src/net/stack.rs。SocketFile的读写、可读可写、recvfrom、sendto、drop 等路径改为经NetworkStack操作协议栈;网络 syscall 不再直接访问SOCKET_SET、NET_IFACE或smoltcp::socket::{tcp, udp}。NetDevice,接口创建统一由网络子系统入口负责;NetworkInterface不再直接实现Driver,改由NetDriverHandle作为兼容桥。LoopbackNetDevice,默认网络初始化确保lo存在;NullNetDevice不再承担 loopback 语义。document/net/面向读者的模块文档,并恢复/补充document/net/、document/arch/*/network_rearchitecture.md中的施工记录。.gitignore忽略各处AGENTS.md和docs/superpowers/草稿目录;补充 unused 类告警忽略标签,避免重构期间被旧未使用告警阻塞。本记录基于以下提交:
2d93e1d chore: 忽略本地代理与草稿文档16b161f docs: 更新网络重构文档11ca651 fix: 忽略未使用告警37cc37e fix: 收口网络协议栈运行时4ad26a9 fix: 拆分网络设备与接口e1281ae fix: 修正文档空行2f50599 docs:修正文档目录🔗 关联 Issue
暂无关联 Issue。