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的更多相关文章

  1. 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 ' ...

  2. linux下lk和kernel层通信方式[2]

    U-Boot与Linux内核的交互 说明:本文所使用的U-Boot的版本是1.1.6,平台是S3C2440. 目录 一.简介 1.1标记列表二.设置标记存放的地址 2.1相关的结构体定义 2.2标记存 ...

  3. ORACLE Linux以及 Unbreakable Enterprise Kernel

    Oracle Linux,全称为Oracle Enterprise Linux,简称OEL,Linux发行版本之一.Oracle公司在2006年初发布第一个版本,以对Oracle软件和硬件支持较好见长 ...

  4. ARM Linux从Bootloader、kernel到filesystem启动流程

    转自:http://www.veryarm.com/1491.html ARM Linux启动流程大致为:bootloader ---->kernel---->root filesyste ...

  5. 在Linux运行期间升级Linux系统(Uboot+kernel+Rootfs)

    版本:v1.2   Crifan Li 摘要 本文主要介绍了如何在嵌入式Linux系统运行的时候,进行升级整个Linux系统,包括uboot,kernel和rootfs.以及简介Linux中的已有的通 ...

  6. Optimizing Linux network TCP/IP kernel parameters

    You can verify the Linux networking kernel parms from the root user with these commands::Many Oracle ...

  7. vbox下安装 linux 64 bit出现“kernel requires an x86_64 cpu

        今天在vbox下安装linux 64bit出现"kernel requires an x86_64 cpu, but only detected "的错误,网上有很多文章介 ...

  8. 开发人员需要熟知的常用Linux命令Version、Kernel查看

    当我们需要在Linux系统中安装一些软件而去下载安装文件时,一般都需要确认到底下载哪个版本的安装包,这就需要我们知道自己的Linux系统到底是什么版本.什么内核,常见的版本.内核查看命令或者文件有如下 ...

  9. linux overcommit flag

    linux中有一个overcomit的配置,这个配置关系到进程在过多申请memory资源的时候,系统的表现(启发式允许,不检查,or 阻止) /proc/sys/vm/overcommit_memor ...

随机推荐

  1. 20165302 实验一 java开发环境的熟悉

    20165302实验一 java开发环境的熟悉 一,实验内容与步骤 1.命令行下java程序开发 ①待编译运行代码 package csj; import java.util.Scanner; pub ...

  2. 用 S5PV210 学习 Linux (三) SD卡下载

    学习地址:http://edu.51cto.com/lesson/id-63015.html http://blog.csdn.net/karven_/article/details/52015325 ...

  3. NopCommerce学习(1) Caching

    redis教程 http://www.runoob.com/redis/redis-tutorial.html 下载地址:https://github.com/MSOpenTech/redis/rel ...

  4. 由使用request-promise-native想到的异步处理方法

    由使用request-promise-native想到的异步处理方法 问题场景 因为js语言的特性,使用node开发程序的时候经常会遇到异步处理的问题.对于之前专长App开发的我来说,会纠结node中 ...

  5. angular的生命周期

    什么是生命周期 生命周期函数通俗的讲就是组件创建.组件更新.组件销毁的时候会触发的一系列的方法. 当 Angular 使用构造函数新建一个组件或指令后,就会按下面的顺序在特定时刻调用这些 生命周期钩子 ...

  6. 洛谷P4602 [CTSC2018]混合果汁(主席树)

    题目描述 小 R 热衷于做黑暗料理,尤其是混合果汁. 商店里有 nn 种果汁,编号为 0,1,\cdots,n-10,1,⋯,n−1 . ii 号果汁的美味度是 d_idi​ ,每升价格为 p_ipi ...

  7. Android Studio 2.3.3 出现Error:(26.13) Fail to resole: com.android.support.appcompat永久解决方法

    Android Studio 出现Error(26.13):Fail to resole:com.android.support.appcompat-v7.28_ Install Repository ...

  8. Mysql-数据的完整性约束

    一 .介绍 二 .not null与default 三 .unique 四 .primary key 五 .auto_increment 六 .foreign key 一 .介绍 约束条件与数据类型的 ...

  9. PHP的strtotime()函数2038年bug问题

    最近在开发一个订单查询模块的时候,想当然的写了个2099年的日期,结果PHP返回了空值,肯定是发生溢出错误了,搜索了网上,发现下面这篇文章,但是我的问题依然没有解决,要怎么得到2038年以后的时间戳呢 ...

  10. stm32串口中断总结

    串口文件uart.c需要被用到; 串口通信是对GPIO端口引脚的功能复用,因此需要用到gpio.c; 因为中断的产生,因此中断文件也是需要用到的: 中断响应函数需要自己编写: 接收中断:在接收移位寄存 ...