Lines Matching +full:no +full:- +full:hw +full:- +full:checksum
1 // SPDX-License-Identifier: GPL-2.0
5 #include <asm/checksum.h>
18 sum += (__force u32)saddr->s6_addr32[0]; in csum_ipv6_magic()
19 carry = (sum < (__force u32)saddr->s6_addr32[0]); in csum_ipv6_magic()
22 sum += (__force u32)saddr->s6_addr32[1]; in csum_ipv6_magic()
23 carry = (sum < (__force u32)saddr->s6_addr32[1]); in csum_ipv6_magic()
26 sum += (__force u32)saddr->s6_addr32[2]; in csum_ipv6_magic()
27 carry = (sum < (__force u32)saddr->s6_addr32[2]); in csum_ipv6_magic()
30 sum += (__force u32)saddr->s6_addr32[3]; in csum_ipv6_magic()
31 carry = (sum < (__force u32)saddr->s6_addr32[3]); in csum_ipv6_magic()
34 sum += (__force u32)daddr->s6_addr32[0]; in csum_ipv6_magic()
35 carry = (sum < (__force u32)daddr->s6_addr32[0]); in csum_ipv6_magic()
38 sum += (__force u32)daddr->s6_addr32[1]; in csum_ipv6_magic()
39 carry = (sum < (__force u32)daddr->s6_addr32[1]); in csum_ipv6_magic()
42 sum += (__force u32)daddr->s6_addr32[2]; in csum_ipv6_magic()
43 carry = (sum < (__force u32)daddr->s6_addr32[2]); in csum_ipv6_magic()
46 sum += (__force u32)daddr->s6_addr32[3]; in csum_ipv6_magic()
47 carry = (sum < (__force u32)daddr->s6_addr32[3]); in csum_ipv6_magic()
69 UDP_SKB_CB(skb)->partial_cov = 0; in udp6_csum_init()
70 UDP_SKB_CB(skb)->cscov = skb->len; in udp6_csum_init()
77 if (UDP_SKB_CB(skb)->partial_cov) { in udp6_csum_init()
78 skb->csum = ip6_compute_pseudo(skb, proto); in udp6_csum_init()
83 /* To support RFC 6936 (allow zero checksum in UDP/IPV6 for tunnels) in udp6_csum_init()
84 * we accept a checksum of zero here. When we find the socket in udp6_csum_init()
85 * for the UDP packet we'll check if that socket allows zero checksum in udp6_csum_init()
91 err = (__force int)skb_checksum_init_zero_check(skb, proto, uh->check, in udp6_csum_init()
96 if (skb->ip_summed == CHECKSUM_COMPLETE && !skb->csum_valid) { in udp6_csum_init()
98 if (skb->csum_complete_sw) in udp6_csum_init()
101 /* HW says the value is bad. Let's validate that. in udp6_csum_init()
102 * skb->csum is no longer the full packet checksum, in udp6_csum_init()
112 /* Function to set UDP checksum for an IPv6 UDP packet. This is intended
113 * for the simple case like when setting the checksum for a UDP tunnel.
122 uh->check = 0; in udp6_set_csum()
124 uh->check = ~udp_v6_check(len, saddr, daddr, 0); in udp6_set_csum()
125 else if (skb->ip_summed == CHECKSUM_PARTIAL) { in udp6_set_csum()
126 uh->check = 0; in udp6_set_csum()
127 uh->check = udp_v6_check(len, saddr, daddr, lco_csum(skb)); in udp6_set_csum()
128 if (uh->check == 0) in udp6_set_csum()
129 uh->check = CSUM_MANGLED_0; in udp6_set_csum()
131 skb->ip_summed = CHECKSUM_PARTIAL; in udp6_set_csum()
132 skb->csum_start = skb_transport_header(skb) - skb->head; in udp6_set_csum()
133 skb->csum_offset = offsetof(struct udphdr, check); in udp6_set_csum()
134 uh->check = ~udp_v6_check(len, saddr, daddr, 0); in udp6_set_csum()