Network Receive Path#
- 内核网络包接收流程
- Illustrated Guide to Monitoring and Tuning the Linux Networking Stack: Receiving Data
- Monitoring and Tuning the Linux Networking Stack: Receiving Data
- Overview
- Detailed Look
- Network Device Driver
- SoftIRQs
- Linux network device subsystem
- Initialization of network device subsystem
- Data arrives
- Network data processing begins
- Generic Receive Offloading (GRO)
napi_gro_receive
napi_skb_finish
- Receive Packet Steering (RPS)
- Receive Flow Steering (RFS)
- Hardware accelerated Receive Flow Steering (aRFS)
- Moving up the network stack with
netif_receive_skb
netif_receive_skb
- Protocol layer registration
- Extras
- Conclusion
- The Performance Analysis of Linux Networking – Packet Receiving
- The Linux networking stack - Testing Cassandra Throughput Performance Part 3
- Debugging network stalls on Kubernetes
- Linux 网络栈接收数据(RX):原理及内核实现(2022)
- 0 收包过程(RX)俯瞰
- 1 网卡驱动初始化
- 2 网卡收包
- 3 DMA 将包复制到 RX 队列 (ring buffer)
- 4 触发硬件中断(IRQ)
- 5 内核调度到
ksoftirqd
线程 - 6 软中断处理:从 ringbuffer 取数据送到协议栈
- 7 进入内核协议栈:L2 处理
- 8 L3 协议层处理(IPv4)
- 9 L4 协议层处理(UDP)
- 9.0 UDP 协议初始化
- 9.1 L4 handler 注册:
udp_v4_early_demux()/udp_v4_rcv()
- 9.2
udp_rcv() -> __udp4_lib_rcv()
- 9.3
__udp4_lib_rcv() -> udp_unicast_rcv_skb()
- 9.4
udp_unicast_rcv_skb() -> udp_queue_rcv_skb()
- 9.5
udp_queue_rcv_skb() -> udp_queue_rcv_one_skb() -> __udp_queue_rcv_skb()
- 9.6
__udp_queue_rcv_skb() -> __skb_queue_tail() -> socket's receive queue
- 9.7 小结
- 10 其他问题讨论
- 10 总结
- 参考资料