/linux-6.12.1/tools/testing/selftests/tc-testing/tc-tests/actions/ |
D | csum.json | 4 "name": "Add csum iph action", 7 "csum" 14 "$TC actions flush action csum", 20 "cmdUnderTest": "$TC actions add action csum iph index 800", 22 "verifyCmd": "$TC actions get action csum index 800", 23 "matchPattern": "action order [0-9]*: csum \\(iph\\) action pass.*index 800 ref", 26 "$TC actions flush action csum" 31 "name": "Add csum ip4h action", 34 "csum" 41 "$TC actions flush action csum", [all …]
|
/linux-6.12.1/arch/riscv/lib/ |
D | csum.c | 5 * Influenced by arch/arm64/lib/csum.c 22 __u32 len, __u8 proto, __wsum csum) in csum_ipv6_magic() argument 25 unsigned long sum = (__force unsigned long)csum; in csum_ipv6_magic() 93 unsigned long csum = 0, carry = 0; in do_csum_common() local 101 csum += data; in do_csum_common() 102 carry += csum < data; in do_csum_common() 116 csum += data; in do_csum_common() 117 carry += csum < data; in do_csum_common() 118 csum += carry; in do_csum_common() 119 csum += csum < carry; in do_csum_common() [all …]
|
/linux-6.12.1/arch/riscv/include/asm/ |
D | checksum.h | 39 unsigned long csum = 0; in ip_fast_csum() local 43 csum += ((const unsigned int *)iph)[pos]; in ip_fast_csum() 45 csum += csum < ((const unsigned int *)iph)[pos]; in ip_fast_csum() 66 not %[fold_temp], %[csum] \n\ in ip_fast_csum() 67 rori %[csum], %[csum], 16 \n\ in ip_fast_csum() 68 sub %[csum], %[fold_temp], %[csum] \n\ in ip_fast_csum() 70 : [csum] "+r" (csum), [fold_temp] "=&r" (fold_temp)); in ip_fast_csum() 74 rori %[fold_temp], %[csum], 32 \n\ in ip_fast_csum() 75 add %[csum], %[fold_temp], %[csum] \n\ in ip_fast_csum() 76 srli %[csum], %[csum], 32 \n\ in ip_fast_csum() [all …]
|
/linux-6.12.1/arch/s390/include/asm/ |
D | checksum.h | 45 u32 csum = (__force u32) sum; in csum_fold() local 47 csum += (csum >> 16) | (csum << 16); in csum_fold() 48 csum >>= 16; in csum_fold() 49 return (__force __sum16) ~csum; in csum_fold() 58 __u64 csum = 0; in ip_fast_csum() local 61 csum += *ptr++; in ip_fast_csum() 62 csum += *ptr++; in ip_fast_csum() 63 csum += *ptr++; in ip_fast_csum() 64 csum += *ptr++; in ip_fast_csum() 67 csum += *ptr++; in ip_fast_csum() [all …]
|
/linux-6.12.1/net/netfilter/ |
D | utils.c | 14 __sum16 csum = 0; in nf_ip_checksum() local 21 !csum_fold(skb->csum)) || in nf_ip_checksum() 24 skb->csum)) { in nf_ip_checksum() 31 skb->csum = 0; in nf_ip_checksum() 33 skb->csum = csum_tcpudp_nofold(iph->saddr, iph->daddr, in nf_ip_checksum() 36 csum = __skb_checksum_complete(skb); in nf_ip_checksum() 38 return csum; in nf_ip_checksum() 48 __sum16 csum = 0; in nf_ip_checksum_partial() local 56 skb->csum = csum_tcpudp_nofold(iph->saddr, iph->daddr, protocol, in nf_ip_checksum_partial() 61 return csum; in nf_ip_checksum_partial() [all …]
|
/linux-6.12.1/include/net/ |
D | checksum.h | 59 static __always_inline __wsum csum_add(__wsum csum, __wsum addend) in csum_add() argument 61 u32 res = (__force u32)csum; in csum_add() 67 static __always_inline __wsum csum_sub(__wsum csum, __wsum addend) in csum_sub() argument 69 return csum_add(csum, ~addend); in csum_sub() 72 static __always_inline __sum16 csum16_add(__sum16 csum, __be16 addend) in csum16_add() argument 74 u16 res = (__force u16)csum; in csum16_add() 80 static __always_inline __sum16 csum16_sub(__sum16 csum, __be16 addend) in csum16_sub() argument 82 return csum16_add(csum, ~addend); in csum16_sub() 96 csum_block_add(__wsum csum, __wsum csum2, int offset) in csum_block_add() argument 98 return csum_add(csum, csum_shift(csum2, offset)); in csum_block_add() [all …]
|
D | udp.h | 38 * @partial_cov: if set indicates partial csum coverage 133 __wsum csum = csum_partial(skb_transport_header(skb), in udp_csum_outgoing() local 136 csum = csum_add(csum, skb->csum); in udp_csum_outgoing() 138 return csum; in udp_csum_outgoing() 143 __wsum csum = csum_partial(skb_transport_header(skb), in udp_csum() local 144 sizeof(struct udphdr), skb->csum); in udp_csum() 147 csum = csum_add(csum, skb->csum); in udp_csum() 149 return csum; in udp_csum() 164 skb->csum = csum_partial(skb->data, sizeof(struct udphdr), in udp_csum_pull_header() 165 skb->csum); in udp_csum_pull_header() [all …]
|
D | gso.h | 20 __wsum csum; member 53 SKB_GSO_CB(skb)->csum = res; in gso_reset_checksum() 59 * then add in skb->csum (checksum from csum_start to end of packet). 60 * skb->csum and csum_start are then updated to reflect the checksum of the 69 __wsum partial = SKB_GSO_CB(skb)->csum; in gso_make_checksum() 71 SKB_GSO_CB(skb)->csum = res; in gso_make_checksum()
|
/linux-6.12.1/arch/mips/include/asm/ |
D | checksum.h | 77 static inline __sum16 csum_fold(__wsum csum) in csum_fold() argument 79 u32 sum = (__force u32)csum; in csum_fold() 82 csum = (__force __wsum)(sum < (__force u32)csum); in csum_fold() 84 sum += (__force u32)csum; in csum_fold() 101 unsigned int csum; in ip_fast_csum() local 104 csum = word[0]; in ip_fast_csum() 105 csum += word[1]; in ip_fast_csum() 106 carry = (csum < word[1]); in ip_fast_csum() 107 csum += carry; in ip_fast_csum() 109 csum += word[2]; in ip_fast_csum() [all …]
|
/linux-6.12.1/samples/bpf/ |
D | xdp_adjust_tail_kern.c | 58 static __always_inline __u16 csum_fold_helper(__u32 csum) in csum_fold_helper() argument 60 return ~((csum & 0xffff) + (csum >> 16)); in csum_fold_helper() 64 __u32 *csum) in ipv4_csum() argument 66 *csum = bpf_csum_diff(0, 0, data_start, data_size, *csum); in ipv4_csum() 67 *csum = csum_fold_helper(*csum); in ipv4_csum() 85 __u32 csum = 0; in send_icmp4_too_big() local 100 ipv4_csum(icmp_hdr, ICMP_TOOBIG_PAYLOAD_SIZE, &csum); in send_icmp4_too_big() 101 icmp_hdr->checksum = csum; in send_icmp4_too_big() 112 csum = 0; in send_icmp4_too_big() 113 ipv4_csum(iph, sizeof(struct iphdr), &csum); in send_icmp4_too_big() [all …]
|
/linux-6.12.1/tools/testing/selftests/bpf/ |
D | network_helpers.h | 99 static __u16 csum_fold(__u32 csum) in csum_fold() argument 101 csum = (csum & 0xffff) + (csum >> 16); in csum_fold() 102 csum = (csum & 0xffff) + (csum >> 16); in csum_fold() 104 return (__u16)~csum; in csum_fold() 109 __wsum csum) in csum_tcpudp_magic() argument 111 __u64 s = csum; in csum_tcpudp_magic() 125 __wsum csum) in csum_ipv6_magic() argument 127 __u64 s = csum; in csum_ipv6_magic()
|
/linux-6.12.1/arch/powerpc/lib/ |
D | checksum_wrappers.c | 17 __wsum csum; in csum_and_copy_from_user() local 22 csum = csum_partial_copy_generic((void __force *)src, dst, len); in csum_and_copy_from_user() 25 return csum; in csum_and_copy_from_user() 30 __wsum csum; in csum_and_copy_to_user() local 35 csum = csum_partial_copy_generic(src, (void __force *)dst, len); in csum_and_copy_to_user() 38 return csum; in csum_and_copy_to_user()
|
/linux-6.12.1/arch/s390/kernel/ |
D | os_info.c | 44 os_info.csum = os_info_csum(&os_info); in os_info_crashkernel_add() 54 os_info.entry[nr].csum = (__force u32)cksm(ptr, size, 0); in os_info_entry_add_data() 55 os_info.csum = os_info_csum(&os_info); in os_info_entry_add_data() 65 os_info.entry[nr].csum = 0; in os_info_entry_add_val() 66 os_info.csum = os_info_csum(&os_info); in os_info_entry_add_val() 89 os_info.csum = os_info_csum(&os_info); in os_info_init() 106 u32 csum; in os_info_old_alloc() local 124 csum = (__force u32)cksm(buf_align, size, 0); in os_info_old_alloc() 125 if (csum != os_info_old->entry[nr].csum) { in os_info_old_alloc() 164 if (os_info_old->csum != os_info_csum(os_info_old)) in os_info_old_init()
|
/linux-6.12.1/fs/ext4/ |
D | bitmap.c | 47 __u32 csum; in ext4_inode_bitmap_csum_set() local 55 csum = ext4_chksum(sbi, sbi->s_csum_seed, (__u8 *)bh->b_data, sz); in ext4_inode_bitmap_csum_set() 56 gdp->bg_inode_bitmap_csum_lo = cpu_to_le16(csum & 0xFFFF); in ext4_inode_bitmap_csum_set() 58 gdp->bg_inode_bitmap_csum_hi = cpu_to_le16(csum >> 16); in ext4_inode_bitmap_csum_set() 89 __u32 csum; in ext4_block_bitmap_csum_set() local 95 csum = ext4_chksum(sbi, sbi->s_csum_seed, (__u8 *)bh->b_data, sz); in ext4_block_bitmap_csum_set() 96 gdp->bg_block_bitmap_csum_lo = cpu_to_le16(csum & 0xFFFF); in ext4_block_bitmap_csum_set() 98 gdp->bg_block_bitmap_csum_hi = cpu_to_le16(csum >> 16); in ext4_block_bitmap_csum_set()
|
/linux-6.12.1/fs/btrfs/ |
D | file-item.c | 275 * Return 0 for the range [disk_bytenr, disk_bytenr + sectorsize) has no csum 296 /* Check if the current csum item covers disk_bytenr */ in search_csum_tree() 337 * Lookup the checksum for the read bio in csum tree. 363 * - All our csums should only be in csum tree in btrfs_lookup_bio_sums() 377 bbio->csum = kmalloc_array(nblocks, csum_size, GFP_NOFS); in btrfs_lookup_bio_sums() 378 if (!bbio->csum) { in btrfs_lookup_bio_sums() 383 bbio->csum = bbio->csum_inline; in btrfs_lookup_bio_sums() 388 * kick the readahead for csum tree. in btrfs_lookup_bio_sums() 397 * between reading the free space cache and updating the csum tree. in btrfs_lookup_bio_sums() 407 u8 *csum_dst = bbio->csum + in btrfs_lookup_bio_sums() [all …]
|
/linux-6.12.1/tools/testing/selftests/bpf/progs/ |
D | test_tcp_custom_syncookie.c | 136 /* Needed to calculate csum and parse TCP options. */ in tcp_reload_headers() 161 static __sum16 tcp_v4_csum(struct tcp_syncookie *ctx, __wsum csum) in tcp_v4_csum() argument 164 ctx->tcp->doff * 4, IPPROTO_TCP, csum); in tcp_v4_csum() 167 static __sum16 tcp_v6_csum(struct tcp_syncookie *ctx, __wsum csum) in tcp_v6_csum() argument 170 ctx->tcp->doff * 4, IPPROTO_TCP, csum); in tcp_v6_csum() 175 s64 csum; in tcp_validate_header() local 180 csum = bpf_csum_diff(0, 0, (void *)ctx->tcp, ctx->tcp->doff * 4, 0); in tcp_validate_header() 181 if (csum < 0) in tcp_validate_header() 185 /* check tcp_v4_csum(csum) is 0 if not on lo. */ in tcp_validate_header() 187 csum = bpf_csum_diff(0, 0, (void *)ctx->ipv4, ctx->ipv4->ihl * 4, 0); in tcp_validate_header() [all …]
|
/linux-6.12.1/net/sched/ |
D | act_csum.c | 157 skb->csum = csum_partial(icmph, ipl - ihl, 0); in tcf_csum_ipv4_icmp() 158 icmph->checksum = csum_fold(skb->csum); in tcf_csum_ipv4_icmp() 174 igmph->csum = 0; in tcf_csum_ipv4_igmp() 175 skb->csum = csum_partial(igmph, ipl - ihl, 0); in tcf_csum_ipv4_igmp() 176 igmph->csum = csum_fold(skb->csum); in tcf_csum_ipv4_igmp() 195 skb->csum = csum_partial(icmp6h, ipl - ihl, 0); in tcf_csum_ipv6_icmp() 198 skb->csum); in tcf_csum_ipv6_icmp() 220 skb->csum = csum_partial(tcph, ipl - ihl, 0); in tcf_csum_ipv4_tcp() 222 iph->saddr, iph->daddr, skb->csum); in tcf_csum_ipv4_tcp() 244 skb->csum = csum_partial(tcph, ipl - ihl, 0); in tcf_csum_ipv6_tcp() [all …]
|
/linux-6.12.1/drivers/infiniband/hw/qib/ |
D | qib_eeprom.c | 117 u8 csum = 0, len; in flash_csum() local 128 csum += *ip++; in flash_csum() 129 csum -= ifp->if_csum; in flash_csum() 130 csum = ~csum; in flash_csum() 132 ifp->if_csum = csum; in flash_csum() 134 return csum; in flash_csum() 150 u8 csum, *bguid; in qib_get_eeprom_info() local 199 csum = flash_csum(ifp, 0); in qib_get_eeprom_info() 200 if (csum != ifp->if_csum) { in qib_get_eeprom_info() 203 csum, ifp->if_csum); in qib_get_eeprom_info()
|
/linux-6.12.1/block/partitions/ |
D | sgi.c | 32 __be32 csum; /* Disk label checksum */ member 38 int i, csum; in sgi_partition() local 59 for(csum = 0; ui >= ((__be32 *) label);) { in sgi_partition() 61 csum += be32_to_cpu(cs); in sgi_partition() 63 if(csum) { in sgi_partition() 64 printk(KERN_WARNING "Dev %s SGI disklabel: csum bad, label corrupted\n", in sgi_partition()
|
/linux-6.12.1/tools/testing/selftests/net/ |
D | udpgso.sh | 85 echo "ipv4 hw-gso hw-csum" 88 echo "ipv6 hw-gso hw-csum" 91 echo "ipv4 sw-gso hw-csum" 94 echo "ipv6 sw-gso hw-csum" 97 echo "ipv4 sw-gso sw-csum" 100 echo "ipv6 sw-gso sw-csum"
|
/linux-6.12.1/net/netfilter/ipvs/ |
D | ip_vs_proto_udp.c | 166 /* ret=2: csum update is needed after payload mangling */ in udp_snat_handler() 184 /* Only port and addr are changed, do fast csum update */ in udp_snat_handler() 193 skb->csum = skb_checksum(skb, udphoff, skb->len - udphoff, 0); in udp_snat_handler() 199 cp->protocol, skb->csum); in udp_snat_handler() 206 skb->csum); in udp_snat_handler() 210 IP_VS_DBG(11, "O-pkt: %s O-csum=%d (+%zd)\n", in udp_snat_handler() 250 /* ret=2: csum update is needed after payload mangling */ in udp_dnat_handler() 268 /* Only port and addr are changed, do fast csum update */ in udp_dnat_handler() 277 skb->csum = skb_checksum(skb, udphoff, skb->len - udphoff, 0); in udp_dnat_handler() 283 cp->protocol, skb->csum); in udp_dnat_handler() [all …]
|
/linux-6.12.1/block/ |
D | t10-pi.c | 24 static __be16 t10_pi_csum(__be16 csum, void *data, unsigned int len, in t10_pi_csum() argument 29 return cpu_to_be16(crc_t10dif_update(be16_to_cpu(csum), data, len)); in t10_pi_csum() 72 __be16 csum; in t10_pi_verify() local 92 csum = t10_pi_csum(0, iter->data_buf, iter->interval, in t10_pi_verify() 95 csum = t10_pi_csum(csum, iter->prot_buf, offset, in t10_pi_verify() 98 if (pi->guard_tag != csum) { in t10_pi_verify() 102 be16_to_cpu(pi->guard_tag), be16_to_cpu(csum)); in t10_pi_verify() 258 __be64 csum; in ext_pi_crc64_verify() local 277 csum = ext_pi_crc64(0, iter->data_buf, iter->interval); in ext_pi_crc64_verify() 279 csum = ext_pi_crc64(be64_to_cpu(csum), iter->prot_buf, in ext_pi_crc64_verify() [all …]
|
/linux-6.12.1/arch/csky/include/asm/ |
D | checksum.h | 9 static inline __sum16 csum_fold(__wsum csum) in csum_fold() argument 18 : "=r"(csum), "=r"(tmp) in csum_fold() 19 : "0"(csum)); in csum_fold() 21 return (__force __sum16) ~csum; in csum_fold()
|
/linux-6.12.1/tools/arch/x86/dell-uart-backlight-emulator/ |
D | dell-uart-backlight-emulator.c | 42 unsigned char buf[4], csum, response[32]; in main() local 103 csum = dell_uart_checksum(buf, len - 1); in main() 104 if (buf[len - 1] != csum) { in main() 106 buf[len - 1], csum); in main() 146 /* Respond with <total-len> <cmd> <data...> <csum> */ in main() 149 csum = dell_uart_checksum(response, len + 2); in main() 150 response[len + 2] = csum; in main()
|
/linux-6.12.1/drivers/gpu/drm/amd/amdgpu/ |
D | amdgpu_ras_eeprom.c | 356 u8 *pp, csum; in __calc_hdr_byte_sum() local 362 csum = 0; in __calc_hdr_byte_sum() 364 csum += *pp; in __calc_hdr_byte_sum() 366 return csum; in __calc_hdr_byte_sum() 372 u8 *pp, csum; in __calc_ras_info_byte_sum() local 377 csum = 0; in __calc_ras_info_byte_sum() 379 csum += *pp; in __calc_ras_info_byte_sum() 381 return csum; in __calc_ras_info_byte_sum() 391 u8 csum; in amdgpu_ras_eeprom_correct_header_tag() local 393 csum = -hdr->checksum; in amdgpu_ras_eeprom_correct_header_tag() [all …]
|