Lines Matching refs:from

103  * size, and we can differentiate heads from skb_small_head_cache
430 * skb_shared_info. @data must have been allocated from the page
608 * @flags: If SKB_ALLOC_FCLONE is set, allocate from fclone cache
618 * Buffers may only be allocated from interrupts using a @gfp_mask of
766 * attempt to allocate the head from a special reserved region used
1159 * Must only be called from net_ratelimit()-ed paths.
1790 * If this function is called from an interrupt gfp_mask() must be
1888 * If this function is called from an interrupt gfp_mask() must be
1999 * @fclone: if true allocate the copy of the skb from the fclone
2297 * is called from an interrupt.
2452 * skb_pull - remove data from the start of a buffer
2456 * This function removes data from the start of a buffer, returning
2468 * skb_pull_data - remove data from the start of a buffer returning its
2473 * This function removes data from the start of a buffer, returning
2492 * skb_trim - remove end from a buffer
2496 * Cut the length of a buffer down by removing data from the tail. If
2623 * data from fragmented part.
2634 /* Moves tail of skb head forward, copying data from fragmented part,
2768 * skb_copy_bits - copy bits from skb to kernel buffer
2774 * Copy the specified number of bytes from the source skb to the
2780 * since it is called from BPF assembly code.
2861 * Callback from splice_to_pipe(), if we need to release some pages
2964 * Map linear and fragment data from the skb to spd. It reports true if the
3016 * Map data from the skb to a pipe. Should handle both the linear part,
3180 * skb_store_bits - store bits from kernel buffer to skb
3183 * @from: source buffer
3186 * Copy the specified number of bytes from the source buffer to the
3191 int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len)
3203 skb_copy_to_linear_data_offset(skb, offset, from, copy);
3207 from += copy;
3229 memcpy(vaddr + p_off, from + copied, p_len);
3236 from += copy;
3251 from, copy))
3256 from += copy;
3470 * which has been changed from the hardware checksum, for example, by
3539 * @from: source buffer
3545 skb_zerocopy_headlen(const struct sk_buff *from)
3549 if (!from->head_frag ||
3550 skb_headlen(from) < L1_CACHE_BYTES ||
3551 skb_shinfo(from)->nr_frags >= MAX_SKB_FRAGS) {
3552 hlen = skb_headlen(from);
3554 hlen = from->len;
3557 if (skb_has_frag_list(from))
3558 hlen = from->len;
3567 * @from: source buffer
3568 * @len: number of bytes to copy from source buffer
3571 * Copies up to `len` bytes from `from` to `to` by creating references
3579 * -ENOMEM: couldn't orphan frags of @from due to lack of memory
3583 skb_zerocopy(struct sk_buff *to, struct sk_buff *from, int len, int hlen)
3591 BUG_ON(!from->head_frag && !hlen);
3595 return skb_copy_bits(from, 0, skb_put(to, len), len);
3598 ret = skb_copy_bits(from, 0, skb_put(to, hlen), hlen);
3603 plen = min_t(int, skb_headlen(from), len);
3605 page = virt_to_head_page(from->head);
3606 offset = from->data - (unsigned char *)page_address(page);
3616 if (unlikely(skb_orphan_frags(from, GFP_ATOMIC))) {
3617 skb_tx_error(from);
3620 skb_zerocopy_clone(to, from, GFP_ATOMIC);
3622 for (i = 0; i < skb_shinfo(from)->nr_frags; i++) {
3627 skb_shinfo(to)->frags[j] = skb_shinfo(from)->frags[i];
3669 * skb_dequeue - remove from the head of the queue
3670 * @list: list to dequeue from
3690 * skb_dequeue_tail - remove from the tail of the queue
3691 * @list: list to dequeue from
3714 * Delete all buffers on an &sk_buff list. Each buffer is removed from
3733 * Delete all buffers on an &sk_buff rbtree. Each buffer is removed from
3818 * skb_unlink - remove a buffer from a list
3822 * Remove a packet from a list. The list locks are taken and this
3941 /* Shifting from/to a cloned skb is a no-go.
3951 * skb_shift - Shifts paged data partially from skb to another
3953 * @skb: buffer from which the paged data comes from
3957 * the length of the skb, from skb to tgt. Returns number bytes shifted.
3970 int from, to, merge, todo;
3981 from = 0;
3983 fragfrom = &skb_shinfo(skb)->frags[from];
4002 fragfrom = &skb_shinfo(skb)->frags[from];
4012 from++;
4017 (skb_shinfo(skb)->nr_frags - from) > (MAX_SKB_FRAGS - to))
4023 while ((todo > 0) && (from < skb_shinfo(skb)->nr_frags)) {
4027 fragfrom = &skb_shinfo(skb)->frags[from];
4033 from++;
4064 while (from < skb_shinfo(skb)->nr_frags)
4065 skb_shinfo(skb)->frags[to++] = skb_shinfo(skb)->frags[from++];
4086 * @from: lower offset of data to be read
4093 void skb_prepare_seq_read(struct sk_buff *skb, unsigned int from,
4096 st->lower_offset = from;
4245 * @from: search offset
4254 unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
4266 skb_prepare_seq_read(skb, from, to, TS_SKB_CB(&state));
4269 return (ret + patlen <= to - from ? ret : UINT_MAX);
4763 * Idea is to tranfert ownership from head_skb to last segment.
4855 * and should not be copied to/from user.
4940 * skb_to_sgvec - Fill a scatter-gather list from a socket buffer
5185 * prevent the socket from being released prior to being enqueued on
5260 /* Take a reference to prevent skb_orphan() from freeing the socket,
5355 /* Take a reference to prevent skb_orphan() from freeing the socket,
5372 * @off: the offset from start to place the checksum.
5641 * differs from the provided skb.
5681 * differs from the provided skb.
5737 * @from: buffer to add
5741 bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from,
5745 int i, delta, len = from->len;
5758 * In theory we could take full references if @from is cloned and
5762 if (to->pp_recycle != from->pp_recycle ||
5763 (from->pp_recycle && skb_cloned(from)))
5768 BUG_ON(skb_copy_bits(from, 0, skb_put(to, len), len));
5774 from_shinfo = skb_shinfo(from);
5777 if (skb_zcopy(to) || skb_zcopy(from))
5780 if (skb_headlen(from) != 0) {
5788 if (skb_head_is_locked(from))
5791 delta = from->truesize - SKB_DATA_ALIGN(sizeof(struct sk_buff));
5793 page = virt_to_head_page(from->head);
5794 offset = from->data - (unsigned char *)page_address(page);
5797 page, offset, skb_headlen(from));
5804 delta = from->truesize - SKB_TRUESIZE(skb_end_offset(from));
5814 if (!skb_cloned(from))
5839 * into/from a tunnel. Some information have to be cleared during these
5948 /* remove VLAN header from packet and update csum accordingly.
5981 /* Pop a vlan tag either from hwaccel or from payload.
6125 * skb_mpls_push() - push a new MPLS header after mac_len bytes from start of
6356 /* carve out the first off bytes from skb when off < headlen */
6415 /* carve out the first eat bytes from skb's frag_list. May recurse into
6469 /* carve off first len bytes from skb. Split line (off) is in the
6548 /* remove len bytes from the beginning of the skb */
6559 /* Extract to_copy bytes starting at off from skb, and return this in
6879 * extracts pages from an iterator and adds them to the socket buffer if