Lines Matching +full:xo +full:- +full:1
1 // SPDX-License-Identifier: GPL-2.0-only
37 if (likely(ipv6_hdr->nexthdr == NEXTHDR_ESP)) in esp6_nexthdr_esp_offset()
42 if (exthdr->nexthdr == NEXTHDR_ESP) in esp6_nexthdr_esp_offset()
55 struct xfrm_offload *xo; in esp6_gro_receive() local
67 xo = xfrm_offload(skb); in esp6_gro_receive()
68 if (!xo || !(xo->flags & CRYPTO_DONE)) { in esp6_gro_receive()
74 if (sp->len == XFRM_MAX_DEPTH) in esp6_gro_receive()
77 x = xfrm_state_lookup(dev_net(skb->dev), skb->mark, in esp6_gro_receive()
78 (xfrm_address_t *)&ipv6_hdr(skb)->daddr, in esp6_gro_receive()
83 skb->mark = xfrm_smark_get(skb->mark, x); in esp6_gro_receive()
85 sp->xvec[sp->len++] = x; in esp6_gro_receive()
86 sp->olen++; in esp6_gro_receive()
88 xo = xfrm_offload(skb); in esp6_gro_receive()
89 if (!xo) in esp6_gro_receive()
93 xo->flags |= XFRM_GRO; in esp6_gro_receive()
99 IP6CB(skb)->nhoff = nhoff; in esp6_gro_receive()
100 XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6 = NULL; in esp6_gro_receive()
101 XFRM_SPI_SKB_CB(skb)->family = AF_INET6; in esp6_gro_receive()
102 XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct ipv6hdr, daddr); in esp6_gro_receive()
103 XFRM_SPI_SKB_CB(skb)->seq = seq; in esp6_gro_receive()
107 xfrm_input(skb, IPPROTO_ESP, spi, -2); in esp6_gro_receive()
109 return ERR_PTR(-EINPROGRESS); in esp6_gro_receive()
114 NAPI_GRO_CB(skb)->same_flow = 0; in esp6_gro_receive()
115 NAPI_GRO_CB(skb)->flush = 1; in esp6_gro_receive()
124 struct xfrm_offload *xo = xfrm_offload(skb); in esp6_gso_encap() local
125 u8 proto = iph->nexthdr; in esp6_gso_encap()
127 skb_push(skb, -skb_network_offset(skb)); in esp6_gso_encap()
129 if (x->outer_mode.encap == XFRM_MODE_TRANSPORT) { in esp6_gso_encap()
138 esph->spi = x->id.spi; in esp6_gso_encap()
139 esph->seq_no = htonl(XFRM_SKB_CB(skb)->seq.output.low); in esp6_gso_encap()
141 xo->proto = proto; in esp6_gso_encap()
148 __be16 type = x->inner_mode.family == AF_INET ? htons(ETH_P_IP) in xfrm6_tunnel_gso_segment()
159 struct sk_buff *segs = ERR_PTR(-EINVAL); in xfrm6_transport_gso_segment()
160 struct xfrm_offload *xo = xfrm_offload(skb); in xfrm6_transport_gso_segment() local
162 skb->transport_header += x->props.header_len; in xfrm6_transport_gso_segment()
163 ops = rcu_dereference(inet6_offloads[xo->proto]); in xfrm6_transport_gso_segment()
164 if (likely(ops && ops->callbacks.gso_segment)) in xfrm6_transport_gso_segment()
165 segs = ops->callbacks.gso_segment(skb, features); in xfrm6_transport_gso_segment()
174 struct xfrm_offload *xo = xfrm_offload(skb); in xfrm6_beet_gso_segment() local
175 struct sk_buff *segs = ERR_PTR(-EINVAL); in xfrm6_beet_gso_segment()
177 u8 proto = xo->proto; in xfrm6_beet_gso_segment()
179 skb->transport_header += x->props.header_len; in xfrm6_beet_gso_segment()
181 if (x->sel.family != AF_INET6) { in xfrm6_beet_gso_segment()
182 skb->transport_header -= in xfrm6_beet_gso_segment()
183 (sizeof(struct ipv6hdr) - sizeof(struct iphdr)); in xfrm6_beet_gso_segment()
187 (struct ip_beet_phdr *)skb->data; in xfrm6_beet_gso_segment()
189 skb->transport_header += ph->hdrlen * 8; in xfrm6_beet_gso_segment()
190 proto = ph->nexthdr; in xfrm6_beet_gso_segment()
192 skb->transport_header -= IPV4_BEET_PHMAXLEN; in xfrm6_beet_gso_segment()
196 skb_shinfo(skb)->gso_type |= SKB_GSO_TCPV6; in xfrm6_beet_gso_segment()
200 skb->transport_header += in xfrm6_beet_gso_segment()
205 skb_shinfo(skb)->gso_type |= SKB_GSO_IPXIP6; in xfrm6_beet_gso_segment()
209 if (likely(ops && ops->callbacks.gso_segment)) in xfrm6_beet_gso_segment()
210 segs = ops->callbacks.gso_segment(skb, features); in xfrm6_beet_gso_segment()
219 switch (x->outer_mode.encap) { in xfrm6_outer_mode_gso_segment()
228 return ERR_PTR(-EOPNOTSUPP); in xfrm6_outer_mode_gso_segment()
238 struct xfrm_offload *xo = xfrm_offload(skb); in esp6_gso_segment() local
241 if (!xo) in esp6_gso_segment()
242 return ERR_PTR(-EINVAL); in esp6_gso_segment()
244 if (!(skb_shinfo(skb)->gso_type & SKB_GSO_ESP)) in esp6_gso_segment()
245 return ERR_PTR(-EINVAL); in esp6_gso_segment()
248 x = sp->xvec[sp->len - 1]; in esp6_gso_segment()
249 aead = x->data; in esp6_gso_segment()
252 if (esph->spi != x->id.spi) in esp6_gso_segment()
253 return ERR_PTR(-EINVAL); in esp6_gso_segment()
256 return ERR_PTR(-EINVAL); in esp6_gso_segment()
260 skb->encap_hdr_csum = 1; in esp6_gso_segment()
262 if (!(features & NETIF_F_HW_ESP) || x->xso.dev != skb->dev) in esp6_gso_segment()
269 xo->flags |= XFRM_GSO_SEGMENT; in esp6_gso_segment()
276 struct crypto_aead *aead = x->data; in esp6_input_tail()
277 struct xfrm_offload *xo = xfrm_offload(skb); in esp6_input_tail() local
280 return -EINVAL; in esp6_input_tail()
282 if (!(xo->flags & CRYPTO_DONE)) in esp6_input_tail()
283 skb->ip_summed = CHECKSUM_NONE; in esp6_input_tail()
294 struct xfrm_offload *xo; in esp6_xmit() local
302 xo = xfrm_offload(skb); in esp6_xmit()
304 if (!xo) in esp6_xmit()
305 return -EINVAL; in esp6_xmit()
307 if (!(features & NETIF_F_HW_ESP) || x->xso.dev != skb->dev) { in esp6_xmit()
308 xo->flags |= CRYPTO_FALLBACK; in esp6_xmit()
312 esp.proto = xo->proto; in esp6_xmit()
316 aead = x->data; in esp6_xmit()
323 esp.clen = ALIGN(skb->len + 2 + esp.tfclen, blksize); in esp6_xmit()
324 esp.plen = esp.clen - skb->len - esp.tfclen; in esp6_xmit()
333 seq = xo->seq.low; in esp6_xmit()
336 esp.esph->spi = x->id.spi; in esp6_xmit()
338 skb_push(skb, -skb_network_offset(skb)); in esp6_xmit()
340 if (xo->flags & XFRM_GSO_SEGMENT) { in esp6_xmit()
341 esp.esph->seq_no = htonl(seq); in esp6_xmit()
344 xo->seq.low++; in esp6_xmit()
346 xo->seq.low += skb_shinfo(skb)->gso_segs; in esp6_xmit()
349 if (xo->seq.low < seq) in esp6_xmit()
350 xo->seq.hi++; in esp6_xmit()
352 esp.seqno = cpu_to_be64(xo->seq.low + ((u64)xo->seq.hi << 32)); in esp6_xmit()
354 len = skb->len - sizeof(struct ipv6hdr); in esp6_xmit()
358 ipv6_hdr(skb)->payload_len = htons(len); in esp6_xmit()
362 return -ENOMEM; in esp6_xmit()
364 xo = xfrm_offload(skb); in esp6_xmit()
365 if (!xo) in esp6_xmit()
366 return -EINVAL; in esp6_xmit()
368 xo->flags |= XFRM_XMIT; in esp6_xmit()
378 if (skb_needs_linearize(skb, skb->dev->features) && in esp6_xmit()
380 return -ENOMEM; in esp6_xmit()
403 return -EAGAIN; in esp6_offload_init()