Linux Kernel 网络子系统

#NAPI

NAPI机制采用中断和轮询结合的方式收包

softnet_data per-cpu 全局变量,保存网络收包的backlog

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
struct softnet_data {
struct Qdisc *output_queue;
struct Qdisc **output_queue_tailp;
struct list_head poll_list; //设备轮询列表
struct sk_buff *completion_queue;
struct sk_buff_head process_queue;
/* 统计数据 */
unsigned int processed;
unsigned int time_squeeze;
unsigned int cpu_collision;
unsigned int received_rps;
unsigned dropped; //被丢弃的包的数量
struct sk_buff_head input_pkt_queue; //收包队列
struct napi_struct backlog; //处理积压队列的napi结构
};

softnet_data