• Home
  • Raw
  • Download

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.
10 /* UDP-Lite socket options */
18 * Checksum computation is all in software, hence simpler getfrag.
24 return copy_from_iter_full(to, len, &msg->msg_iter) ? 0 : -EFAULT; in udplite_getfrag()
34 /* In UDPv4 a zero checksum means that the transmitter generated no in udplite_checksum_init()
35 * checksum. UDP-Lite (like IPv6) mandates checksums, hence packets in udplite_checksum_init()
36 * with a zero checksum field are illegal. */ in udplite_checksum_init()
37 if (uh->check == 0) { in udplite_checksum_init()
38 net_dbg_ratelimited("UDPLite: zeroed checksum field\n"); in udplite_checksum_init()
42 cscov = ntohs(uh->len); in udplite_checksum_init()
46 else if (cscov < 8 || cscov > skb->len) { in udplite_checksum_init()
51 cscov, skb->len); in udplite_checksum_init()
54 } else if (cscov < skb->len) { in udplite_checksum_init()
55 UDP_SKB_CB(skb)->partial_cov = 1; in udplite_checksum_init()
56 UDP_SKB_CB(skb)->cscov = cscov; in udplite_checksum_init()
57 if (skb->ip_summed == CHECKSUM_COMPLETE) in udplite_checksum_init()
58 skb->ip_summed = CHECKSUM_NONE; in udplite_checksum_init()
59 skb->csum_valid = 0; in udplite_checksum_init()
65 /* Slow-path computation of checksum. Socket is locked. */
68 const struct udp_sock *up = udp_sk(skb->sk); in udplite_csum_outgoing()
69 int cscov = up->len; in udplite_csum_outgoing()
72 if (up->pcflag & UDPLITE_SEND_CC) { in udplite_csum_outgoing()
74 * Sender has set `partial coverage' option on UDP-Lite socket. in udplite_csum_outgoing()
75 * The special case "up->pcslen == 0" signifies full coverage. in udplite_csum_outgoing()
77 if (up->pcslen < up->len) { in udplite_csum_outgoing()
78 if (0 < up->pcslen) in udplite_csum_outgoing()
79 cscov = up->pcslen; in udplite_csum_outgoing()
80 udp_hdr(skb)->len = htons(up->pcslen); in udplite_csum_outgoing()
83 * NOTE: Causes for the error case `up->pcslen > up->len': in udplite_csum_outgoing()
94 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */ in udplite_csum_outgoing()
96 skb_queue_walk(&sk->sk_write_queue, skb) { in udplite_csum_outgoing()
98 const int len = skb->len - off; in udplite_csum_outgoing()
102 if ((cscov -= len) <= 0) in udplite_csum_outgoing()
108 /* Fast-path computation of checksum. Socket may not be locked. */
111 const struct udp_sock *up = udp_sk(skb->sk); in udplite_csum()
113 int len = skb->len - off; in udplite_csum()
115 if ((up->pcflag & UDPLITE_SEND_CC) && up->pcslen < len) { in udplite_csum()
116 if (0 < up->pcslen) in udplite_csum()
117 len = up->pcslen; in udplite_csum()
118 udp_hdr(skb)->len = htons(up->pcslen); in udplite_csum()
120 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */ in udplite_csum()