Linux checksum flag in kernel
net_device->feature
| NETIF_F_NO_CSUM: No need to use L4 checksum, it used for loopback device.
| NETIF_F_IP_CSUM: the device can compute L4 checksum in hardware, but only for TCP and UDP over IPv4.
| NETIF_F_HW_CSUM: the device can compute the L4 checksum in hardware for any protocol.
For receive path:
skb->csum may hold the L4 checksum(when skb->ip_summed == CHECKSUM_COMPLETE, this filed hold the checksum provided by hardware).
skb->ip_summed: indicate the checksum status.
CHECKSUM_NONE: the checksum in csum is not valid, this can be due to:
1. device doesn't provide hardware checksumming.
2. hardware found the packet is corrupted, in normal case, it should drop this packet and not discard this packet, but the driver may want the kernel to re-check it again,so it set this flag.
IMPORTANT: if the packet is going to be forwarded, the router should not discard it dure to wrong L4 checksum (a route is not supposed to check L4 checksum). but the receiver need to check it.
3. the checksum need be recomputed nd reverified.
CHECKSUM_HW: the NIC hs computed the checksum on the L4 header and payload. and has copied it into the skb->csum field. The software needs to add checksum on the pseduo-heder to generate the result checksum.
CHECHSUM_UNNECESSARY: the NIC has computed and verified the checksum. software doesn't need to verify the checksum again.
For TX path: skb->csum: tell hardware to put the checksum at this offset of the packet.
skb->ip_summed, CHECKSUM_NONE: the software has processed the checksum, hardware doesn't need to do anything.
CHECKSUM_HW: software computed the checksum of the pseudo-header. hardware need to adding this checksum to L4 header and payload.
refer:tcp_v4_checksum_init for rx, tcp_v4_send_check for tx in kernel code.
Linux checksum flag in kernel的更多相关文章
- Android开发:Android虚拟机启动错误Can't find 'Linux version ' string in kernel image file
Android启动出错,虚拟机报错信息如下: Starting emulator for AVD 'test' emulator: ERROR: Can't find 'Linux version ' ...
- linux下lk和kernel层通信方式[2]
U-Boot与Linux内核的交互 说明:本文所使用的U-Boot的版本是1.1.6,平台是S3C2440. 目录 一.简介 1.1标记列表二.设置标记存放的地址 2.1相关的结构体定义 2.2标记存 ...
- ORACLE Linux以及 Unbreakable Enterprise Kernel
Oracle Linux,全称为Oracle Enterprise Linux,简称OEL,Linux发行版本之一.Oracle公司在2006年初发布第一个版本,以对Oracle软件和硬件支持较好见长 ...
- ARM Linux从Bootloader、kernel到filesystem启动流程
转自:http://www.veryarm.com/1491.html ARM Linux启动流程大致为:bootloader ---->kernel---->root filesyste ...
- 在Linux运行期间升级Linux系统(Uboot+kernel+Rootfs)
版本:v1.2 Crifan Li 摘要 本文主要介绍了如何在嵌入式Linux系统运行的时候,进行升级整个Linux系统,包括uboot,kernel和rootfs.以及简介Linux中的已有的通 ...
- Optimizing Linux network TCP/IP kernel parameters
You can verify the Linux networking kernel parms from the root user with these commands::Many Oracle ...
- vbox下安装 linux 64 bit出现“kernel requires an x86_64 cpu
今天在vbox下安装linux 64bit出现"kernel requires an x86_64 cpu, but only detected "的错误,网上有很多文章介 ...
- 开发人员需要熟知的常用Linux命令Version、Kernel查看
当我们需要在Linux系统中安装一些软件而去下载安装文件时,一般都需要确认到底下载哪个版本的安装包,这就需要我们知道自己的Linux系统到底是什么版本.什么内核,常见的版本.内核查看命令或者文件有如下 ...
- linux overcommit flag
linux中有一个overcomit的配置,这个配置关系到进程在过多申请memory资源的时候,系统的表现(启发式允许,不检查,or 阻止) /proc/sys/vm/overcommit_memor ...
随机推荐
- Samba服务器的配置与使用
1.系统环境变量 Fedora: yum install libacl-devel libblkid-devel gnutls-devel \ readline-devel python-devel ...
- 字符型设备驱动程序-first-printf以及点亮LED灯(四)
怎么样 把 写的 代码 和 编译 放到 开发板上 去执行? 2017年5月22日16:34:13 需要 自己 编译 Linux 内核.. 需要 以下 几个 条件: 1.正常运行 Linux 的 开发 ...
- 寻找最小的k个数(四种方法)
1 使用从大到小的优先队列保存最小的K个数,每次取出K个数之后的其余数和堆顶元素比较,如果比堆顶元素小,则将堆顶元素删除,将该元素插入 void topK(int arr[],int n,int k) ...
- JAVA项目服务器部署
1.下载 Java JDK 搜索jdk下载,然后进入JAVA官方网站jdk下载页,选择自己的对应的操作系统,点击下载 https://www.oracle.com/technetwork/java/j ...
- ansible常用配置
1.什么是Ansible 部署参考连接:http://www.ansible.com.cn/ ansible是新出现的自动化运维工具,基于Python开发,集合了众多运维工具(puppet.cfeng ...
- PHP-----PHP程序设计基础教程----第二章PHP基本语法
博文结构: 2.1 PHP语法风格 2.1.1 PHP标记 PHP有四种风格的标记,具体如表2-1所示: 表2-1 PHP开始和结束标记 标记类型 开始标记 结束标记 示例 说明 标准标记 <? ...
- UITextView 光标定位
在使用UITextView的时候, 如何在光标的位置插入字符 或者 图片? 以下Demo为你解答: 应用背景:键盘自定义emoji表情 #pragma mark - KVO - (void)obser ...
- ios中input输入无效
项目中一个登陆界面的input在安卓下可以输入,iOS下无法输入,经查询为 设置了-webkit-user-select:none;将其改为-webkit-user-select:auto;修正. 参 ...
- 03.搭建Spark集群(CentOS7+Spark2.1.1+Hadoop2.8.0)
接上一篇:https://www.cnblogs.com/yjm0330/p/10077076.html 一.下载安装scala 1.官网下载 2.spar01和02都建立/opt/scala目录,解 ...
- Python学习之——Oracle数据库连接
一.安装Oracle客户端 1.下载对应安装文件,官网地址:http://www.oracle.com/technetwork/database/database-technologies/insta ...