Lines Matching full:skb
54 struct sk_buff *skb) in esp6_gro_receive() argument
56 int offset = skb_gro_offset(skb); in esp6_gro_receive()
64 if (NAPI_GRO_CB(skb)->proto == IPPROTO_UDP) in esp6_gro_receive()
67 if (!pskb_pull(skb, offset)) in esp6_gro_receive()
70 if (xfrm_parse_spi(skb, IPPROTO_ESP, &spi, &seq) != 0) in esp6_gro_receive()
73 xo = xfrm_offload(skb); in esp6_gro_receive()
75 struct sec_path *sp = secpath_set(skb); in esp6_gro_receive()
83 x = xfrm_input_state_lookup(dev_net(skb->dev), skb->mark, in esp6_gro_receive()
84 (xfrm_address_t *)&ipv6_hdr(skb)->daddr, in esp6_gro_receive()
96 skb->mark = xfrm_smark_get(skb->mark, x); in esp6_gro_receive()
101 xo = xfrm_offload(skb); in esp6_gro_receive()
108 nhoff = esp6_nexthdr_esp_offset(ipv6_hdr(skb), offset); in esp6_gro_receive()
112 IP6CB(skb)->nhoff = nhoff; in esp6_gro_receive()
113 XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6 = NULL; in esp6_gro_receive()
114 XFRM_SPI_SKB_CB(skb)->family = AF_INET6; in esp6_gro_receive()
115 XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct ipv6hdr, daddr); in esp6_gro_receive()
116 XFRM_SPI_SKB_CB(skb)->seq = seq; in esp6_gro_receive()
120 xfrm_input(skb, IPPROTO_ESP, spi, encap_type); in esp6_gro_receive()
124 secpath_reset(skb); in esp6_gro_receive()
126 skb_push(skb, offset); in esp6_gro_receive()
127 NAPI_GRO_CB(skb)->same_flow = 0; in esp6_gro_receive()
128 NAPI_GRO_CB(skb)->flush = 1; in esp6_gro_receive()
133 static void esp6_gso_encap(struct xfrm_state *x, struct sk_buff *skb) in esp6_gso_encap() argument
136 struct ipv6hdr *iph = ipv6_hdr(skb); in esp6_gso_encap()
137 struct xfrm_offload *xo = xfrm_offload(skb); in esp6_gso_encap()
140 skb_push(skb, -skb_network_offset(skb)); in esp6_gso_encap()
145 ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &proto, &frag); in esp6_gso_encap()
148 esph = ip_esp_hdr(skb); in esp6_gso_encap()
149 *skb_mac_header(skb) = IPPROTO_ESP; in esp6_gso_encap()
152 esph->seq_no = htonl(XFRM_SKB_CB(skb)->seq.output.low); in esp6_gso_encap()
158 struct sk_buff *skb, in xfrm6_tunnel_gso_segment() argument
162 XFRM_MODE_SKB_CB(skb)->protocol); in xfrm6_tunnel_gso_segment()
166 return skb_eth_gso_segment(skb, features, type); in xfrm6_tunnel_gso_segment()
170 struct sk_buff *skb, in xfrm6_transport_gso_segment() argument
175 struct xfrm_offload *xo = xfrm_offload(skb); in xfrm6_transport_gso_segment()
177 skb->transport_header += x->props.header_len; in xfrm6_transport_gso_segment()
180 segs = ops->callbacks.gso_segment(skb, features); in xfrm6_transport_gso_segment()
186 struct sk_buff *skb, in xfrm6_beet_gso_segment() argument
189 struct xfrm_offload *xo = xfrm_offload(skb); in xfrm6_beet_gso_segment()
194 skb->transport_header += x->props.header_len; in xfrm6_beet_gso_segment()
197 skb->transport_header -= in xfrm6_beet_gso_segment()
202 (struct ip_beet_phdr *)skb->data; in xfrm6_beet_gso_segment()
204 skb->transport_header += ph->hdrlen * 8; in xfrm6_beet_gso_segment()
207 skb->transport_header -= IPV4_BEET_PHMAXLEN; in xfrm6_beet_gso_segment()
211 skb_shinfo(skb)->gso_type |= SKB_GSO_TCPV6; in xfrm6_beet_gso_segment()
215 skb->transport_header += in xfrm6_beet_gso_segment()
216 ipv6_skip_exthdr(skb, 0, &proto, &frag); in xfrm6_beet_gso_segment()
220 skb_shinfo(skb)->gso_type |= SKB_GSO_IPXIP6; in xfrm6_beet_gso_segment()
222 __skb_pull(skb, skb_transport_offset(skb)); in xfrm6_beet_gso_segment()
225 segs = ops->callbacks.gso_segment(skb, features); in xfrm6_beet_gso_segment()
231 struct sk_buff *skb, in xfrm6_outer_mode_gso_segment() argument
236 return xfrm6_tunnel_gso_segment(x, skb, features); in xfrm6_outer_mode_gso_segment()
238 return xfrm6_transport_gso_segment(x, skb, features); in xfrm6_outer_mode_gso_segment()
240 return xfrm6_beet_gso_segment(x, skb, features); in xfrm6_outer_mode_gso_segment()
246 static struct sk_buff *esp6_gso_segment(struct sk_buff *skb, in esp6_gso_segment() argument
253 struct xfrm_offload *xo = xfrm_offload(skb); in esp6_gso_segment()
259 if (!(skb_shinfo(skb)->gso_type & SKB_GSO_ESP)) in esp6_gso_segment()
262 sp = skb_sec_path(skb); in esp6_gso_segment()
265 esph = ip_esp_hdr(skb); in esp6_gso_segment()
270 if (!pskb_may_pull(skb, sizeof(*esph) + crypto_aead_ivsize(aead))) in esp6_gso_segment()
273 __skb_pull(skb, sizeof(*esph) + crypto_aead_ivsize(aead)); in esp6_gso_segment()
275 skb->encap_hdr_csum = 1; in esp6_gso_segment()
277 if (!(features & NETIF_F_HW_ESP) || x->xso.dev != skb->dev) in esp6_gso_segment()
286 return xfrm6_outer_mode_gso_segment(x, skb, esp_features); in esp6_gso_segment()
289 static int esp6_input_tail(struct xfrm_state *x, struct sk_buff *skb) in esp6_input_tail() argument
292 struct xfrm_offload *xo = xfrm_offload(skb); in esp6_input_tail()
294 if (!pskb_may_pull(skb, sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead))) in esp6_input_tail()
298 skb->ip_summed = CHECKSUM_NONE; in esp6_input_tail()
300 return esp6_input_done2(skb, 0); in esp6_input_tail()
303 static int esp6_xmit(struct xfrm_state *x, struct sk_buff *skb, netdev_features_t features) in esp6_xmit() argument
317 xo = xfrm_offload(skb); in esp6_xmit()
322 if (!(features & NETIF_F_HW_ESP) || x->xso.dev != skb->dev) { in esp6_xmit()
329 /* skb is pure payload to encrypt */ in esp6_xmit()
338 esp.clen = ALIGN(skb->len + 2 + esp.tfclen, blksize); in esp6_xmit()
339 esp.plen = esp.clen - skb->len - esp.tfclen; in esp6_xmit()
342 if (!hw_offload || !skb_is_gso(skb)) { in esp6_xmit()
343 esp.nfrags = esp6_output_head(x, skb, &esp); in esp6_xmit()
350 esp.esph = ip_esp_hdr(skb); in esp6_xmit()
353 skb_push(skb, -skb_network_offset(skb)); in esp6_xmit()
358 if (!skb_is_gso(skb)) in esp6_xmit()
361 xo->seq.low += skb_shinfo(skb)->gso_segs; in esp6_xmit()
369 len = skb->len - sizeof(struct ipv6hdr); in esp6_xmit()
373 ipv6_hdr(skb)->payload_len = htons(len); in esp6_xmit()
376 if (!skb_ext_add(skb, SKB_EXT_SEC_PATH)) in esp6_xmit()
379 xo = xfrm_offload(skb); in esp6_xmit()
387 err = esp6_output_tail(x, skb, &esp); in esp6_xmit()
391 secpath_reset(skb); in esp6_xmit()
393 if (skb_needs_linearize(skb, skb->dev->features) && in esp6_xmit()
394 __skb_linearize(skb)) in esp6_xmit()