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 ...
随机推荐
- 第一部分 CLR基础:第3章 共享程序集和强命名程序集
第一部分 CLR基础:第3章 共享程序集和强命名程序集
- oracle中=>是什么意思
=> 是 Oracle 中调用 存储过程的时候, 指定 参数名进行调用.一般是, 某些参数有默认值的时候,你需要跳过某些参数来进行调用.下面是具体的例子. 参数的默认值SQL> CREAT ...
- Silverlight Color的颜色值
1.MainPage.xaml <UserControl xmlns:SysManage="clr-namespace:Application" x:Class=" ...
- [转发]导出Excel 格式 mso-number-format
应用中经常会遇到要从系统或数据库中导出数据平面文件,一般是导出到txt,csv或excel.txt和csv一般用在系统间的数据交换,而 excel一般有较好的显示效果,可以按照一定的模板导出,导出就不 ...
- public void onItemClick(AdapterView arg0, View view, int position,long arg3)详解【整理自网络】
参考自: http://blog.csdn.net/zwq1457/article/details/8282717 http://blog.iamzsx.me/show.html?id=147001 ...
- 学一点Git--20分钟git快速上手 [Neil]
From: http://www.cnblogs.com/shuidao/p/3535299.html (图片已修复)在Git如日中天的今天,不懂git都不好意思跟人说自己是程序猿.你是不是早就跃跃欲 ...
- Server Tomcat v7.0 Server at localhost failed to start解决办法
今晚搞了下tomcat,在调试的时候发现报了这样一个错误Server Tomcat v7.0 Server at localhost failed to start 首先,确认了端口号8080是不是被 ...
- java中的接口回调
[接口回调]接口回调是多态的另一种体现.接口回调是指:可以把使用某一个接口的类创建的对象的引用赋给该接口声明的接口变量中,那么该接口变量就可以调用被类实现的接口中的方法.当接口变量调用被类实现的接口中 ...
- QPBOC扩展应用交易流程
1 Q扩展部分数据 增加3个DGI,分别为:A001,8020,9020 9103中增加DF60(9F38中),DF61 增加DF62,DF63 1.1 A001扩展应用配置 DGI 长度 值(示例 ...
- C# WinForm自定义控件响应键盘事件
自己定义的winform控件,用其他键盘事件都无法响应,只有用ProcessCmdKey事件可以达到目的(别忘了主窗体的KeyPreview属性要设置为true),写法如下: prot ...