Lines Matching +full:no +full:- +full:hw +full:- +full:checksum

1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Definitions for the UDP-Lite (RFC 3828) code.
11 /* UDP-Lite socket options */
19 * Checksum computation is all in software, hence simpler getfrag.
25 return copy_from_iter_full(to, len, &msg->msg_iter) ? 0 : -EFAULT; in udplite_getfrag()
35 /* In UDPv4 a zero checksum means that the transmitter generated no in udplite_checksum_init()
36 * checksum. UDP-Lite (like IPv6) mandates checksums, hence packets in udplite_checksum_init()
37 * with a zero checksum field are illegal. */ in udplite_checksum_init()
38 if (uh->check == 0) { in udplite_checksum_init()
39 net_dbg_ratelimited("UDPLite: zeroed checksum field\n"); in udplite_checksum_init()
43 cscov = ntohs(uh->len); in udplite_checksum_init()
47 else if (cscov < 8 || cscov > skb->len) { in udplite_checksum_init()
52 cscov, skb->len); in udplite_checksum_init()
55 } else if (cscov < skb->len) { in udplite_checksum_init()
56 UDP_SKB_CB(skb)->partial_cov = 1; in udplite_checksum_init()
57 UDP_SKB_CB(skb)->cscov = cscov; in udplite_checksum_init()
58 if (skb->ip_summed == CHECKSUM_COMPLETE) in udplite_checksum_init()
59 skb->ip_summed = CHECKSUM_NONE; in udplite_checksum_init()
60 skb->csum_valid = 0; in udplite_checksum_init()
66 /* Fast-path computation of checksum. Socket may not be locked. */
70 const struct sock *sk = skb->sk; in udplite_csum()
71 int len = skb->len - off; in udplite_csum()
74 u16 pcslen = READ_ONCE(udp_sk(sk)->pcslen); in udplite_csum()
79 udp_hdr(skb)->len = htons(pcslen); in udplite_csum()
82 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */ in udplite_csum()