linux 网络数据接收流程
2023-01-13 15:57:15 0 举报
简要描述了linux 各个网络各层接收处理数据的工作流程。 流程图对应文档:https://wenfh2020.com/2021/12/29/kernel-tcp-receive/
作者其他创作
大纲/内容
free
17
DMA
cacheRX FIFO
socket
+ sk : struct sock*
dma_map_single
used
__netif_receive_skb
3
net_rx_action
disable IRQ
inet_recvmsg
10
14
NIC driver
DDR
napi_gro_receive
RDT
__do_softirq
buf
read
11
8
__skb_queue_tail
e1000_probe
process_backlog
wenfh2020.comLinux 5.0.1
skb_put_data
e1000_receive_skb
IRQ
12
tcp_v4_rcv
e1000_irq_enable
napi_struct
5
struct e1000_rx_desc { __le64 buffer_addr; /* Address of the descriptor's data buffer */ __le16 length; /* Length of data DMAed into data buffer */ __le16 csum; /* Packet checksum */ u8 status; /* Descriptor status */ u8 errors; /* Descriptor Errors */ __le16 special;};
ring buffer
e1000_adapter
+ napi : struct napi_struct
010101011010101...
vfs_read
16
7
napi_poll
2
sock
+ sk_receive_queue : struct sk_buff_head
9
ip_rcv
sk_buff
dma_sync_single_for_cpu
drop
APPLICATION LAYER
6
__napi_schedule
1
softnet_data
+ poll_list : struct list_head+ process_queue : struct sk_buff_head+ input_pkt_queue : struct sk_buff_head+ backlog : struct napi_struct
RDH
e1000_alloc_rx_buffers
DATALINK / PHYSICAL LAYER
e1000_copybreak
tcp_recvmsg
e1000_clean
wakeup
rps
e1000_intr
13
dma_alloc_coherent
__raise_softirq_irqoff(NET_RX_SOFTIRQ)
NETWORK / TRANSPORT LAYER
e1000_clean_rx_irq
Y
CPU
4
tcp_data_ready
enqueue_to_backlog
qlen > netdev_max_backlog
15
N
NIC
e1000_open
0 条评论
回复 删除
下一页