Home
last modified time | relevance | path

Searched full:csum (Results 1 – 25 of 607) sorted by relevance

12345678910>>...25

/openbmc/linux/tools/testing/selftests/tc-testing/tc-tests/actions/
H A Dcsum.json4 "name": "Add csum iph action",
7 "csum"
11 "$TC actions flush action csum",
17 "cmdUnderTest": "$TC actions add action csum iph index 800",
19 "verifyCmd": "$TC actions get action csum index 800",
20 "matchPattern": "action order [0-9]*: csum \\(iph\\) action pass.*index 800 ref",
23 "$TC actions flush action csum"
28 "name": "Add csum ip4h action",
31 "csum"
35 "$TC actions flush action csum",
[all …]
/openbmc/linux/arch/s390/include/asm/
H A Dchecksum.h50 u32 csum = (__force u32) sum; in csum_fold() local
52 csum += (csum >> 16) | (csum << 16); in csum_fold()
53 csum >>= 16; in csum_fold()
54 return (__force __sum16) ~csum; in csum_fold()
63 __u64 csum = 0; in ip_fast_csum() local
66 csum += *ptr++; in ip_fast_csum()
67 csum += *ptr++; in ip_fast_csum()
68 csum += *ptr++; in ip_fast_csum()
69 csum += *ptr++; in ip_fast_csum()
72 csum += *ptr++; in ip_fast_csum()
[all …]
/openbmc/linux/include/net/
H A Dchecksum.h59 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 …]
H A Dudp.h38 * @partial_cov: if set indicates partial csum coverage
132 __wsum csum = csum_partial(skb_transport_header(skb), in udp_csum_outgoing() local
135 csum = csum_add(csum, skb->csum); in udp_csum_outgoing()
137 return csum; in udp_csum_outgoing()
142 __wsum csum = csum_partial(skb_transport_header(skb), in udp_csum() local
143 sizeof(struct udphdr), skb->csum); in udp_csum()
146 csum = csum_add(csum, skb->csum); in udp_csum()
148 return csum; in udp_csum()
163 skb->csum = csum_partial(skb->data, sizeof(struct udphdr), in udp_csum_pull_header()
164 skb->csum); in udp_csum_pull_header()
[all …]
H A Dgso.h20 __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()
/openbmc/linux/net/netfilter/
H A Dutils.c14 __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 …]
/openbmc/linux/samples/bpf/
H A Dxdp_adjust_tail_kern.c58 static __always_inline __u16 csum_fold_helper(__u32 csum) in csum_fold_helper() argument
60 csum = (csum & 0xffff) + (csum >> 16); in csum_fold_helper()
61 return ~((csum & 0xffff) + (csum >> 16)); in csum_fold_helper()
65 __u32 *csum) in ipv4_csum() argument
67 *csum = bpf_csum_diff(0, 0, data_start, data_size, *csum); in ipv4_csum()
68 *csum = csum_fold_helper(*csum); in ipv4_csum()
86 __u32 csum = 0; in send_icmp4_too_big() local
101 ipv4_csum(icmp_hdr, ICMP_TOOBIG_PAYLOAD_SIZE, &csum); in send_icmp4_too_big()
102 icmp_hdr->checksum = csum; in send_icmp4_too_big()
113 csum = 0; in send_icmp4_too_big()
[all …]
/openbmc/linux/arch/mips/include/asm/
H A Dchecksum.h77 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 …]
/openbmc/linux/fs/ext4/
H A Dbitmap.c45 __u32 csum; in ext4_inode_bitmap_csum_set() local
51 csum = ext4_chksum(sbi, sbi->s_csum_seed, (__u8 *)bh->b_data, sz); in ext4_inode_bitmap_csum_set()
52 gdp->bg_inode_bitmap_csum_lo = cpu_to_le16(csum & 0xFFFF); in ext4_inode_bitmap_csum_set()
54 gdp->bg_inode_bitmap_csum_hi = cpu_to_le16(csum >> 16); in ext4_inode_bitmap_csum_set()
85 __u32 csum; in ext4_block_bitmap_csum_set() local
91 csum = ext4_chksum(sbi, sbi->s_csum_seed, (__u8 *)bh->b_data, sz); in ext4_block_bitmap_csum_set()
92 gdp->bg_block_bitmap_csum_lo = cpu_to_le16(csum & 0xFFFF); in ext4_block_bitmap_csum_set()
94 gdp->bg_block_bitmap_csum_hi = cpu_to_le16(csum >> 16); in ext4_block_bitmap_csum_set()
/openbmc/linux/arch/powerpc/lib/
H A Dchecksum_wrappers.c17 __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()
/openbmc/qemu/net/
H A Dchecksum.c64 uint16_t csum; in net_checksum_calculate() local
113 csum = net_raw_checksum((uint8_t *)ip, IP_HDR_GET_LEN(ip)); in net_checksum_calculate()
114 stw_be_p(&ip->ip_sum, csum); in net_checksum_calculate()
143 /* Set csum to 0 */ in net_checksum_calculate()
146 csum = net_checksum_tcpudp(ip_len, ip->ip_p, in net_checksum_calculate()
150 /* Store computed csum */ in net_checksum_calculate()
151 stw_be_p(&tcp->th_sum, csum); in net_checksum_calculate()
167 /* Set csum to 0 */ in net_checksum_calculate()
170 csum = net_checksum_tcpudp(ip_len, ip->ip_p, in net_checksum_calculate()
174 /* Store computed csum */ in net_checksum_calculate()
[all …]
/openbmc/linux/fs/btrfs/
H A Dfile-item.c278 * Return 0 for the range [disk_bytenr, disk_bytenr + sectorsize) has no csum
299 /* Check if the current csum item covers disk_bytenr */ in search_csum_tree()
340 * Lookup the checksum for the read bio in csum tree.
366 * - All our csums should only be in csum tree in btrfs_lookup_bio_sums()
380 bbio->csum = kmalloc_array(nblocks, csum_size, GFP_NOFS); in btrfs_lookup_bio_sums()
381 if (!bbio->csum) { in btrfs_lookup_bio_sums()
386 bbio->csum = bbio->csum_inline; in btrfs_lookup_bio_sums()
391 * kick the readahead for csum tree. in btrfs_lookup_bio_sums()
400 * between reading the free space cache and updating the csum tree. in btrfs_lookup_bio_sums()
410 u8 *csum_dst = bbio->csum + in btrfs_lookup_bio_sums()
[all …]
/openbmc/linux/arch/s390/kernel/
H A Dos_info.c42 os_info.csum = os_info_csum(&os_info); in os_info_crashkernel_add()
52 os_info.entry[nr].csum = (__force u32)csum_partial(ptr, size, 0); in os_info_entry_add()
53 os_info.csum = os_info_csum(&os_info); in os_info_entry_add()
66 os_info.csum = os_info_csum(&os_info); in os_info_init()
83 u32 csum; in os_info_old_alloc() local
101 csum = (__force u32)csum_partial(buf_align, size, 0); in os_info_old_alloc()
102 if (csum != os_info_old->entry[nr].csum) { in os_info_old_alloc()
141 if (os_info_old->csum != os_info_csum(os_info_old)) in os_info_old_init()
/openbmc/qemu/hw/net/
H A Dnet_tx_pkt.c93 uint16_t csum; in net_tx_pkt_update_ip_hdr_checksum() local
100 csum = net_raw_checksum(pkt->l3_hdr.octets, in net_tx_pkt_update_ip_hdr_checksum()
102 pkt->l3_hdr.ip.ip_sum = cpu_to_be16(csum); in net_tx_pkt_update_ip_hdr_checksum()
107 uint16_t csum; in net_tx_pkt_update_ip_checksums() local
125 csum = cpu_to_be16(~net_checksum_finish(cntr)); in net_tx_pkt_update_ip_checksums()
130 csum = cpu_to_be16(~net_checksum_finish(cntr)); in net_tx_pkt_update_ip_checksums()
136 pkt->virt_hdr.csum_offset, &csum, sizeof(csum)); in net_tx_pkt_update_ip_checksums()
141 uint32_t csum = 0; in net_tx_pkt_update_sctp_checksum() local
144 if (iov_size(pl_start_frag, pkt->payload_frags) < 8 + sizeof(csum)) { in net_tx_pkt_update_sctp_checksum()
148 if (iov_from_buf(pl_start_frag, pkt->payload_frags, 8, &csum, sizeof(csum)) < sizeof(csum)) { in net_tx_pkt_update_sctp_checksum()
[all …]
H A Dnet_rx_pkt.c463 uint16_t csum; in net_rx_pkt_validate_l3_csum() local
479 csum = net_checksum_finish(cntr); in net_rx_pkt_validate_l3_csum()
481 *csum_valid = (csum == 0); in net_rx_pkt_validate_l3_csum()
484 cntr, csum, *csum_valid); in net_rx_pkt_validate_l3_csum()
493 uint16_t csum; in _net_rx_pkt_calc_l4_csum() local
534 csum = net_checksum_finish_nozero(cntr); in _net_rx_pkt_calc_l4_csum()
536 trace_net_rx_pkt_l4_csum_calc_csum(pkt->l4hdr_off, csl, cntr, csum); in _net_rx_pkt_calc_l4_csum()
538 return csum; in _net_rx_pkt_calc_l4_csum()
579 uint32_t csum; in net_rx_pkt_validate_l4_csum() local
596 csum = _net_rx_pkt_calc_l4_csum(pkt); in net_rx_pkt_validate_l4_csum()
[all …]
/openbmc/linux/net/sched/
H A Dact_csum.c157 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 …]
/openbmc/linux/block/partitions/
H A Dsgi.c32 __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()
H A Dsun.c24 __be16 csum; in sun_partition() local
64 __be16 csum; /* Label xor'd checksum */ in sun_partition() member
84 for (csum = 0; ush >= ((__be16 *) label);) in sun_partition()
85 csum ^= *ush--; in sun_partition()
86 if (csum) { in sun_partition()
87 printk("Dev %s Sun disklabel: Csum bad, label corrupted\n", in sun_partition()
/openbmc/linux/drivers/infiniband/hw/qib/
H A Dqib_eeprom.c117 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()
/openbmc/u-boot/board/Synology/ds414/
H A Dcmd_syno.c60 unsigned char csum = 0; in do_syno_populate() local
64 csum += bufp[i]; in do_syno_populate()
69 if (csum != bufp[i]) { /* seventh byte is checksum value */ in do_syno_populate()
86 int csum = 0; in do_syno_populate() local
91 csum += bufp[n]; in do_syno_populate()
106 if (strict_strtoul(csump, 10, &c) || c != csum) { in do_syno_populate()
114 unsigned char csum = 0; in do_syno_populate() local
117 csum += bufp[n]; in do_syno_populate()
119 if (csum != bufp[n]) { in do_syno_populate()
/openbmc/linux/net/netfilter/ipvs/
H A Dip_vs_proto_udp.c166 /* 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 …]
/openbmc/linux/arch/csky/include/asm/
H A Dchecksum.h9 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()
/openbmc/linux/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/
H A Dcsum.c20 "TC csum action is only offloaded with pedit"); in csum_offload_supported()
22 "TC csum action is only offloaded with pedit\n"); in csum_offload_supported()
28 "can't offload TC csum action for some header/s"); in csum_offload_supported()
30 "can't offload TC csum action for some header/s - flags %#x\n", in csum_offload_supported()
/openbmc/linux/drivers/gpu/drm/amd/amdgpu/
H A Damdgpu_ras_eeprom.c354 u8 *pp, csum; in __calc_hdr_byte_sum() local
360 csum = 0; in __calc_hdr_byte_sum()
362 csum += *pp; in __calc_hdr_byte_sum()
364 return csum; in __calc_hdr_byte_sum()
370 u8 *pp, csum; in __calc_ras_info_byte_sum() local
375 csum = 0; in __calc_ras_info_byte_sum()
377 csum += *pp; in __calc_ras_info_byte_sum()
379 return csum; in __calc_ras_info_byte_sum()
389 u8 csum; in amdgpu_ras_eeprom_correct_header_tag() local
391 csum = -hdr->checksum; in amdgpu_ras_eeprom_correct_header_tag()
[all …]
H A Damdgpu_fru_eeprom.c105 u8 csum; in amdgpu_fru_get_product_info() local
129 for (csum = 0; len > 0; len--) in amdgpu_fru_get_product_info()
130 csum += buf[len - 1]; in amdgpu_fru_get_product_info()
131 if (csum) { in amdgpu_fru_get_product_info()
132 DRM_ERROR("Bad IPMI Common Header checksum: 0x%02x", csum); in amdgpu_fru_get_product_info()
169 for (csum = 0; size > 0; size--) in amdgpu_fru_get_product_info()
170 csum += pia[size - 1]; in amdgpu_fru_get_product_info()
171 if (csum) { in amdgpu_fru_get_product_info()
172 DRM_ERROR("Bad Product Info Area checksum: 0x%02x", csum); in amdgpu_fru_get_product_info()

12345678910>>...25