Lines Matching +full:foo +full:- +full:over +full:- +full:udp

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
11 #include <net/udp.h>
17 /* Virtual address of skb_shinfo(skb)->frags[0].page + offset. */
33 /* This indicates where we are processing relative to skb->data. */
36 /* This is non-zero if the packet cannot be merged with the new skb. */
42 /* Used in ipv6_gro_receive() and foo-over-udp and esp-in-udp */
56 /* This is non-zero if the packet may be of the same flow. */
71 /* Used in foo-over-udp, set in udp[46]_gro_receive */
100 #define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb)
105 return ++NAPI_GRO_CB(skb)->recursion_counter == GRO_RECURSION_LIMIT; in gro_recursion_inc_test()
114 NAPI_GRO_CB(skb)->flush |= 1; in call_gro_receive()
129 NAPI_GRO_CB(skb)->flush |= 1; in call_gro_receive_sk()
138 return NAPI_GRO_CB(skb)->data_offset; in skb_gro_offset()
143 return skb->len - NAPI_GRO_CB(skb)->data_offset; in skb_gro_len()
148 NAPI_GRO_CB(skb)->data_offset += len; in skb_gro_pull()
154 return NAPI_GRO_CB(skb)->frag0 + offset; in skb_gro_header_fast()
160 return likely(hlen <= NAPI_GRO_CB(skb)->frag0_len); in skb_gro_may_pull()
169 return skb->data + offset; in skb_gro_header_slow()
185 return NAPI_GRO_CB(skb)->network_offsets[NAPI_GRO_CB(skb)->encap_mark]; in skb_gro_receive_network_offset()
193 return skb->data + skb_gro_receive_network_offset(skb); in skb_gro_network_header()
201 return csum_tcpudp_nofold(iph->saddr, iph->daddr, in inet_gro_compute_pseudo()
208 if (NAPI_GRO_CB(skb)->csum_valid) in skb_gro_postpull_rcsum()
209 NAPI_GRO_CB(skb)->csum = wsum_negate(csum_partial(start, len, in skb_gro_postpull_rcsum()
210 wsum_negate(NAPI_GRO_CB(skb)->csum))); in skb_gro_postpull_rcsum()
222 return (NAPI_GRO_CB(skb)->gro_remcsum_start == skb_gro_offset(skb)); in skb_at_gro_remcsum_start()
229 return ((skb->ip_summed != CHECKSUM_PARTIAL || in __skb_gro_checksum_validate_needed()
233 NAPI_GRO_CB(skb)->csum_cnt == 0 && in __skb_gro_checksum_validate_needed()
240 if (NAPI_GRO_CB(skb)->csum_valid && in __skb_gro_checksum_validate_complete()
241 !csum_fold(csum_add(psum, NAPI_GRO_CB(skb)->csum))) in __skb_gro_checksum_validate_complete()
244 NAPI_GRO_CB(skb)->csum = psum; in __skb_gro_checksum_validate_complete()
251 if (NAPI_GRO_CB(skb)->csum_cnt > 0) { in skb_gro_incr_csum_unnecessary()
253 NAPI_GRO_CB(skb)->csum_cnt--; in skb_gro_incr_csum_unnecessary()
287 return (NAPI_GRO_CB(skb)->csum_cnt == 0 && in __skb_gro_checksum_convert_check()
288 !NAPI_GRO_CB(skb)->csum_valid); in __skb_gro_checksum_convert_check()
294 NAPI_GRO_CB(skb)->csum = ~pseudo; in __skb_gro_checksum_convert()
295 NAPI_GRO_CB(skb)->csum_valid = 1; in __skb_gro_checksum_convert()
312 grc->offset = 0; in skb_gro_remcsum_init()
313 grc->delta = 0; in skb_gro_remcsum_init()
325 BUG_ON(!NAPI_GRO_CB(skb)->csum_valid); in skb_gro_remcsum_process()
328 NAPI_GRO_CB(skb)->gro_remcsum_start = off + hdrlen + start; in skb_gro_remcsum_process()
336 delta = remcsum_adjust(ptr + hdrlen, NAPI_GRO_CB(skb)->csum, in skb_gro_remcsum_process()
339 /* Adjust skb->csum since we changed the packet */ in skb_gro_remcsum_process()
340 NAPI_GRO_CB(skb)->csum = csum_add(NAPI_GRO_CB(skb)->csum, delta); in skb_gro_remcsum_process()
342 grc->offset = off + hdrlen + offset; in skb_gro_remcsum_process()
343 grc->delta = delta; in skb_gro_remcsum_process()
352 size_t plen = grc->offset + sizeof(u16); in skb_gro_remcsum_cleanup()
354 if (!grc->delta) in skb_gro_remcsum_cleanup()
357 ptr = skb_gro_header(skb, plen, grc->offset); in skb_gro_remcsum_cleanup()
361 remcsum_unadjust((__sum16 *)ptr, grc->delta); in skb_gro_remcsum_cleanup()
367 if (PTR_ERR(pp) != -EINPROGRESS) in skb_gro_flush_final()
368 NAPI_GRO_CB(skb)->flush |= flush; in skb_gro_flush_final()
375 if (PTR_ERR(pp) != -EINPROGRESS) { in skb_gro_flush_final_remcsum()
376 NAPI_GRO_CB(skb)->flush |= flush; in skb_gro_flush_final_remcsum()
378 skb->remcsum_offload = 0; in skb_gro_flush_final_remcsum()
384 NAPI_GRO_CB(skb)->flush |= flush; in skb_gro_flush_final()
391 NAPI_GRO_CB(skb)->flush |= flush; in skb_gro_flush_final_remcsum()
393 skb->remcsum_offload = 0; in skb_gro_flush_final_remcsum()
415 NAPI_GRO_CB(skb)->flush |= 1, NULL : \
440 return ~csum_unfold(csum_ipv6_magic(&iph->saddr, &iph->daddr, in ip6_gro_compute_pseudo()
447 const u32 id = ntohl(*(__be32 *)&iph->id); in inet_gro_flush()
448 const u32 id2 = ntohl(*(__be32 *)&iph2->id); in inet_gro_flush()
449 const u16 ipid_offset = (id >> 16) - (id2 >> 16); in inet_gro_flush()
450 const u16 count = NAPI_GRO_CB(p)->count; in inet_gro_flush()
455 flush = (iph->ttl ^ iph2->ttl) | (iph->tos ^ iph2->tos) | (df ^ (id2 & IP_DF)); in inet_gro_flush()
465 NAPI_GRO_CB(p)->ip_fixedid = true; in inet_gro_flush()
467 return ipid_offset ^ (count * !NAPI_GRO_CB(p)->ip_fixedid); in inet_gro_flush()
477 (__force __be32)(iph->hop_limit ^ iph2->hop_limit)); in ipv6_gro_flush()
484 const void *nh = th - diff; in __gro_receive_network_flush()
485 const void *nh2 = th2 - diff; in __gro_receive_network_flush()
487 if (((struct iphdr *)nh)->version == 6) in __gro_receive_network_flush()
496 const bool encap_mark = NAPI_GRO_CB(p)->encap_mark; in gro_receive_network_flush()
500 flush = __gro_receive_network_flush(th, th2, p, off - NAPI_GRO_CB(p)->network_offset, encap_mark); in gro_receive_network_flush()
502 …flush |= __gro_receive_network_flush(th, th2, p, off - NAPI_GRO_CB(p)->inner_network_offset, false… in gro_receive_network_flush()
513 if (!napi->rx_count) in gro_normal_list()
515 netif_receive_skb_list_internal(&napi->rx_list); in gro_normal_list()
516 INIT_LIST_HEAD(&napi->rx_list); in gro_normal_list()
517 napi->rx_count = 0; in gro_normal_list()
525 list_add_tail(&skb->list, &napi->rx_list); in gro_normal_one()
526 napi->rx_count += segs; in gro_normal_one()
527 if (napi->rx_count >= READ_ONCE(net_hotdata.gro_normal_batch)) in gro_normal_one()
534 * The caller must verify skb_valid_dst(skb) is false and skb->dev is initialized.
539 *iif = inet_iif(skb) ?: skb->dev->ifindex; in inet_get_iif_sdif()
543 if (netif_is_l3_slave(skb->dev)) { in inet_get_iif_sdif()
544 struct net_device *master = netdev_master_upper_dev_get_rcu(skb->dev); in inet_get_iif_sdif()
547 *iif = master ? master->ifindex : 0; in inet_get_iif_sdif()
555 * The caller must verify skb_valid_dst(skb) is false and skb->dev is initialized.
560 /* using skb->dev->ifindex because skb_dst(skb) is not initialized */ in inet6_get_iif_sdif()
561 *iif = skb->dev->ifindex; in inet6_get_iif_sdif()
565 if (netif_is_l3_slave(skb->dev)) { in inet6_get_iif_sdif()
566 struct net_device *master = netdev_master_upper_dev_get_rcu(skb->dev); in inet6_get_iif_sdif()
569 *iif = master ? master->ifindex : 0; in inet6_get_iif_sdif()