Lines Matching +full:hw +full:- +full:gro

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * IPV6 GSO/GRO offload support
16 #include <net/gro.h>
22 struct sk_buff *segs = ERR_PTR(-EINVAL); in udp6_ufo_fragment()
33 if (skb->encapsulation && skb_shinfo(skb)->gso_type & in udp6_ufo_fragment()
40 if (!(skb_shinfo(skb)->gso_type & (SKB_GSO_UDP | SKB_GSO_UDP_L4))) in udp6_ufo_fragment()
46 if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) in udp6_ufo_fragment()
49 mss = skb_shinfo(skb)->gso_size; in udp6_ufo_fragment()
50 if (unlikely(skb->len <= mss)) in udp6_ufo_fragment()
53 /* Do software UFO. Complete and fill in the UDP checksum as HW cannot in udp6_ufo_fragment()
60 uh->check = 0; in udp6_ufo_fragment()
61 csum = skb_checksum(skb, 0, skb->len, 0); in udp6_ufo_fragment()
62 uh->check = udp_v6_check(skb->len, &ipv6h->saddr, in udp6_ufo_fragment()
63 &ipv6h->daddr, csum); in udp6_ufo_fragment()
64 if (uh->check == 0) in udp6_ufo_fragment()
65 uh->check = CSUM_MANGLED_0; in udp6_ufo_fragment()
67 skb->ip_summed = CHECKSUM_UNNECESSARY; in udp6_ufo_fragment()
73 if (!skb->encap_hdr_csum) in udp6_ufo_fragment()
78 if (skb->mac_header < (tnl_hlen + frag_hdr_sz)) { in udp6_ufo_fragment()
92 unfrag_len = (skb_network_header(skb) - skb_mac_header(skb)) + in udp6_ufo_fragment()
94 packet_start = (u8 *) skb->head + SKB_GSO_CB(skb)->mac_offset; in udp6_ufo_fragment()
95 memmove(packet_start-frag_hdr_sz, packet_start, unfrag_len); in udp6_ufo_fragment()
97 SKB_GSO_CB(skb)->mac_offset -= frag_hdr_sz; in udp6_ufo_fragment()
98 skb->mac_header -= frag_hdr_sz; in udp6_ufo_fragment()
99 skb->network_header -= frag_hdr_sz; in udp6_ufo_fragment()
102 fptr->nexthdr = nexthdr; in udp6_ufo_fragment()
103 fptr->reserved = 0; in udp6_ufo_fragment()
104 fptr->identification = ipv6_proxy_select_ident(dev_net(skb->dev), skb); in udp6_ufo_fragment()
120 struct net *net = dev_net(skb->dev); in udp6_gro_lookup_skb()
125 return __udp6_lib_lookup(net, &iph->saddr, sport, in udp6_gro_lookup_skb()
126 &iph->daddr, dport, iif, in udp6_gro_lookup_skb()
127 sdif, net->ipv4.udp_table, NULL); in udp6_gro_lookup_skb()
141 if (NAPI_GRO_CB(skb)->flush) in udp6_gro_receive()
144 if (skb_gro_checksum_validate_zero_check(skb, IPPROTO_UDP, uh->check, in udp6_gro_receive()
147 else if (uh->check) in udp6_gro_receive()
152 NAPI_GRO_CB(skb)->is_ipv6 = 1; in udp6_gro_receive()
155 sk = udp6_gro_lookup_skb(skb, uh->source, uh->dest); in udp6_gro_receive()
161 NAPI_GRO_CB(skb)->flush = 1; in udp6_gro_receive()
167 const u16 offset = NAPI_GRO_CB(skb)->network_offsets[skb->encapsulation]; in udp6_gro_complete()
168 const struct ipv6hdr *ipv6h = (struct ipv6hdr *)(skb->data + offset); in udp6_gro_complete()
169 struct udphdr *uh = (struct udphdr *)(skb->data + nhoff); in udp6_gro_complete()
172 if (NAPI_GRO_CB(skb)->is_flist && !NAPI_GRO_CB(skb)->encap_mark) { in udp6_gro_complete()
173 uh->len = htons(skb->len - nhoff); in udp6_gro_complete()
175 skb_shinfo(skb)->gso_type |= (SKB_GSO_FRAGLIST|SKB_GSO_UDP_L4); in udp6_gro_complete()
176 skb_shinfo(skb)->gso_segs = NAPI_GRO_CB(skb)->count; in udp6_gro_complete()
183 if (uh->check) in udp6_gro_complete()
184 uh->check = ~udp_v6_check(skb->len - nhoff, &ipv6h->saddr, in udp6_gro_complete()
185 &ipv6h->daddr, 0); in udp6_gro_complete()