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 ...
随机推荐
- oracle数据库之用户管理
转载 Oracle创建用户.角色.授权.建表 一.oracle数据库的权限系统分为系统权限与对象权限: 系统权限( database system privilege )可以让用户执行特定的命令集 ...
- Apollo2.5摄像头安装
前言:在Apollo美研团队和长沙CiDi团队的支持下,最近完成了Apollo推荐的摄像头AR023ZWDR(Rev663F12)调试,在这里对Apollo的笔记做一个补充,希望以后的开发者不用在踩我 ...
- Linux本地数据上传到阿里云OSS
这篇文章主要是介绍如何将服务器本地的数据上传到阿里云OSS的指定bucket中,最重要的参考文档是数据迁移单机部署.我第一次上传数据到OSS上时,步骤要比前面的链接中介绍的要麻烦,ossimport工 ...
- Kubernetes(二)-- 搭建(未完待续)
一.部署前规划 1. 操作系统初始化设置 :需要设置好集群机器,关闭防火墙和selinux 2. 创建ca证书和私钥 :集群间通信要加密,那么肯定要有ca的创建,以后就用这一步创建的ca当作证书颁发机 ...
- centos7字体中英文转化
[root@localhost oracle]#vi /etc/locate.conf,把里面的内容改为: 转化为英文: LANG="en_US.UTF-8"LANGUAGE=&q ...
- java获取服务器基本信息
实现步骤: (1)创建servlet BrowserServer (2)调用HttpServletRequest对象的getServerName()方法获取服务器名称 (3)调用HttpServlet ...
- activeMQ的request-response请求响应模式
一:为什么需要请求响应模式 在消息中间中,生产者只负责生产消息,而消费者只负责消费消息,两者并无直接的关联.但是如果生产者想要知道消费者有没有消费完,或者用不用重新发送的时候,这时就要用到请求响应模式 ...
- opacity(透明度)属性设置
1.opacity:是属性,整个元素包含子元素全部都会透明,取值范围0-1; 2.background-color:rgba(0,0,0,.5)rgba是值,用于背景,取值范围0-1. 补充:a-al ...
- tp5上传压缩包到相应文件并自动解压到相应文件下
<?phpnamespace app\admin\controller\upload; use app\common\controller\Backend;use think\db;use th ...
- tp5多入口配置
手册里可能有写,但不是特别清晰,在这给个实例,有两种方式: 1.多个入口文件: 将public下的index.php复制一份,粘贴.重命名为对应模块的名字,如admin: 编辑admin.php的内容 ...