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. Kali-linux其他信息收集手段

    上面介绍了使用不同的工具以操作步骤的形式进行了信息收集.在Kali中还可以使用一些常规的或非常规方法来收集信息,如使用Recon-NG框架.Netdiscover工具和Shodan工具等.本节将介绍使 ...

  2. 发送邮件 html格式

    下面黄色代码为实现发送邮件 FileStream fs = new FileStream(Server.MapPath("../ImportUserIOExcel/productConsul ...

  3. @PostConstruct与@PreDestroy讲解及实例

    关于在spring  容器初始化 bean 和销毁前所做的操作定义方式有三种: 第一种:通过@PostConstruct 和 @PreDestroy 方法 实现初始化后和销毁bean之前进行的操作 第 ...

  4. cocos2d-x3.0 用CCDictionary写文件

    bool CDownLoad_LocalData::WriteToConfigFile( DownLoadLocalData* downdata ){ CCDictionary* pDict = CC ...

  5. 【腾讯敏捷转型No.2】帅哥,来多少敏捷?

    上回腾讯敏捷转型系列第一篇文章<敏捷到底是什么鬼?>讲到公司铁了心要推进敏捷,这是战略层面的决定,为什么呢? 当时的我们并不知道公司为什么一定要推行敏捷的新概念,但是后来公司的变化帮助我们 ...

  6. js实现全选、全不选、反选的功能

    <!DOCTYPE html> <html> <head> <META charset="utf-8"/> <link rel ...

  7. java web 常识

    model.addattribute()的作用: 1.往前台传数据可以传对象,List,通过el表达式${}获取,类似于request.setAttribute("sts",sts ...

  8. RHS 和 LHS

    不成功的的RHS 引用会导致抛出 ReferenceError异常 不成的的LHS 引用会导致自动隐式地创建一个全局变量(非严格模式下)   function foo(a) { var b = a; ...

  9. S/4 HANA中发票输出切换回NAST

    在S/4 HANA中,新的输出管理Output Management叫做SAP S/4HANA output control(输出控制),是基于BRF+的,而不是原来基于NAST的.关于S4新的输出控 ...

  10. MongoDB的入门

    MongoDB mongodb是非关系型数据库 对于关系型数据库,存储数据的时候需要提前建表建库,随着数据的复杂度越来越高,所建的表的数量也越来越多:但是非关系型却不需要 mongodb的基本的命令的 ...