-
-
Notifications
You must be signed in to change notification settings - Fork 158
refactor(net): the big network rebuild #977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Samuka007
wants to merge
82
commits into
master
Choose a base branch
from
feat-network-rebuild
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
82 commits
Select commit
Hold shift + click to select a range
40d9375
ready for merge in master (#964)
Samuka007 4e4ce68
updates uevent and make fmt
val213 178486f
新增CommonAttrGroup,基本支持sysfs下各种类型设备的uevent属性文件的读测试
val213 e67348c
修改net设备的uevent内容,使之与Linux语义一致
val213 49000bc
删除无用注释
val213 38d161c
feat: 支持 sysfs下 block, char, Net, rtc, tty 等类型设备的 uevent 文件读操作 (#973)
val213 b781eaa
Merge remote-tracking branch 'upstream/feat-network-rebuild' into uev…
val213 2e98aea
Merge remote-tracking branch 'upstream/feat-network-rebuild' into fea…
Samuka007 7cebb88
can ctrl-c interupt from blocking accept
Samuka007 8fe49e1
make fmt
Samuka007 bca536e
clean debug messages
Samuka007 9a1fe0f
Merge pull request #974 from Samuka007:feat-network-rebuild
Samuka007 63ccb53
merge master
Samuka007 91f24d4
Merge pull request #976 from Samuka007/feat-network-rebuild
Samuka007 d7be7de
清理积弊,不必要的动态分发和智能指针
val213 4a2b593
remove uevent and netlink
val213 7025b76
fmt
val213 b9f04fc
merge upstream
val213 886504f
remove uevent test
val213 10e62c7
Merge pull request #980 from val213/feat-network-rebuild
Samuka007 4736fad
重新组织代码分布
Samuka007 ce8026c
merge upstream/net
Samuka007 de148a1
remove unused imports
Samuka007 b9f27f4
fix it back to old syscall printing style
Samuka007 ddad6b1
regulate naming to posix
Samuka007 251e1bc
todo: socket close 及 port 接触占用
Samuka007 6c812d2
fix: format check
Samuka007 7cd11b4
feat: remove syscall prettier printing (#988)
Samuka007 149fc83
remove unnecessary warnings and impls
Samuka007 c9806be
loopback assign single ip, remove unnecessary comments
Samuka007 acd3485
fmt
Samuka007 954dd0a
Merge remote-tracking branch 'upstream/feat-network-rebuild'
Samuka007 7ead4a0
Merge pull request #992 from Samuka007/feat-network-rebuild
Samuka007 15cedf3
去除virtio_blk, virtio_net expect错误处理,直接返回错误
1037827920 bb23a04
Merge pull request #995 from 1037827920/patch-fix-virtio_error_handle
Samuka007 acfceaa
fix: 修复网卡顺序的bug (#996)
smallcjy a303dd0
fix: ipv6, AddressFamily有转换问题。
Samuka007 e0c7255
Merge remote-tracking branch 'upstream/feat-network-rebuild' into fea…
Samuka007 bca5197
make fmt
Samuka007 8189cb1
Merge pull request #1004 from Samuka007/feat-network-rebuild
Samuka007 fad1c09
feat(net): 实现unix抽象地址空间 (#1017)
smallcjy 055c144
feat(doc):添加网络子系统模块 (#1020)
smallcjy ff13f9f
fix(net): TCP Resources and add syscall print, change to use latest s…
Samuka007 2b180c4
debug and add socket option level print
Samuka007 4e8c71b
fix: fix udp and run dog in udp
smallcjy 7411864
Merge pull request #1041 from smallcjy:fix-udp
Samuka007 d675513
Merge branch 'DragonOS-Community:feat-network-rebuild' into feat-netw…
Samuka007 aaf9a5f
turn off syscall printing, remove unused imports and make fmt
Samuka007 e4115c9
turn off syscall printings
Samuka007 1a04676
merge main
Samuka007 bd5f713
Merge pull request #1048 from Samuka007/feat-network-rebuild
Samuka007 f438808
纸糊忙等tcp connecting,尚不明确连接可用的机制。
Samuka007 dab9a7a
turn off syscall
Samuka007 14c2143
Merge branch 'master' into feat-network-rebuild
fslongjin b749598
fix: 修正IfaceCommon的bounds字段的锁使用问题&调度问题
fslongjin 57e0b2e
feat(socket): 实现shutdown系统调用的基础结构并启用相关方法
xiaolin2004 bbea79e
feat(socket): 添加shutdown方法并实现ShutdownTemp的TryFrom转换
xiaolin2004 0896c33
Merge pull request #1064 from fslongjin:patch-fix-a-locking-problem
Samuka007 b9c07e0
Merge remote-tracking branch 'origin/master' into patch-merge-master-…
fslongjin 0e62017
fmt
fslongjin 1848f09
Merge pull request #1068 from fslongjin/patch-merge-master-1129
fslongjin c4c35ed
Merge remote-tracking branch 'upstream/master' into feat-network-rebuild
Samuka007 69dde46
fix(net): misc of resources release (#1096)
Samuka007 55d7280
fix(process): 修复copy_process的一些bug & 支持默认init进程传参 (#1083)
fslongjin 5b4d581
feat: 完善sys_reboot (#1084)
fslongjin 152dbf1
fix: 修复do_wait函数在wait所有子进程时,忘了释放锁就sleep的bug (#1089)
fslongjin 3364e04
feat(virtualization): 内核虚拟化支持 (#1073)
BrahmaMantra 5644e71
fix: 在插入新的timer时,边界条件判断不正确的问题 (#1091)
fslongjin b361310
fmt
Samuka007 a02f4c0
feat(net): Add Inet documenation
Samuka007 a22408b
Revert "Merge Master"
Samuka007 be0f09c
Merge pull request #1101 from DragonOS-Community/revert-1097-merge-ne…
Samuka007 9700b68
cleanup codes
Samuka007 17aa298
refactor: 将设备名称 "lo" 提取为常量 DEVICE_NAME
fslongjin 95f5e08
make fmt (#1109)
sparkzky 91511c9
Merge branch 'master' into feat-network-rebuild
Samuka007 9fb1d18
fmt (#1110)
sparkzky 06b0853
Merge branch 'master' into feat-network-rebuild
fslongjin 870c34c
refactor: 删除多余的代码
fslongjin 8fef80f
refactor: 移除网络重构分支中,use xxx::*的内容 (#1117)
fslongjin 2452957
feat(net): 引入kthread,将Inet-网卡处理流程移入内核线程中
Samuka007 32ca9b6
Merge remote-tracking branch 'upstream/master' into feat-network-rebuild
Samuka007 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
网络子系统 | ||
==================================== | ||
DragonOS 网络子系统 | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
inet | ||
unix |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Internet Protocol Socket | ||
|
||
众所都周之,这个 Inet Socket 常用的分为 TCP, UDP 和 ICMP。基于实用性,目前实现的是 TCP 和 UDP。 | ||
|
||
整个 Inet 网络协议栈与网卡的交互基于 `smoltcp` crate 来实现。 | ||
|
||
## Roadmap | ||
|
||
- [ ] TCP | ||
- [x] 接受连接 | ||
- [ ] 发起连接 | ||
- [ ] 半双工关闭 | ||
- [x] UDP | ||
- [x] 传输数据 | ||
- [ ] ICMP | ||
- [ ] ioctl | ||
- [ ] Misc | ||
- [ ] 硬中断转软中断的锁处理(避免死锁) | ||
- [ ] epoll_item 优化 | ||
- [ ] 优化 `inet port` 资源管理 | ||
|
||
## TCP | ||
|
||
根据 TCP 状态机来 TCP Socket 的几个状态类 | ||
- `Init`: 裸状态 | ||
- `Unbound`: 创建出来的状态 | ||
- `Bound`: 绑定了地址 | ||
- `Listening`: 监听状态 | ||
- `Connecting`: 连接中状态 | ||
- `Established`: 连接建立状态 | ||
|
||
## UDP | ||
|
||
UDP 是无连接的,所以没有连接状态。UDP 的状态只有 `Unbound` 和 `Bound` 两种。 | ||
|
||
## BoundInner | ||
|
||
另一个对于 Inet Socket 的抽象,用于处理绑定网卡的 `socket`,从而封装 `smoltcp` 的接口,提供统一的资源管理。 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# UNIX | ||
|
||
## unix socket | ||
|
||
unix - 用于进程间通信的socket | ||
|
||
|
||
## 描述 | ||
|
||
AF_UNIX socket family 用于在同一台机器中的不同进程之间的通信(IPC)。unix socket地址现支持绑定文件地址,未支持绑定abstract namespace抽象命名空间。 | ||
|
||
目前unix 域中合法的socket type有:SOCK_STREAM, 提供stream-oriented socket,可靠有序传输消息;SOCK_SEQPACKET,提供connection-oriented,消息边界和按发送顺序交付消息保证的socket。 | ||
|
||
### unix stream socket 进程通信描述 | ||
|
||
unix stream socket 提供进程间流式传输消息的功能。假设对端进程作为服务端,本端进程作为客户端。进程间使用stream socket通信过程如下: | ||
|
||
分别在对端进程和本端进程创建socket,服务端需要bind地址,客户端不必须bind地址。通信过程类似tcp三次握手流程:服务端调用listen系统调用进入监听状态,监听服务端bind的地址;客户端调用connect系统调用连接服务端地址;服务端调用accept系统调用接受来自客户端的连接,返回建立连接的新的socket。成功建立连接后可以调用write\send\sendto\sendmsg进行写操作,调用read\recv\recvfrom\recvmsg进行读操作。目前尚未支持非阻塞式读写,默认为阻塞式读写。读写完毕后调用close系统调用关闭socket连接。 | ||
|
||
### unix seqpacket socket 进程通信描述 | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.