Softnet_data
Softnet_data的初始化:
每个CPU的softnet_data是在net_dev_init中初始化的,代码如下:
"/net/core/dev.c" "static int __init net_dev_init(void)"
for_each_possible_cpu(i) {
struct softnet_data *queue;
queue = &per_cpu(softnet_data, i);
skb_queue_head_init(&queue->input_pkt_queue);
queue->completion_queue = NULL;
INIT_LIST_HEAD(&queue->poll_list); queue->backlog.poll = process_backlog;
queue->backlog.weight = weight_p;
queue->backlog.gro_list = NULL;
queue->backlog.gro_count = ;
} "include/linux/netdevice.h"
struct softnet_data
{
struct Qdisc *output_queue;
struct sk_buff_head input_pkt_queue;
struct list_head poll_list;
struct sk_buff *completion_queue; struct napi_struct backlog;
}; struct napi_struct {
/* The poll_list must only be managed by the entity which
29 * changes the state of the NAPI_STATE_SCHED bit. This means
30 * whoever atomically sets that bit can add this napi_struct
31 * to the per-cpu poll_list, and whoever clears that bit
32 * can remove from the list right before clearing the bit.
33 */
struct list_head poll_list; unsigned long state;
int weight;
int (*poll)(struct napi_struct *, int);
#ifdef CONFIG_NETPOLL
spinlock_t poll_lock;
int poll_owner;
#endif unsigned int gro_count; struct net_device *dev;
struct list_head dev_list;
struct sk_buff *gro_list;
struct sk_buff *skb;
};
Softnet_data的更多相关文章
- Linux网络栈下两层实现
http://www.cnblogs.com/zmkeil/archive/2013/04/18/3029339.html 1.1简介 VLAN是网络栈的一个附加功能,且位于下两层.首先来学习Linu ...
- Linux Network Related Drive
catalog . 通过套接字通信 . 网络实现的分层模型 . 网络命名空间 . 套接字缓冲区 . 网络访问层 . 网络层 . 传输层 . 应用层 . 内核内部的网络通信 1. 通过套接字通信 Lin ...
- 网络数据包收发流程(二):不配置NAPI的情况
一.no NAPI 数据结构不配置NAPI的时候,网络设备不使用自己的napi_struct结构,所有网络设备驱动都使用同一个napi_struct,即cpu私有变量__get_cpu_var(sof ...
- linux2.6.24内核源代码分析(2)——扒一扒网络数据包在链路层的流向路径之一
在2.6.24内核中链路层接收网络数据包出现了两种方法,第一种是传统方法,利用中断来接收网络数据包,适用于低速设备:第二种是New Api(简称NAPI)方法,利用了中断+轮询的方法来接收网络数据包, ...
- Linux内核NAPI机制分析
转自:http://blog.chinaunix.net/uid-17150-id-2824051.html 简介:NAPI 是 Linux 上采用的一种提高网络处理效率的技术,它的核心概念就是不采用 ...
- Monitoring and Tuning the Linux Networking Stack: Receiving Data
http://blog.packagecloud.io/eng/2016/06/22/monitoring-tuning-linux-networking-stack-receiving-data/ ...
- Linux协议栈函数调用流程
普通网络驱动程序中必须要调用的函数是eth_type_trans(略),然后向上递交sk_buff时调用netif_rx()(net/core/dev.c).其函数中主要几行 __skb_queue_ ...
- 深入理解linux网络技术内幕读书笔记(十)--帧的接收
Table of Contents 1 概述 1.1 帧接收的中断处理 2 设备的开启与关闭 3 队列 4 通知内核帧已接收:NAPI和netif_rx 4.1 NAPI简介 4.1.1 NAPI优点 ...
- 深入理解linux网络技术内幕读书笔记(九)--中断与网络驱动程序
Table of Contents 1 接收到帧时通知驱动程序 1.1 轮询 1.2 中断 2 中断处理程序 3 抢占功能 4 下半部函数 4.1 内核2.4版本以后的下半部函数: 引入软IRQ 5 ...
随机推荐
- Win 2003下IIS6+Mysql+php5.2 isapi搭建 升级php5.2到5.3测试 借助fastcgi实现
Win 2003下IIS6+Mysql+php5.2 原环境isapi搭建 升级php5.2到5.3测试 借助fastcgi实现 操作如下 实验前准备:php-5.3.5-Win32-VC6-x86 ...
- 反编译工具(.NET Reflector )
1.下载安装原程序,然后运行 Reflector.exe 2.运行注册机,点击 Generate 获得序列号 3.把序列号填写到 Reflector 软件上4.断开网络,点击 Activate 激活( ...
- Html5元素及基本语法
HTML标签开始标签(opening tag):开放标签结束标签(closing tag):闭合标签 元素定义:HTML元素指的是从开始标签到结束标签的代码(元素以开始标签为起始以借宿标签终止)元素的 ...
- 【转】IE11的变化
1.navigator.userAgent中不再包含“MSIE”关键字 2.用javascript的判断是否是IE11的方法是: var isIE11 = (sUserAgent.toLowerCas ...
- 2013-10-25笔记,css: mini-width, 标准居中,样式中*号使用,背景图像位置定位
mini-width:设置元素的最小宽度.該屬性值會對元素的寬度設置一個最小限制.因此,元素可以比制定值寬,但不能比制定值窄.不允許指定負值. 完美的居中佈局: body{text-align: ce ...
- Android中style的使用
摘自搜搜问问. <item name="#1">#2</item> 1.item 的name属性#1可以为所有系统所带组件的属性,#2为此属性的值如andr ...
- wing IDE破解方法
WingIDE是我接触到最好的一款Python编译器了.但其属于商业软件,注册需要一笔不小的费用.因此,这篇简短的文章主要介绍了破解WingIDE的方法.破解软件仅供学习或者教学使用,如果您是商业使用 ...
- mongodb 3.2存储目录结构说明
[root@hadoop1 mongodb]# tree ./data ./data |-- WiredTiger | |-- WiredTiger.lock | |-- WiredTiger.tur ...
- 共享内存shared pool (3):Library cache
Shared pool物理层面上由许多内存块(chunck)组成.从逻辑功能划分,Shared pool主要由三部分组成:Library cache,Dictionary cache和Control ...
- LINUX开启允许对外访问的网络端口
LINUX开启允许对外访问的网络端口 LINUX通过下面的命令可以开启允许对外访问的网络端口: /sbin/iptables -I INPUT -p tcp --dport 8000 -j ACCE ...